gavioto / sqljet

Automatically exported from code.google.com/p/sqljet
0 stars 0 forks source link

REFERENCES table without column crashes sqljet #183

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
sqlite table:

CREATE TABLE RRAMeta (ActionId INTEGER REFERENCES Actions)


Note, no column name after `Actions`. During schema parse sqljet crashes:

Exception in thread "main" org.antlr.runtime.tree.RewriteEarlyExitException at org.tmatesoft.sqljet.core.internal.lang.SqlParser.fk_clause(SqlParser.java:15409) at org.tmatesoft.sqljet.core.internal.lang.SqlParser.column_constraint(SqlParser.java:13186) at org.tmatesoft.sqljet.core.internal.lang.SqlParser.column_def(SqlParser.java:12878) at org.tmatesoft.sqljet.core.internal.lang.SqlParser.create_table_stmt(SqlParser.java:12545) at org.tmatesoft.sqljet.core.internal.lang.SqlParser.schema_create_table_stmt(SqlParser.java:1405) at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.parseTable(SqlJetSchema.java:410) at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.readShema(SqlJetSchema.java:315) at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.init(SqlJetSchema.java:168) at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.(SqlJetSchema.java:154) at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine$2.runSynchronized(SqlJetEngine.java:282) at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine.runSynchronized(SqlJetEngine.java:217) at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine.readSchema(SqlJetEngine.java:276) at org.tmatesoft.sqljet.core.table.engine.SqlJetEngine.refreshSchema(SqlJetEngine.java:310) at org.tmatesoft.sqljet.core.table.SqlJetDb.getTable(SqlJetDb.java:194)

Original issue reported on code.google.com by stepanc...@mx1.ru on 29 Apr 2014 at 6:56

GoogleCodeExporter commented 9 years ago
sqljet is 1.1.10

Original comment by stepanc...@mx1.ru on 29 Apr 2014 at 7:09

GoogleCodeExporter commented 9 years ago
I just registered the same bug as issue 185 (sorry, did not see yours before)
The solution is in the file SQL.g, I gave it inside my issue. But the code has 
to be rebuilt to make effect.

Original comment by t_cordon...@yahoo.fr on 9 Feb 2015 at 2:53

GoogleCodeExporter commented 9 years ago
I sent in issue 185, which is a duplicate, a patch which works for me.
Hope it will be in the next version.

Original comment by t_cordon...@yahoo.fr on 10 Feb 2015 at 7:13