删除最初使用“未知令牌生成器"创建的表? [英] Drop a table originally created with 'unknown tokenizer'?

查看:121
本文介绍了删除最初使用“未知令牌生成器"创建的表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个sqlite3数据库.无法删除此数据库中的单个表,错误消息为unknown tokenizer: mm.

I have a sqlite3 database. A single table inside this DB can't be dropped, the error message says unknown tokenizer: mm.

我在最新的 SQLiteSpy NuGet 包v 1.0.103.

I tried it directly with the command DROP TABLE tablename; inside the newest SQLiteSpy v1.9.11 and also within .NET code and the official sqlite NuGet package v 1.0.103.

如何删除标记符未知的表?

How can I drop a table where the tokenizer is unknown?

推荐答案

文档说:

对于数据库中的每个FTS虚拟表,将创建三到五个真实(非虚拟)表来存储基础数据.这些实际表称为影子表".实际表的名称为%_content",%_ segdir",%_ segments",%_ stat"和%_docsize",其中%"由FTS虚拟表的名称替换.

For each FTS virtual table in a database, three to five real (non-virtual) tables are created to store the underlying data. These real tables are called "shadow tables". The real tables are named "%_content", "%_segdir", "%_segments", "%_stat", and "%_docsize", where "%" is replaced by the name of the FTS virtual table.

因此,要删除该表,请删除阴影表:

So to get rid of that table, drop the shadow tables:

DROP TABLE tablename_content;
DROP TABLE tablename_segdir;
DROP TABLE tablename_segments;
DROP TABLE tablename_stat;
DROP TABLE tablename_docsize;

然后使用(非常危险) PRAGMA writable_schema 删除剩余信息关于系统表中的该表:

And then use the (very dangerous) PRAGMA writable_schema to remove the remaining information about this table from the system table:

PRAGMA writable_schema = ON;
DELETE FROM sqlite_master WHERE type = 'table' AND name = 'tablename';

SQLite缓存模式信息,因此您需要关闭并重新打开数据库.

SQLite caches schema information, so then you need to close and re-open the database.

这篇关于删除最初使用“未知令牌生成器"创建的表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆