Debian Codegraph @

test/imposter1.sql

raw
1 #!sqlite3
2 #
3 # 2025-12-16
4 #
5 # The author disclaims copyright to this source code. In place of
6 # a legal notice, here is a blessing:
7 #
8 # May you do good and not evil.
9 # May you find forgiveness for yourself and forgive others.
10 # May you share freely, never taking more than you give.
11 #
12 #***********************************************************************
13 #
14 # Test cases for the .imposter command.
15 #
16 .mode box -reset
17 .testcase 100
18 CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT);
19 INSERT INTO t1 VALUES(1,'two',3),(4,'five',6);
20 CREATE INDEX t1bc ON t1(b,c);
21 .imposter T1BC x1
22 ----------^^^^--- Different case that the original
23 SELECT * FROM x1;
24 .check <<END
25 CREATE TABLE "x1"("b","c","_ROWID_",PRIMARY KEY("b","c","_ROWID_"))WITHOUT ROWID;
26 ╭──────┬───┬─────────╮
27 │ b │ c │ _ROWID_ │
28 ╞══════╪═══╪═════════╡
29 │ five │ 6 │ 4 │
30 │ two │ 3 │ 1 │
31 ╰──────┴───┴─────────╯
32 END