View Issue Details

IDProjectCategoryView StatusLast Update
0000967SymmetricDSBugpublic2014-02-02 20:53
ReporterseroteevAssigned Tochenson 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.2.0 
Target Version3.3.0.pre.1Fixed in Version3.3.0 
Summary0000967: Unknown table "INFORMATION_SCHEMA.SESSION_STATUS" error for MySQL 5.0.XX
DescriptionAn exception was thrown when I tried to create the sym tables, because INFORMATION_SCHEMA.SESSION_STATUS does not exist in my version of MYSQL.
I tried to locate the problem and I think it has something to do with the "IF" statement in in org.jumpmind.symmetric.db.mysql.MySqlSymmetricDialect.createRequiredDatabaseObjects(MySqlSymmetricDialect.java:88)

There is a check for the version of mysql. For version between 5.0 and 5.1.23 the first part of the statement is executed. For versions above 5.1.23 -> the "else" part of the statement is executed. The problem is that the "sql" string is the same for both cases, but it should differ.

I am not sure how exactly to fix this, but I hope that you will help me with this issue.

Best Regards,
Stefan
Steps To ReproduceRun the following command:
../bin/symadmin --engine myserver-000 create-sym-tables 2>&1 | less
Additional Information[myserver-000] - MySqlSymmetricDialect - Done with auto update of SymmetricDS tables
Exception in thread "symmetric-startup" org.jumpmind.db.sql.SqlException: Unknown table 'SESSION_STATUS' in information_schema
        at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:260)
        at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:251)
        at org.jumpmind.db.sql.JdbcSqlTemplate.execute(JdbcSqlTemplate.java:391)
        at org.jumpmind.db.sql.JdbcSqlTemplate.update(JdbcSqlTemplate.java:261)
        at org.jumpmind.db.sql.AbstractSqlTemplate.update(AbstractSqlTemplate.java:184)
        at org.jumpmind.symmetric.db.AbstractSymmetricDialect.install(AbstractSymmetricDialect.java:161)
        at org.jumpmind.symmetric.db.mysql.MySqlSymmetricDialect.createRequiredDatabaseObjects(MySqlSymmetricDialect.java:88)
        at org.jumpmind.symmetric.db.AbstractSymmetricDialect.initTablesAndDatabaseObjects(AbstractSymmetricDialect.java:144)
        at org.jumpmind.symmetric.AbstractSymmetricEngine.setupDatabase(AbstractSymmetricEngine.java:360)
        at org.jumpmind.symmetric.AbstractSymmetricEngine.setup(AbstractSymmetricEngine.java:352)
        at org.jumpmind.symmetric.AbstractSymmetricEngine.start(AbstractSymmetricEngine.java:486)
        at org.jumpmind.symmetric.AbstractSymmetricEngine.start(AbstractSymmetricEngine.java:482)
        at org.jumpmind.symmetric.web.SymmetricEngineHolder$EngineStarter.run(SymmetricEngineHolder.java:320)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'SESSION_STATUS' in information_schema
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        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:1052)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2415)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2333)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2318)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at org.jumpmind.db.sql.JdbcSqlTemplate$5.execute(JdbcSqlTemplate.java:283)
        at org.jumpmind.db.sql.JdbcSqlTemplate$5.execute(JdbcSqlTemplate.java:261)
        at org.jumpmind.db.sql.JdbcSqlTemplate.execute(JdbcSqlTemplate.java:389)
        ... 10 more
TagsNo tags attached.

Activities

seroteev

2013-01-02 08:21

reporter   ~0000179

Last edited: 2013-01-02 08:23

View 2 revisions

I think that the 'sql' variable in the first part of the if statement should be changed to the following, but I am not sure how to rebuild the project from source code:

String sql = "create function $(functionName)() " +
" returns varchar(50) NOT DETERMINISTIC READS SQL DATA " +
" begin " +
" declare comm_name varchar(50); " +
" declare comm_value varchar(50); " +
" declare comm_cur cursor for show status like 'Com_commit'; " +
" if @@autocommit = 0 then " +
" open comm_cur; " +
" fetch comm_cur into comm_name, comm_value; " +
" close comm_cur; " +
" return concat(concat(connection_id(), '.'), comm_value); " +
" else " +
" return null; " +
" end if; " +
" end ";

Related Changesets

SymmetricDS: master 49227036

2013-01-31 08:55:13

chenson

Details Diff
0000967: Unknown table "INFORMATION_SCHEMA.SESSION_STATUS" error for MySQL 5.0.XX
0000967
mod - symmetric-client/src/main/java/org/jumpmind/symmetric/db/mysql/MySqlSymmetricDialect.java Diff File

Issue History

Date Modified Username Field Change
2013-01-02 05:42 seroteev New Issue
2013-01-02 08:21 seroteev Note Added: 0000179
2013-01-02 08:23 seroteev Note Edited: 0000179 View Revisions
2013-01-31 08:55 chenson Fixed in Version => 3.3.0.pre.1
2013-01-31 08:55 chenson Target Version => 3.3.0.pre.1
2013-01-31 08:55 chenson Status new => closed
2013-01-31 08:55 chenson Assigned To => chenson
2013-01-31 08:55 chenson Resolution open => fixed
2013-02-04 15:48 chenson Fixed in Version 3.3.0.pre.1 => 3.3.0
2014-02-02 20:53 Changeset attached => SymmetricDS trunk r6800
2015-07-30 21:49 chenson Changeset attached => SymmetricDS master 49227036