Files
ast-project/part1/results/3/bug_56e9a4c6-c89f-4226-879c-8667b0a1330f_unexpected_error.md
T
2026-06-24 13:47:14 +02:00

21 KiB

Summary

**No review yet**

Minimized query


.help
.help .archive
.help .auth
.help .backup
.help .bail
.help .cd
.help .changes
.help .check
.help .clone
.help .connection
.help .databases
.help .dbconfig
.help .dbinfo
.help .dump
.help .echo
.help .eqp
.help .excel
.help .exit
.help .expert
.help .explain
.help .filectrl
.help .fullschema
.help .headers
.help .help
.help .import
.help .imposter
.help .indexes
.help .limit
.help .lint
.help .load
.help .log
.help .mode
.help .nonce
.help .nullvalue
.help .once
.help .open
.help .output
.help .parameter
.help .print
.help .progress
.help .prompt
.help .quit
.help .read
.help .recover
.help .restore
.help .save
.help .scanstats
.help .schema
.help .separator
.help .sha3sum
.help .shell
.help .show
.help .stats
.help .system
.help .tables
.help .timeout
.help .timer
.help .trace
.help .version
.help .vfsinfo
.help .vfslist
.help .vfsname
.help .width
 
.import corrupt001.db main
ATTACH DATABASE ':memory:' AS aux92;
BEGIN TRANSACTION;
CREATE TABLE t1(a, b, c);
INSERT INTO "t1" VALUES(json_valid(glob('[!0-9]', 'a'), CAST(8 AS INT8)),'one','I');
CREATE TABLE t2(d, e, f);
INSERT INTO "t2" VALUES(5,'ten','XX');
INSERT INTO "t2" VALUES(6,NULL,NULL);
CREATE INDEX i1 ON t1(b, a);
CREATE TABLE T (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT NOT NULL,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', 3000);
INSERT INTO T VALUES ('b', 'q', 9223372036854775807);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('e', 'q', -9223372036854775808);
INSERT INTO T VALUES ('f', 'r', 0);
SELECT B, COUNT(*) AS D, SUM(C) AS E, AVG(C) AS F FROM T GROUP BY B HAVING SUM(C) > 0;
COMMIT;
REINDEX;
DELETE FROM t2 WHERE NOT NOT (d > (WITH _m AS MATERIALIZED (SELECT * FROM t2) SELECT AVG(d) FROM _m)) ;
ANALYZE t1;
DROP INDEX IF EXISTS t2;
REINDEX;
PRAGMA vdbe_debug = OFF;
SELECT * FROM t2 AS a LEFT OUTER JOIN t2 AS b ON a.rowid = b.rowid;
DETACH DATABASE aux92;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_9582 AS SELECT b FROM t1;
VACUUM;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
CREATE  INDEX IF NOT EXISTS idx_t1_266 ON t1(c);
INSERT INTO t1 DEFAULT VALUES;
ANALYZE t1;
SELECT LAG(a, 1) OVER (ORDER BY a ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
INSERT OR FAIL INTO t2 VALUES (9, 'x', 'x');
ALTER TABLE t1 ADD COLUMN extra_3246 REAL COLLATE RTRIM;
DROP TRIGGER IF EXISTS t2;
SELECT * FROM t1 WHERE (a) IN (SELECT a FROM t1);
INSERT INTO t2 VALUES (NULL, NULL, NULL);
UPDATE t1 SET b = -70 WHERE b IS NOT NULL RETURNING *;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_8808 ON t1(b) WHERE b IS NOT NULL;
INSERT INTO t2 VALUES (NULL, NULL, NULL);
CREATE  INDEX IF NOT EXISTS idx_t2_3119 ON t2((e + 1));
SELECT * FROM t2 CROSS JOIN T;
SELECT * FROM T AS a LEFT OUTER JOIN T AS b ON a.rowid = b.rowid;
REINDEX;
CREATE TRIGGER IF NOT EXISTS trg_T_3792 BEFORE UPDATE OF B ON T BEGIN SELECT RAISE(IGNORE); END;
REINDEX;
VACUUM;

Actual output

SQLite version 3.39.0 2022-05-10 23:28:12
Enter ".help" for usage hints.
sqlite> sqlite> .auth ON|OFF             Show authorizer callbacks
.backup ?DB? FILE        Backup DB (default "main") to FILE
.bail on|off             Stop after hitting an error.  Default OFF
.binary on|off           Turn binary output on or off.  Default OFF
.cd DIRECTORY            Change the working directory to DIRECTORY
.changes on|off          Show number of rows changed by SQL
.check GLOB              Fail if output since .testcase does not match
.clone NEWDB             Clone data into NEWDB from the existing database
.connection [close] [#]  Open or close an auxiliary database connection
.databases               List names and files of attached databases
.dbconfig ?op? ?val?     List or change sqlite3_db_config() options
.dbinfo ?DB?             Show status information about the database
.dump ?OBJECTS?          Render database content as SQL
.echo on|off             Turn command echo on or off
.eqp on|off|full|...     Enable or disable automatic EXPLAIN QUERY PLAN
.excel                   Display the output of next command in spreadsheet
.exit ?CODE?             Exit this program with return-code CODE
.expert                  EXPERIMENTAL. Suggest indexes for queries
.explain ?on|off|auto?   Change the EXPLAIN formatting mode.  Default: auto
.filectrl CMD ...        Run various sqlite3_file_control() operations
.fullschema ?--indent?   Show schema and the content of sqlite_stat tables
.headers on|off          Turn display of headers on or off
.help ?-all? ?PATTERN?   Show help text for PATTERN
.import FILE TABLE       Import data from FILE into TABLE
.imposter INDEX TABLE    Create imposter table TABLE on index INDEX
.indexes ?TABLE?         Show names of indexes
.limit ?LIMIT? ?VAL?     Display or change the value of an SQLITE_LIMIT
.lint OPTIONS            Report potential schema issues.
.load FILE ?ENTRY?       Load an extension library
.log FILE|off            Turn logging on or off.  FILE can be stderr/stdout
.mode MODE ?OPTIONS?     Set output mode
.nonce STRING            Suspend safe mode for one command if nonce matches
.nullvalue STRING        Use STRING in place of NULL values
.once ?OPTIONS? ?FILE?   Output for the next SQL command only to FILE
.open ?OPTIONS? ?FILE?   Close existing database and reopen FILE
.output ?FILE?           Send output to FILE or stdout if FILE is omitted
.parameter CMD ...       Manage SQL parameter bindings
.print STRING...         Print literal STRING
.progress N              Invoke progress handler after every N opcodes
.prompt MAIN CONTINUE    Replace the standard prompts
.quit                    Exit this program
.read FILE               Read input from FILE or command output
.recover                 Recover as much data as possible from corrupt db.
.restore ?DB? FILE       Restore content of DB (default "main") from FILE
.save ?OPTIONS? FILE     Write database to FILE (an alias for .backup ...)
.scanstats on|off        Turn sqlite3_stmt_scanstatus() metrics on or off
.schema ?PATTERN?        Show the CREATE statements matching PATTERN
.selftest ?OPTIONS?      Run tests defined in the SELFTEST table
.separator COL ?ROW?     Change the column and row separators
.sha3sum ...             Compute a SHA3 hash of database content
.shell CMD ARGS...       Run CMD ARGS... in a system shell
.show                    Show the current values for various settings
.stats ?ARG?             Show stats or turn stats on or off
.system CMD ARGS...      Run CMD ARGS... in a system shell
.tables ?TABLE?          List names of tables matching LIKE pattern TABLE
.testcase NAME           Begin redirecting output to 'testcase-out.txt'
.testctrl CMD ...        Run various sqlite3_test_control() operations
.timeout MS              Try opening locked tables for MS milliseconds
.timer on|off            Turn SQL timer on or off
.trace ?OPTIONS?         Output each SQL statement as it is run
.vfsinfo ?AUX?           Information about the top-level VFS
.vfslist                 List all available VFSes
.vfsname ?AUX?           Print the name of the VFS stack
.width NUM1 NUM2 ...     Set minimum column widths for columnar output
sqlite> Nothing matches '.archive'
sqlite> .auth ON|OFF             Show authorizer callbacks
sqlite> .backup ?DB? FILE        Backup DB (default "main") to FILE
   Options:
       --append            Use the appendvfs
       --async             Write to FILE without journal and fsync()
.save ?OPTIONS? FILE     Write database to FILE (an alias for .backup ...)
sqlite> .bail on|off             Stop after hitting an error.  Default OFF
sqlite> .cd DIRECTORY            Change the working directory to DIRECTORY
sqlite> .changes on|off          Show number of rows changed by SQL
sqlite> .check GLOB              Fail if output since .testcase does not match
sqlite> .clone NEWDB             Clone data into NEWDB from the existing database
sqlite> .connection [close] [#]  Open or close an auxiliary database connection
sqlite> .databases               List names and files of attached databases
sqlite> .dbconfig ?op? ?val?     List or change sqlite3_db_config() options
sqlite> .dbinfo ?DB?             Show status information about the database
sqlite> .dump ?OBJECTS?          Render database content as SQL
   Options:
     --data-only            Output only INSERT statements
     --newlines             Allow unescaped newline characters in output
     --nosys                Omit system tables (ex: "sqlite_stat1")
     --preserve-rowids      Include ROWID values in the output
   OBJECTS is a LIKE pattern for tables, indexes, triggers or views to dump
   Additional LIKE patterns can be given in subsequent arguments
sqlite> .echo on|off             Turn command echo on or off
sqlite> .eqp on|off|full|...     Enable or disable automatic EXPLAIN QUERY PLAN
   Other Modes:
      trigger               Like "full" but also show trigger bytecode
sqlite> .excel                   Display the output of next command in spreadsheet
   --bom                   Put a UTF8 byte-order mark on intermediate file
.once ?OPTIONS? ?FILE?   Output for the next SQL command only to FILE
     If FILE begins with '|' then open as a pipe
       --bom  Put a UTF8 byte-order mark at the beginning
       -e     Send output to the system text editor
       -x     Send output as CSV to a spreadsheet (same as ".excel")
sqlite> .exit ?CODE?             Exit this program with return-code CODE
sqlite> .expert                  EXPERIMENTAL. Suggest indexes for queries
sqlite> .explain ?on|off|auto?   Change the EXPLAIN formatting mode.  Default: auto
sqlite> .filectrl CMD ...        Run various sqlite3_file_control() operations
   --schema SCHEMA         Use SCHEMA instead of "main"
   --help                  Show CMD details
sqlite> .fullschema ?--indent?   Show schema and the content of sqlite_stat tables
sqlite> .headers on|off          Turn display of headers on or off
sqlite> .help ?-all? ?PATTERN?   Show help text for PATTERN
sqlite> .import FILE TABLE       Import data from FILE into TABLE
   Options:
     --ascii               Use \037 and \036 as column and row separators
     --csv                 Use , and \n as column and row separators
     --skip N              Skip the first N rows of input
     --schema S            Target table to be S.TABLE
     -v                    "Verbose" - increase auxiliary output
   Notes:
     *  If TABLE does not exist, it is created.  The first row of input
        determines the column names.
     *  If neither --csv or --ascii are used, the input mode is derived
        from the ".mode" output mode
     *  If FILE begins with "|" then it is a command that generates the
        input text.
sqlite> .imposter INDEX TABLE    Create imposter table TABLE on index INDEX
sqlite> .indexes ?TABLE?         Show names of indexes
                           If TABLE is specified, only show indexes for
                           tables matching TABLE using the LIKE operator.
sqlite> .limit ?LIMIT? ?VAL?     Display or change the value of an SQLITE_LIMIT
sqlite> .lint OPTIONS            Report potential schema issues.
     Options:
        fkey-indexes     Find missing foreign key indexes
sqlite> .load FILE ?ENTRY?       Load an extension library
sqlite> .log FILE|off            Turn logging on or off.  FILE can be stderr/stdout
sqlite> .import FILE TABLE       Import data from FILE into TABLE
   Options:
     --ascii               Use \037 and \036 as column and row separators
     --csv                 Use , and \n as column and row separators
     --skip N              Skip the first N rows of input
     --schema S            Target table to be S.TABLE
     -v                    "Verbose" - increase auxiliary output
   Notes:
     *  If TABLE does not exist, it is created.  The first row of input
        determines the column names.
     *  If neither --csv or --ascii are used, the input mode is derived
        from the ".mode" output mode
     *  If FILE begins with "|" then it is a command that generates the
        input text.
.mode MODE ?OPTIONS?     Set output mode
   MODE is one of:
     ascii       Columns/rows delimited by 0x1F and 0x1E
     box         Tables using unicode box-drawing characters
     csv         Comma-separated values
     column      Output in columns.  (See .width)
     html        HTML <table> code
     insert      SQL insert statements for TABLE
     json        Results in a JSON array
     line        One value per line
     list        Values delimited by "|"
     markdown    Markdown table format
     qbox        Shorthand for "box --width 60 --quote"
     quote       Escape answers as for SQL
     table       ASCII-art table
     tabs        Tab-separated values
     tcl         TCL list elements
   OPTIONS: (for columnar modes or insert mode):
     --wrap N       Wrap output lines to no longer than N characters
     --wordwrap B   Wrap or not at word boundaries per B (on/off)
     --ww           Shorthand for "--wordwrap 1"
     --quote        Quote output text as SQL literals
     --noquote      Do not quote output text
     TABLE          The name of SQL table used for "insert" mode
sqlite> .nonce STRING            Suspend safe mode for one command if nonce matches
sqlite> .nullvalue STRING        Use STRING in place of NULL values
sqlite> .once ?OPTIONS? ?FILE?   Output for the next SQL command only to FILE
     If FILE begins with '|' then open as a pipe
       --bom  Put a UTF8 byte-order mark at the beginning
       -e     Send output to the system text editor
       -x     Send output as CSV to a spreadsheet (same as ".excel")
sqlite> .open ?OPTIONS? ?FILE?   Close existing database and reopen FILE
     Options:
        --append        Use appendvfs to append database to the end of FILE
        --deserialize   Load into memory using sqlite3_deserialize()
        --hexdb         Load the output of "dbtotxt" as an in-memory db
        --maxsize N     Maximum size for --hexdb or --deserialized database
        --new           Initialize FILE to an empty database
        --nofollow      Do not follow symbolic links
        --readonly      Open FILE readonly
        --zip           FILE is a ZIP archive
sqlite> .output ?FILE?           Send output to FILE or stdout if FILE is omitted
   If FILE begins with '|' then open it as a pipe.
   Options:
     --bom                 Prefix output with a UTF8 byte-order mark
     -e                    Send output to the system text editor
     -x                    Send output as CSV to a spreadsheet
sqlite> .parameter CMD ...       Manage SQL parameter bindings
   clear                   Erase all bindings
   init                    Initialize the TEMP table that holds bindings
   list                    List the current parameter bindings
   set PARAMETER VALUE     Given SQL parameter PARAMETER a value of VALUE
                           PARAMETER should start with one of: $ : @ ?
   unset PARAMETER         Remove PARAMETER from the binding table
sqlite> .print STRING...         Print literal STRING
sqlite> .progress N              Invoke progress handler after every N opcodes
   --limit N                 Interrupt after N progress callbacks
   --once                    Do no more than one progress interrupt
   --quiet|-q                No output except at interrupts
   --reset                   Reset the count for each input and interrupt
sqlite> .prompt MAIN CONTINUE    Replace the standard prompts
sqlite> .quit                    Exit this program
sqlite> .read FILE               Read input from FILE or command output
    If FILE begins with "|", it is a command that generates the input.
sqlite> .recover                 Recover as much data as possible from corrupt db.
   --freelist-corrupt       Assume the freelist is corrupt
   --recovery-db NAME       Store recovery metadata in database file NAME
   --lost-and-found TABLE   Alternative name for the lost-and-found table
   --no-rowids              Do not attempt to recover rowid values
                            that are not also INTEGER PRIMARY KEYs
sqlite> .restore ?DB? FILE       Restore content of DB (default "main") from FILE
sqlite> .save ?OPTIONS? FILE     Write database to FILE (an alias for .backup ...)
sqlite> .scanstats on|off        Turn sqlite3_stmt_scanstatus() metrics on or off
sqlite> .schema ?PATTERN?        Show the CREATE statements matching PATTERN
   Options:
      --indent             Try to pretty-print the schema
      --nosys              Omit objects whose names start with "sqlite_"
sqlite> .separator COL ?ROW?     Change the column and row separators
sqlite> .sha3sum ...             Compute a SHA3 hash of database content
    Options:
      --schema              Also hash the sqlite_schema table
      --sha3-224            Use the sha3-224 algorithm
      --sha3-256            Use the sha3-256 algorithm (default)
      --sha3-384            Use the sha3-384 algorithm
      --sha3-512            Use the sha3-512 algorithm
    Any other argument is a LIKE pattern for tables to hash
sqlite> .shell CMD ARGS...       Run CMD ARGS... in a system shell
sqlite> .show                    Show the current values for various settings
sqlite> .stats ?ARG?             Show stats or turn stats on or off
   off                      Turn off automatic stat display
   on                       Turn on automatic stat display
   stmt                     Show statement stats
   vmstep                   Show the virtual machine step count only
sqlite> .system CMD ARGS...      Run CMD ARGS... in a system shell
sqlite> .tables ?TABLE?          List names of tables matching LIKE pattern TABLE
sqlite> .timeout MS              Try opening locked tables for MS milliseconds
sqlite> .timer on|off            Turn SQL timer on or off
sqlite> .trace ?OPTIONS?         Output each SQL statement as it is run
    FILE                    Send output to FILE
    stdout                  Send output to stdout
    stderr                  Send output to stderr
    off                     Disable tracing
    --expanded              Expand query parameters
    --plain                 Show SQL as it is input
    --stmt                  Trace statement execution (SQLITE_TRACE_STMT)
    --profile               Profile statements (SQLITE_TRACE_PROFILE)
    --row                   Trace each row (SQLITE_TRACE_ROW)
    --close                 Trace connection close (SQLITE_TRACE_CLOSE)
sqlite> Nothing matches '.version'
sqlite> .vfsinfo ?AUX?           Information about the top-level VFS
sqlite> .vfslist                 List all available VFSes
sqlite> .vfsname ?AUX?           Print the name of the VFS stack
sqlite> .mode MODE ?OPTIONS?     Set output mode
   MODE is one of:
     ascii       Columns/rows delimited by 0x1F and 0x1E
     box         Tables using unicode box-drawing characters
     csv         Comma-separated values
     column      Output in columns.  (See .width)
     html        HTML <table> code
     insert      SQL insert statements for TABLE
     json        Results in a JSON array
     line        One value per line
     list        Values delimited by "|"
     markdown    Markdown table format
     qbox        Shorthand for "box --width 60 --quote"
     quote       Escape answers as for SQL
     table       ASCII-art table
     tabs        Tab-separated values
     tcl         TCL list elements
   OPTIONS: (for columnar modes or insert mode):
     --wrap N       Wrap output lines to no longer than N characters
     --wordwrap B   Wrap or not at word boundaries per B (on/off)
     --ww           Shorthand for "--wordwrap 1"
     --quote        Quote output text as SQL literals
     --noquote      Do not quote output text
     TABLE          The name of SQL table used for "insert" mode
.width NUM1 NUM2 ...     Set minimum column widths for columnar output
     Negative values right-justify
sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite>    ...>    ...>    ...>    ...>    ...> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> p|1|3000|3000.0
r|2|1700|850.0
sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> 5|ten|XX|5|ten|XX
sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> 
sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> 5|ten|XX|a|p|3000
5|ten|XX|b|q|9223372036854775807
5|ten|XX|c|r|1700
5|ten|XX|e|q|-9223372036854775808
5|ten|XX|f|r|0
9|x|x|a|p|3000
9|x|x|b|q|9223372036854775807
9|x|x|c|r|1700
9|x|x|e|q|-9223372036854775808
9|x|x|f|r|0
|||a|p|3000
|||b|q|9223372036854775807
|||c|r|1700
|||e|q|-9223372036854775808
|||f|r|0
|||a|p|3000
|||b|q|9223372036854775807
|||c|r|1700
|||e|q|-9223372036854775808
|||f|r|0
sqlite> a|p|3000|a|p|3000
b|q|9223372036854775807|b|q|9223372036854775807
c|r|1700|c|r|1700
e|q|-9223372036854775808|e|q|-9223372036854775808
f|r|0|f|r|0
sqlite> sqlite> sqlite> sqlite> sqlite>

Expectation


Flag

-interactive