JDBC MYSQL 语法错误异常
JDBC/SphinxQL(Sphinx 版本 2.01 Beta)执行以下查询
我正在使用带有 WHERE 子句的
ResultSet res = stmt.executeQuery("SELECT * FROM myindex WHERE MATCH('name')");
:没有 WHERE 子句
ResultSet res = stmt.executeQuery("SELECT * FROM myindex");
但是在这两种情况下,我都会收到以下相当大的错误:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
sphinxql: syntax error, unexpected WHERE, expecting $end near
'WHERE Variable_name ='language' OR Variable_name =
'net_write_timeout' OR Variable_name = 'interactive_timeout'
OR Variable_name = 'wait_timeout' OR Variable_name =
'character_set_client' OR Variable_name = 'character_set_connection'
OR Variable_name = 'character_set' OR Variable_name
= 'character_set_server' OR Variable_name = 'tx_isolation'
OR Variable_name = 'transaction_isolation' OR Variable_name
= 'character_set_results' OR Variable_name = 'timezone'
OR Variable_name = 'time_zone' OR Variable_name =
'system_time_zone' OR Variable_name = 'lower_case_table_names'
OR Variable_name = 'max_allowed_packet' OR
Variable_name = 'net_buffer_length' OR Variable_name =
'sql_mode' OR Variable_name = 'query_cache_type'
OR Variable_name = 'query_cache_size' OR Variable_name = 'init_connect''
我根本不理解该错误。 .帮助表示赞赏!
I am executing the following queries with JDBC/SphinxQL (Sphinx version 2.01 Beta)
with a WHERE clause:
ResultSet res = stmt.executeQuery("SELECT * FROM myindex WHERE MATCH('name')");
without a WHERE CLAUSE
ResultSet res = stmt.executeQuery("SELECT * FROM myindex");
But in both scenarios, I am getting the following pretty huge error:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
sphinxql: syntax error, unexpected WHERE, expecting $end near
'WHERE Variable_name ='language' OR Variable_name =
'net_write_timeout' OR Variable_name = 'interactive_timeout'
OR Variable_name = 'wait_timeout' OR Variable_name =
'character_set_client' OR Variable_name = 'character_set_connection'
OR Variable_name = 'character_set' OR Variable_name
= 'character_set_server' OR Variable_name = 'tx_isolation'
OR Variable_name = 'transaction_isolation' OR Variable_name
= 'character_set_results' OR Variable_name = 'timezone'
OR Variable_name = 'time_zone' OR Variable_name =
'system_time_zone' OR Variable_name = 'lower_case_table_names'
OR Variable_name = 'max_allowed_packet' OR
Variable_name = 'net_buffer_length' OR Variable_name =
'sql_mode' OR Variable_name = 'query_cache_type'
OR Variable_name = 'query_cache_size' OR Variable_name = 'init_connect''
I don't understand the error at all...help is appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SphinxQL 无法识别不同的子句,例如我们
timezone、interactive_timeout、net_write_timeout 等这就是这些查询失败的原因。您必须使用不同的 MySQL 客户端,该客户端不会发布此类不必要的内容 - 只是您的普通查询。或者您可以尝试 SphinxSerach 服务来向开发人员指出该问题。
SphinxQL can't recognize different clauses such us
timezone, interactive_timeout, net_write_timeout etc That is why these queries failed. You have to use different MySQL client that doesn't post such unnedded stuff - just your plain query. Or you could try SphinxSerach services to point the developers to that issue.
您的 MATCH 谓词格式不正确。
更改:
至
You have incorrectly formatted your MATCH predicate.
Change:
To