Attempt to delete a row from the responses table fails with error

Open
#1,035 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python, sqlite
Domain
database

Research direction

Start by reproducing the DELETE against the responses table and inspect the responses_fts virtual table and responses_ad trigger involved in keeping them synchronized. Trace how the project creates and uses these objects; done means deleting a responses row succeeds without the unsafe-use error while leaving the FTS table consistent.

Written by the indexing model from the issue text.

Description

sqlite> DELETE FROM responses WHERE rowid = 346;
Parse error: unsafe use of virtual table "responses_fts"

I was able to delete the row in both responses and responses_fts by dropping the trigger (responses_ad).

Some details of my system.

Python version: 3.12.4 (main, Dec 28 2024, 10:56:47) [Clang 19.1.6 ]
SQLite version: 3.43.2
SQLite compile options
  ATOMIC_INTRINSICS=1
  BUG_COMPATIBLE_20160819
  CCCRYPT256
  COMPILER=clang-16.0.0
  DEFAULT_AUTOVACUUM
  DEFAULT_CACHE_SIZE=2000
  DEFAULT_CKPTFULLFSYNC
  DEFAULT_FILE_FORMAT=4
  DEFAULT_JOURNAL_SIZE_LIMIT=32768
  DEFAULT_LOOKASIDE=1200,102
  DEFAULT_MEMSTATUS=0
  DEFAULT_MMAP_SIZE=0
  DEFAULT_PAGE_SIZE=4096
  DEFAULT_PCACHE_INITSZ=20
  DEFAULT_RECURSIVE_TRIGGERS
  DEFAULT_SECTOR_SIZE=4096
  DEFAULT_SYNCHRONOUS=2
  DEFAULT_WAL_AUTOCHECKPOINT=1000
  DEFAULT_WAL_SYNCHRONOUS=1
  DEFAULT_WORKER_THREADS=0
  DQS=3
  ENABLE_API_ARMOR
  ENABLE_BYTECODE_VTAB
  ENABLE_COLUMN_METADATA
  ENABLE_DBSTAT_VTAB
  ENABLE_FTS3
  ENABLE_FTS3_PARENTHESIS
  ENABLE_FTS3_TOKENIZER
  ENABLE_FTS4
  ENABLE_FTS5
  ENABLE_LOCKING_STYLE=1
  ENABLE_MATH_FUNCTIONS
  ENABLE_NORMALIZE
  ENABLE_PREUPDATE_HOOK
  ENABLE_RTREE
  ENABLE_SESSION
  ENABLE_SNAPSHOT
  ENABLE_SQLLOG
  ENABLE_STMT_SCANSTATUS
  ENABLE_UNKNOWN_SQL_FUNCTION
  ENABLE_UPDATE_DELETE_LIMIT
  HAS_CODEC_RESTRICTED
  HAVE_ISNAN
  MALLOC_SOFT_LIMIT=1024
  MAX_ATTACHED=10
  MAX_COLUMN=2000
  MAX_COMPOUND_SELECT=500
  MAX_DEFAULT_PAGE_SIZE=8192
  MAX_EXPR_DEPTH=1000
  MAX_FUNCTION_ARG=127
  MAX_LENGTH=2147483645
  MAX_LIKE_PATTERN_LENGTH=50000
  MAX_MMAP_SIZE=1073741824
  MAX_PAGE_COUNT=1073741823
  MAX_PAGE_SIZE=65536
  MAX_SQL_LENGTH=1000000000
  MAX_TRIGGER_DEPTH=1000
  MAX_VARIABLE_NUMBER=500000
  MAX_VDBE_OP=250000000
  MAX_WORKER_THREADS=8
  MUTEX_UNFAIR
  OMIT_AUTORESET
  OMIT_LOAD_EXTENSION
  STMTJRNL_SPILL=131072
  SYSTEM_MALLOC
  TEMP_STORE=1
  THREADSAFE=2
  USE_URI
Pragma foreign_keys: 0
Pragma defer_foreign_keys: 0
Pragma ignore_check_constraints: 0
Pragma legacy_alter_table: 1
Pragma recursive_triggers: 0
Pragma writable_schema: 0
Dominant language
Python
Stars
12.5k
Forks
998
Avg merge
6d 12h
Merged PRs (30d)
15

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from simonw/llm

All issues in simonw/llm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.