Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: third_party/sqlite/src/test/delete4.test

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/test/delete.test ('k') | third_party/sqlite/src/test/delete_db.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 2005 August 24 1 # 2005 August 24
2 # 2 #
3 # The author disclaims copyright to this source code. In place of 3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing: 4 # a legal notice, here is a blessing:
5 # 5 #
6 # May you do good and not evil. 6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others. 7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give. 8 # May you share freely, never taking more than you give.
9 # 9 #
10 #*********************************************************************** 10 #***********************************************************************
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 do_execsql_test 4.12 { 132 do_execsql_test 4.12 {
133 DROP TABLE IF EXISTS t4; 133 DROP TABLE IF EXISTS t4;
134 CREATE TABLE t4(col0, col1, pk PRIMARY KEY) WITHOUT ROWID; 134 CREATE TABLE t4(col0, col1, pk PRIMARY KEY) WITHOUT ROWID;
135 INSERT INTO t4 VALUES(14, 'abcde','xyzzy'); 135 INSERT INTO t4 VALUES(14, 'abcde','xyzzy');
136 CREATE INDEX idx_t4_3 ON t4 (col0); 136 CREATE INDEX idx_t4_3 ON t4 (col0);
137 CREATE INDEX idx_t4_0 ON t4 (col1, col0); 137 CREATE INDEX idx_t4_0 ON t4 (col1, col0);
138 DELETE FROM t4 WHERE col0=69 OR col0>7; 138 DELETE FROM t4 WHERE col0=69 OR col0>7;
139 PRAGMA integrity_check; 139 PRAGMA integrity_check;
140 } {ok} 140 } {ok}
141 141
142 # 2016-04-09
143 # Ticket https://sqlite.org/src/info/a306e56ff68b8fa5
144 # Failure to completely delete when reverse_unordered_selects is
145 # engaged.
146 #
147 db close
148 forcedelete test.db
149 sqlite3 db test.db
150 do_execsql_test 5.0 {
151 PRAGMA page_size=1024;
152 CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
153 CREATE INDEX x1 ON t1(b, c);
154 INSERT INTO t1(a,b,c) VALUES(1, 1, zeroblob(80));
155 INSERT INTO t1(a,b,c) SELECT a+1, 1, c FROM t1;
156 INSERT INTO t1(a,b,c) SELECT a+2, 1, c FROM t1;
157 INSERT INTO t1(a,b,c) SELECT a+10, 2, c FROM t1 WHERE b=1;
158 INSERT INTO t1(a,b,c) SELECT a+20, 3, c FROM t1 WHERE b=1;
159 PRAGMA reverse_unordered_selects = ON;
160 DELETE FROM t1 WHERE b=2;
161 SELECT a FROM t1 WHERE b=2;
162 } {}
142 163
164 # 2016-05-02
165 # Ticket https://www.sqlite.org/src/tktview/dc6ebeda93960877
166 # A subquery in the WHERE clause of a one-pass DELETE can cause an
167 # incorrect answer.
168 #
169 db close
170 forcedelete test.db
171 sqlite3 db test.db
172 do_execsql_test 6.0 {
173 CREATE TABLE t2(x INT);
174 INSERT INTO t2(x) VALUES(1),(2),(3),(4),(5);
175 DELETE FROM t2 WHERE EXISTS(SELECT 1 FROM t2 AS v WHERE v.x=t2.x-1);
176 SELECT x FROM t2;
177 } {1}
178 do_execsql_test 6.1 {
179 DROP TABLE IF EXISTS t2;
180 CREATE TABLE t2(x INT);
181 INSERT INTO t2(x) VALUES(1),(2),(3),(4),(5);
182 DELETE FROM t2 WHERE EXISTS(SELECT 1 FROM t2 AS v WHERE v.x=t2.x+1);
183 SELECT x FROM t2;
184 } {5}
143 185
144 186
145 finish_test 187 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/delete.test ('k') | third_party/sqlite/src/test/delete_db.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698