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

Side by Side Diff: third_party/sqlite/src/test/incrblob2.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/in.test ('k') | third_party/sqlite/src/test/incrcorrupt.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 # 2008 June 9 1 # 2008 June 9
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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 317
318 close $wrHandle 318 close $wrHandle
319 close $rdHandle 319 close $rdHandle
320 } {} 320 } {}
321 321
322 do_test incrblob2-6.2 { 322 do_test incrblob2-6.2 {
323 set rdHandle [db incrblob -readonly t1 data 1] 323 set rdHandle [db incrblob -readonly t1 data 1]
324 sqlite3_blob_read $rdHandle 0 2 324 sqlite3_blob_read $rdHandle 0 2
325 } {AB} 325 } {AB}
326 326
327 if {$::tcl_platform(pointerSize)>=8} {
328 do_test incrblob2-6.2b {
329 set rc [catch {
330 # Prior to 2015-02-07, the following caused a segfault due to
331 # integer overflow.
332 sqlite3_blob_read $rdHandle 2147483647 2147483647
333 } errmsg]
334 lappend rc $errmsg
335 } {1 SQLITE_ERROR}
336 }
337 do_test incrblob2-6.2c {
338 set rc [catch {
339 # Prior to 2015-02-07, the following caused a segfault due to
340 # integer overflow.
341 sqlite3_blob_read $rdHandle 2147483647 100
342 } errmsg]
343 lappend rc $errmsg
344 } {1 SQLITE_ERROR}
345
327 do_test incrblob2-6.3 { 346 do_test incrblob2-6.3 {
328 set wrHandle [db incrblob t1 data 1] 347 set wrHandle [db incrblob t1 data 1]
329 sqlite3_blob_write $wrHandle 0 ZZZZZZZZZZ 348 sqlite3_blob_write $wrHandle 0 ZZZZZZZZZZ
330 sqlite3_blob_read $rdHandle 2 4 349 sqlite3_blob_read $rdHandle 2 4
331 } {ZZZZ} 350 } {ZZZZ}
332 351
352 do_test incrblob2-6.3b {
353 set rc [catch {
354 # Prior to 2015-02-07, the following caused a segfault due to
355 # integer overflow.
356 sqlite3_blob_write $wrHandle 2147483647 YYYYYYYYYYYYYYYYYY
357 } errmsg]
358 lappend rc $errmsg
359 } {1 SQLITE_ERROR}
360 do_test incrblob2-6.3c {
361 sqlite3_blob_read $rdHandle 2 4
362 } {ZZZZ}
363
364
333 do_test incrblob2-6.4 { 365 do_test incrblob2-6.4 {
334 close $wrHandle 366 close $wrHandle
335 close $rdHandle 367 close $rdHandle
336 } {} 368 } {}
337 369
338 sqlite3_memory_highwater 1 370 sqlite3_memory_highwater 1
339 do_test incrblob2-7.1 { 371 do_test incrblob2-7.1 {
340 db eval { 372 db eval {
341 CREATE TABLE t2(B BLOB); 373 CREATE TABLE t2(B BLOB);
342 INSERT INTO t2 VALUES(zeroblob(10 * 1024 * 1024)); 374 INSERT INTO t2 VALUES(zeroblob(10 * 1024 * 1024));
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } {1 {UNIQUE constraint failed: t3.a}} 441 } {1 {UNIQUE constraint failed: t3.a}}
410 do_test incrblob2-8.9 { 442 do_test incrblob2-8.9 {
411 set rc [catch {sqlite3_blob_read $h 0 20} msg] 443 set rc [catch {sqlite3_blob_read $h 0 20} msg]
412 list $rc $msg 444 list $rc $msg
413 } {1 SQLITE_ABORT} 445 } {1 SQLITE_ABORT}
414 do_test incrblob2-8.X { 446 do_test incrblob2-8.X {
415 close $h 447 close $h
416 } {} 448 } {}
417 449
418 finish_test 450 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/in.test ('k') | third_party/sqlite/src/test/incrcorrupt.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698