manticoresoftware / manticoresearch

Easy to use open source fast database for search | Good alternative to Elasticsearch now | Drop-in replacement for E in the ELK soon
https://manticoresearch.com
GNU General Public License v3.0
9.02k stars 505 forks source link

Error using Java SQL: jdbc driver internal error #1390

Closed qinxingnet closed 5 months ago

qinxingnet commented 1 year ago

Hi, according to the introduction on the official website, I would like to use ms instead of ES. https://manual.manticoresearch.com/Quick_start_guide

using self mysqlClient: create table products(title text, price float) morphology='stem_en'; insert into products(title,price) values ('Crossbody Bag with Tassel', 19.85), ('microfiber sheet set', 19.99), ('Pet Hair Remover Glove', 7.99);

But when using Java SQL in Java programs, there is an error: internal error in the jdbc driver update products set price=18.5 where id = 1513686608316989452;

at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:133)
    at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:582)
    at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$1(SQLQueryJob.java:491)
    at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:501)
    at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:934)
    at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:3937)
    at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:123)
    at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:190)
    at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:121)
    at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer$ResultSetDataPumpJob.run(ResultSetViewer.java:5142)
    at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.sql.SQLException: jdbc 驱动内部错误
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.handleExecuteError(JDBCStatementImpl.java:295)
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:332)
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:131)
    ... 11 more
Caused by: java.lang.NumberFormatException: For input string: "<empty>"
    at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)
    at java.base/java.lang.Integer.parseInt(Unknown Source)
    at java.base/java.lang.Integer.parseInt(Unknown Source)
    at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1402)
    at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1390)
    at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:678)
    at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648)
    at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:330)
    ... 12 more

The same error occurred while using native Java for jdbc. I guess some driving parameters were not taken into account. Our group discussion is unlikely to use MS instead of ES, and even other members support the use of crateDb. This is very frustrating.

sanikolaev commented 1 year ago

How can I reproduce it? What would be the minimal script in java for that?

jacentsao commented 1 year ago

demo.zip image

@sanikolaev try this demo. maybe same error

sanikolaev commented 1 year ago

Most likely caused by https://github.com/manticoresoftware/manticoresearch/issues/1385 . Let's wait until that it is fixed.

Maximusya commented 9 months ago

Using Java Mysql Connector, we had no issues while using Manticore 5.0.X. But when we tried to switch to Manticore 6.X, we encountered those java.lang.NumberFormatException: For input string: "<empty>" too.

When we looked at https://github.com/mysql/mysql-connector-j/blob/release/8.x/src/main/user-impl/java/com/mysql/cj/jdbc/ConnectionImpl.java#L1353, we saw those versionMeetsMinimum that kinda explained why we started getting into those code branches.

And just like it is said at https://manual.manticoresearch.com/dev/Connecting_to_the_server/MySQL_protocol#Notes-on-MySQL-connectors - we played with mysql_version_string in searchd config and with mysql_version_string = 5.0.0 things kinda turned back to normal... Still testing though.

sanikolaev commented 9 months ago

Most likely caused by https://github.com/manticoresoftware/manticoresearch/issues/1385 . Let's wait until that it is fixed.

Fixed. We can continue with this one.

Nick-S-2018 commented 5 months ago

It should work fine now with the latest dev version of Manticore. ( The issue that caused the error was fixed in https://github.com/manticoresoftware/manticoresearch/commit/1dfe68cd3c6fb8d2d21cbe690b5790b25d37d2dc )