1
0
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:
drh
2013-08-01 22:27:26 +00:00
parent af4300636a
commit 989b116a03
4 changed files with 31 additions and 9 deletions

View File

@ -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