[
https://issues.jboss.org/browse/ISPN-3497?page=com.atlassian.jira.plugin....
]
Mircea Markus updated ISPN-3497:
--------------------------------
Labels: jdg62blocker (was: Critical)
getCountRowsSql() has wrong SQL syntax
--------------------------------------
Key: ISPN-3497
URL:
https://issues.jboss.org/browse/ISPN-3497
Project: Infinispan
Issue Type: Bug
Components: Loaders and Stores
Affects Versions: 6.0.0.Alpha4
Reporter: Vitalii Chepeliuk
Assignee: Mircea Markus
Labels: jdg62blocker
Fix For: 6.0.0.Beta2
When I run tests with mysql database following exception is thrown
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error
in your SQL syntax; check the manual that corresponds to your MySQL server version for the
right syntax to use near '*) FROM `mix_str____defaultcache`' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322)
at
org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
at
org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedStore.size(JdbcStringBasedStore.java:358)
{code:title=TableManipulation.java|borderStyle=solid}
public String getCountRowsSql() {
if (countRowsSql == null) {
countRowsSql = "SELECT COUNT (*) FROM " + getTableName(); <<<
here should be COUNT(*) without space
}
return countRowsSql;
}
{code}
MySQL is complaining when there is SPACE between COUNT and (*)
>[Error] Script lines: 5-6 --------------------------
You have an error in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near '*) FROM
`edg_string____defaultcache`' at line 1
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira