Only enable FTS3 when schema needs upgrading
This commit is contained in:
@@ -151,7 +151,7 @@ QSqlDatabase Database::Connect() {
|
|||||||
UpdateDatabaseSchema(0, db);
|
UpdateDatabaseSchema(0, db);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (SchemaVersion(&db) < 10) {
|
||||||
// Register unicode from unicode61 tokenizer to drop old FTS3 tables.
|
// Register unicode from unicode61 tokenizer to drop old FTS3 tables.
|
||||||
// We need it also to drop old devices later when loading devices.
|
// We need it also to drop old devices later when loading devices.
|
||||||
// And that's done in a different thread after schemas are upgraded, so register it anyway.
|
// And that's done in a different thread after schemas are upgraded, so register it anyway.
|
||||||
@@ -160,7 +160,7 @@ QSqlDatabase Database::Connect() {
|
|||||||
if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*") == 0) {
|
if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*") == 0) {
|
||||||
sqlite3 *handle = *static_cast<sqlite3**>(v.data());
|
sqlite3 *handle = *static_cast<sqlite3**>(v.data());
|
||||||
if (handle) {
|
if (handle) {
|
||||||
int result = sqlite3_db_config(handle, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, NULL);
|
int result = sqlite3_db_config(handle, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, nullptr);
|
||||||
if (result != SQLITE_OK) qLog(Fatal) << "Unable to enable FTS3 tokenizer";
|
if (result != SQLITE_OK) qLog(Fatal) << "Unable to enable FTS3 tokenizer";
|
||||||
}
|
}
|
||||||
else qLog(Fatal) << "Unable to enable FTS3 tokenizer";
|
else qLog(Fatal) << "Unable to enable FTS3 tokenizer";
|
||||||
|
|||||||
Reference in New Issue
Block a user