Skip to content

Incorrect dump export with virtual fts5 tables #2173

@riazus

Description

@riazus

In my database, I have an FTS5 table that uses the fts5vocab Virtual Table Module. When I try to create a dump from my database using libsql, I receive an invalid SQL syntax error.

Let's consider the example:

CREATE VIRTUAL TABLE test_fts USING fts5(content);
CREATE VIRTUAL TABLE test_vocab USING fts5vocab(test_fts, 'row');

Then try to create a dump from this database.

The output will contain the following incorrect statement:

INSERT INTO sqlite_schema(type,name,tbl_name,rootpage,sql) VALUES('table','test_vocab','test_vocab',0,'CREATE VIRTUAL TABLE test_vocab USING fts5vocab(test_fts, 'row')');

Here, 'row' has only one quote on each side, whereas the original sqlite3 dump has the following statement:

INSERT INTO sqlite_schema(type,name,tbl_name,rootpage,sql) VALUES('table','test_vocab','test_vocab',0,'CREATE VIRTUAL TABLE test_vocab USING fts5vocab(test_fts, ''row'')');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions