libsql / sqld

LibSQL with extended capabilities like HTTP protocol, replication, and more.
https://libsql.org
900 stars 38 forks source link

create virtual table not working #358

Open glommer opened 1 year ago

glommer commented 1 year ago

CREATE VIRTUAL TABLE used by many extensions, is not working.

The problem is that when we parse a statement like this:

CREATE VIRTUAL TABLE t3 using fts5(a,b,c);

it gets transformed inside SQLd to:

CREATE VIRTUAL TABLE t3 using fts5();

I narrowed it down to the parse_inner function in query_analysis.rs.

This statement:

            println!("parse inner: {:?}=>{}", c, c.to_string());

prints:

parse inner: Stmt(CreateVirtualTable { if_not_exists: false, tbl_name: QualifiedName { db_name: None, name: Name("t3"), alias: None }, module_name: Name("fts5"), args: None })=>CREATE VIRTUAL TABLE t3 USING fts5 ();

As you can see, the args disappeared. So the to_string() function gave us the wrong results

glommer commented 1 year ago

https://github.com/gwenn/lemon-rs/issues/30