3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library.
13 # Verify that we can create zero-length tables.
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
19 do_test tkt-78e04-1.0 {
21 CREATE TABLE ""("" UNIQUE, x CHAR(100));
23 INSERT INTO ""("") VALUES(1);
24 INSERT INTO t2 VALUES(2);
28 do_test tkt-78e04-1.1 {
30 INSERT INTO ""("") VALUES(1);
32 } {1 {UNIQUE constraint failed: .}}
33 do_test tkt-78e04-1.2 {
35 PRAGMA table_info("");
37 } {0 {} {} 0 {} 0 1 x CHAR(100) 0 {} 0}
38 do_test tkt-78e04-1.3 {
40 CREATE INDEX i1 ON ""("" COLLATE nocase);
43 do_test tkt-78e04-1.4 {
44 db eval {EXPLAIN QUERY PLAN SELECT "" FROM "" WHERE "" LIKE '1abc%';}
45 } {/*SCAN TABLE USING COVERING INDEX i1*/}
46 do_test tkt-78e04-1.5 {
49 SELECT name FROM sqlite_master;
53 do_test tkt-78e04-2.1 {
55 CREATE INDEX "" ON t2(x);
56 EXPLAIN QUERY PLAN SELECT * FROM t2 WHERE x=5;
58 } {/*SEARCH TABLE t2 USING COVERING INDEX (x=?)*/}
59 do_test tkt-78e04-2.2 {
62 EXPLAIN QUERY PLAN SELECT * FROM t2 WHERE x=2;