google-code-export / sqljet

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

SQLJet Compatibility / Features with existing SQLite DB #172

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open attached database (in code or with the browser project)
2. In code you will need to open a table or view table names

What is the expected output? What do you see instead?

It is expected, perhaps incorrectly, that the database will be opened and rows 
can be read from any given table.

Instead, the following:

org.tmatesoft.sqljet.core.internal.lang.SqlJetParserException: [line 3:23] no 
viable alternative at input 'sortconcat'
CREATE VIEW meta AS
        SELECT id, title,
               (SELECT sortconcat(bal.id, name) FROM books_authors_link AS bal JOIN authors ON(author = authors.id) WHERE book = books.id) authors,
               (SELECT name FROM publishers WHERE publishers.id IN (SELECT publisher from books_publishers_link WHERE book=books.id)) publisher,
               (SELECT rating FROM ratings WHERE ratings.id IN (SELECT rating from books_ratings_link WHERE book=books.id)) rating,
               timestamp,
               (SELECT MAX(uncompressed_size) FROM data WHERE book=books.id) size,
               (SELECT concat(name) FROM tags WHERE tags.id IN (SELECT tag from books_tags_link WHERE book=books.id)) tags,
               (SELECT text FROM comments WHERE book=books.id) comments,
               (SELECT name FROM series WHERE series.id IN (SELECT series FROM books_series_link WHERE book=books.id)) series,
               series_index,
               sort,
               author_sort,
               (SELECT concat(format) FROM data WHERE data.book=books.id) formats,
               isbn,
               path,
               lccn,
               pubdate,
               flags,
               uuid
        FROM books
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.displayRecognitionError(SqlParser.java:303)
    at org.antlr.runtime.BaseRecognizer.reportError(BaseRecognizer.java:186)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.atom_expr(SqlParser.java:4491)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.unary_subexpr(SqlParser.java:3768)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.con_subexpr(SqlParser.java:3593)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.mul_subexpr(SqlParser.java:3475)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.add_subexpr(SqlParser.java:3366)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.bit_subexpr(SqlParser.java:3257)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.neq_subexpr(SqlParser.java:3148)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.eq_subexpr(SqlParser.java:3039)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.and_subexpr(SqlParser.java:1806)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.or_subexpr(SqlParser.java:1715)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.expr(SqlParser.java:1622)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.atom_expr(SqlParser.java:4260)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.unary_subexpr(SqlParser.java:3768)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.con_subexpr(SqlParser.java:3593)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.mul_subexpr(SqlParser.java:3475)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.add_subexpr(SqlParser.java:3366)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.bit_subexpr(SqlParser.java:3257)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.neq_subexpr(SqlParser.java:3148)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.eq_subexpr(SqlParser.java:3039)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.and_subexpr(SqlParser.java:1806)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.or_subexpr(SqlParser.java:1715)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.expr(SqlParser.java:1622)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.result_column(SqlParser.java:8243)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.select_core(SqlParser.java:7804)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.select_list(SqlParser.java:7466)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.select_stmt(SqlParser.java:7169)
    at org.tmatesoft.sqljet.core.internal.lang.SqlParser.create_view_stmt(SqlParser.java:15261)
    at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.parseView(SqlJetSchema.java:422)
    at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.readShema(SqlJetSchema.java:354)
    at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.init(SqlJetSchema.java:168)
    at org.tmatesoft.sqljet.core.internal.schema.SqlJetSchema.<init>(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.getOptions(SqlJetEngine.java:299)
    at 
... cut off junit portion

What version of the product are you using? On what operating system?

SQLJet 1.1.6

Please provide any additional information below.

The database is created by Calibre

Original issue reported on code.google.com by chris.ru...@gmail.com on 12 Feb 2013 at 4:48

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by sergey.s...@gmail.com on 12 Feb 2013 at 5:56

GoogleCodeExporter commented 9 years ago
So, how can I jump in to help.  I mean: what's the fix here.  Having an option 
to ignore faulty views or triggers would be awesome... but it looks like some 
new things might necessary in the grammar.

Original comment by chris.ru...@gmail.com on 12 Feb 2013 at 7:18

GoogleCodeExporter commented 9 years ago
I'll fix it ASAP. Thanks you a lot for reporting.

Original comment by sergey.s...@gmail.com on 12 Feb 2013 at 7:27

GoogleCodeExporter commented 9 years ago
No, thank you for working on something so cool!  This project is going to save 
me a bunch of caveats and conditions for end-user deployments.

Original comment by chris.ru...@gmail.com on 12 Feb 2013 at 8:17

GoogleCodeExporter commented 9 years ago
I also wanted to point out that there are several triggers in there that cannot 
be read by sqljet as well.

Original comment by chris.ru...@gmail.com on 14 Feb 2013 at 7:08

GoogleCodeExporter commented 9 years ago
I built from src (r1250) and used it against the project I was using the rest 
against earlier and it worked like a charm.  From my point of view I'd consider 
this closed.

Original comment by chris.ru...@gmail.com on 25 Feb 2013 at 6:47

GoogleCodeExporter commented 9 years ago
Actually, I'm just crazy, that was built from trunk and not 1.1 branch.  Sorry!

Original comment by chris.ru...@gmail.com on 25 Feb 2013 at 8:31

GoogleCodeExporter commented 9 years ago
That's OK ... Just because I've fixed it in trunk recently after this your 
reporting :) 

The only problem left is that we need to thoroughly test all our test keys 
before merging changes in release. I hope it will coming soon :)

Right now you could use build from trunk if it suitable for you. Thanks again.

Original comment by sergey.s...@gmail.com on 26 Feb 2013 at 11:34

GoogleCodeExporter commented 9 years ago
We released on site a new build with fix for this issue.

Original comment by sergey.s...@gmail.com on 19 Mar 2013 at 1:34

GoogleCodeExporter commented 9 years ago
I caught the build from the sqljet repo a few days ago.  Works as expected.  

Original comment by chris.ru...@gmail.com on 19 Mar 2013 at 1:52

GoogleCodeExporter commented 9 years ago
Thanks.

Original comment by sergey.s...@gmail.com on 19 Mar 2013 at 11:52