mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 17:05:36 +01:00
Add regression test for updating indexes
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user