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

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

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/with3.test ('k') | third_party/sqlite/src/test/without_rowid3.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 # 2013-10-30 1 # 2013-10-30
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 270
271 do_execsql_test 5.6 { 271 do_execsql_test 5.6 {
272 CREATE INDEX i46 ON t46(c); 272 CREATE INDEX i46 ON t46(c);
273 } 273 }
274 274
275 foreach {tn cnt where eqp} $queries { 275 foreach {tn cnt where eqp} $queries {
276 do_execsql_test 5.7.$tn.1 "SELECT count(*) FROM t46 WHERE $where" $cnt 276 do_execsql_test 5.7.$tn.1 "SELECT count(*) FROM t46 WHERE $where" $cnt
277 do_eqp_test 5.7.$tn.2 "SELECT count(*) FROM t46 WHERE $where" $eqp 277 do_eqp_test 5.7.$tn.2 "SELECT count(*) FROM t46 WHERE $where" $eqp
278 } 278 }
279 279
280 #-------------------------------------------------------------------------
281 # Check that redundant UNIQUE constraints do not cause a problem.
282 #
283 do_execsql_test 6.0 {
284 CREATE TABLE t47(a, b UNIQUE PRIMARY KEY) WITHOUT ROWID;
285 CREATE INDEX i47 ON t47(a);
286 INSERT INTO t47 VALUES(1, 2);
287 INSERT INTO t47 VALUES(2, 4);
288 INSERT INTO t47 VALUES(3, 6);
289 INSERT INTO t47 VALUES(4, 8);
290
291 VACUUM;
292 PRAGMA integrity_check;
293 SELECT name FROM sqlite_master WHERE tbl_name = 't47';
294 } {ok t47 i47}
295
296 do_execsql_test 6.1 {
297 CREATE TABLE t48(
298 a UNIQUE UNIQUE,
299 b UNIQUE,
300 PRIMARY KEY(a),
301 UNIQUE(a)
302 ) WITHOUT ROWID;
303 INSERT INTO t48 VALUES('a', 'b'), ('c', 'd'), ('e', 'f');
304 VACUUM;
305 PRAGMA integrity_check;
306 SELECT name FROM sqlite_master WHERE tbl_name = 't48';
307 } {
308 ok t48 sqlite_autoindex_t48_2
309 }
310
311 # 2015-05-28: CHECK constraints can refer to the rowid in a
312 # rowid table, but not in a WITHOUT ROWID table.
313 #
314 do_execsql_test 7.1 {
315 CREATE TABLE t70a(
316 a INT CHECK( rowid!=33 ),
317 b TEXT PRIMARY KEY
318 );
319 INSERT INTO t70a(a,b) VALUES(99,'hello');
320 } {}
321 do_catchsql_test 7.2 {
322 INSERT INTO t70a(rowid,a,b) VALUES(33,99,'xyzzy');
323 } {1 {CHECK constraint failed: t70a}}
324 do_catchsql_test 7.3 {
325 CREATE TABLE t70b(
326 a INT CHECK( rowid!=33 ),
327 b TEXT PRIMARY KEY
328 ) WITHOUT ROWID;
329 } {1 {no such column: rowid}}
330
280 331
281 finish_test 332 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/with3.test ('k') | third_party/sqlite/src/test/without_rowid3.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698