mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Merge trunk changes into this branch.
FossilOrigin-Name: f15d51054afb1e3fec87938f2b04a5a0d0611b08248367850450de7c4166e3d1
This commit is contained in:
@@ -822,5 +822,18 @@ do_execsql_test 21.2 {
|
||||
END}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 22.0 {
|
||||
CREATE TABLE t1(a, b);
|
||||
CREATE TABLE t2(c, othername, extra AS (c + 1));
|
||||
ALTER TABLE t1 RENAME a to othername;
|
||||
SELECT sql FROM sqlite_schema;
|
||||
} {
|
||||
{CREATE TABLE t1(othername, b)}
|
||||
{CREATE TABLE t2(c, othername, extra AS (c + 1))}
|
||||
}
|
||||
|
||||
|
||||
finish_test
|
||||
|
@@ -110,7 +110,7 @@ do_execsql_test 2.2 {
|
||||
PRAGMA writable_schema = 1;
|
||||
CREATE TABLE xyz(a, b, c CHECK (c!="null") );
|
||||
CREATE INDEX i2 ON t1(x, y, z||"abc");
|
||||
CREATE INDEX i3 ON t1("w");
|
||||
CREATE INDEX i3 ON t1("w"||"");
|
||||
CREATE INDEX i4 ON t1(x) WHERE z="w";
|
||||
}
|
||||
|
||||
@@ -135,10 +135,49 @@ do_execsql_test 2.5 {
|
||||
{CREATE TABLE t1(x, y, z)}
|
||||
{CREATE TABLE xyz(a, b, c CHECK (c!="null") )}
|
||||
{CREATE INDEX i2 ON t1(x, y, z||"abc")}
|
||||
{CREATE INDEX i3 ON t1("w")}
|
||||
{CREATE INDEX i3 ON t1("w"||"")}
|
||||
{CREATE INDEX i4 ON t1(x) WHERE z="w"}
|
||||
}
|
||||
|
||||
|
||||
# 2021-03-13
|
||||
# ticket 1c24a659e6d7f3a1
|
||||
reset_db
|
||||
do_catchsql_test 3.0 {
|
||||
CREATE TABLE t1(a,b);
|
||||
CREATE INDEX x1 on t1("b");
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
} {1 {error in index x1 after drop column: no such column: b}}
|
||||
do_catchsql_test 3.1 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a,"b");
|
||||
CREATE INDEX x1 on t1("b");
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
} {1 {error in index x1 after drop column: no such column: b}}
|
||||
do_catchsql_test 3.2 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a,'b');
|
||||
CREATE INDEX x1 on t1("b");
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
} {1 {error in index x1 after drop column: no such column: b}}
|
||||
do_catchsql_test 3.3 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a,"b");
|
||||
CREATE INDEX x1 on t1('b');
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
} {1 {error in index x1 after drop column: no such column: b}}
|
||||
do_catchsql_test 3.4 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a, b, c);
|
||||
CREATE INDEX x1 ON t1("a"||"b");
|
||||
INSERT INTO t1 VALUES(1,2,3),(1,4,5);
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
} {1 {error in index x1 after drop column: no such column: b}}
|
||||
do_catchsql_test 3.5 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a, b, c);
|
||||
CREATE INDEX x1 ON t1("a"||"x");
|
||||
INSERT INTO t1 VALUES(1,2,3),(1,4,5);
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
} {0 {}}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user