mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
Add regression test for updating indexes
This commit is contained in:
parent
8ffe6208a3
commit
51abeca896
1 changed files with 15 additions and 0 deletions
|
@ -170,3 +170,18 @@ do_execsql_test_on_specific_db {:memory:} update_cache_full_regression_test_#162
|
|||
UPDATE t SET x = randomblob(4096) WHERE rowid = 1;
|
||||
SELECT count(*) FROM t;
|
||||
} {1}
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} update_index_regression_test {
|
||||
CREATE TABLE t(x, y);
|
||||
CREATE INDEX tx ON t (x);
|
||||
CREATE UNIQUE INDEX tyu ON t (y);
|
||||
INSERT INTO t VALUES (1, 1);
|
||||
SELECT x FROM t; -- uses tx index
|
||||
SELECT y FROM t; -- uses ty index
|
||||
UPDATE t SET x=2, y=2;
|
||||
SELECT x FROM t; -- uses tx index
|
||||
SELECT y FROM t; -- uses ty index
|
||||
} {1
|
||||
1
|
||||
2
|
||||
2}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue