tursodatabase / libsql

libSQL is a fork of SQLite that is both Open Source, and Open Contributions.
https://turso.tech/libsql
MIT License
11.24k stars 286 forks source link

Fix fts5 crash #1645

Closed sivukhin closed 3 months ago

sivukhin commented 3 months ago

Context

fts5 can crash if malformed tokenizer arguments are provided like this (see https://sqlite.org/forum/forumpost/171bcc2bcd for more details):

CREATE VIRTUAL TABLE t USING fts5(s, tokenize='trigram case_sensitive ');

This PR fixes this issue and make SQLite return regular error in such cases:

$> CREATE VIRTUAL TABLE t USING fts5(s, tokenize='trigram case_sensitive ');
Runtime error: error in tokenizer constructor