mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Fix the CREATE INDEX statement so that trying to create a TEMP index on
a non-TEMP table throws an error rather than segfaulting. FossilOrigin-Name: e3c8935f8736d00dc83644fa21d86ca7fec6d2fc
This commit is contained in:
@ -715,6 +715,23 @@ do_test index-20.2 {
|
||||
DROP INDEX "t6i1";
|
||||
}
|
||||
} {}
|
||||
|
||||
# Try to create a TEMP index on a non-TEMP table. */
|
||||
#
|
||||
do_test index-21.1 {
|
||||
catchsql {
|
||||
CREATE INDEX temp.i21 ON t6(c);
|
||||
}
|
||||
} {1 {cannot create a TEMP index on non-TEMP table "t6"}}
|
||||
do_test index-21.2 {
|
||||
catchsql {
|
||||
CREATE TEMP TABLE t6(x);
|
||||
INSERT INTO temp.t6 values(1),(5),(9);
|
||||
CREATE INDEX temp.i21 ON t6(x);
|
||||
SELECT x FROM t6 ORDER BY x DESC;
|
||||
}
|
||||
} {0 {9 5 1}}
|
||||
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user