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

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

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/src/test/fuzzer1.test ('k') | third_party/sqlite/src/test/icu.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 # 2004 Jan 14 1 # 2004 Jan 14
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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 # Check that the INSERT transaction above really was rolled back. 327 # Check that the INSERT transaction above really was rolled back.
328 execsql { 328 execsql {
329 SELECT count(*) FROM t1; 329 SELECT count(*) FROM t1;
330 } 330 }
331 } {1} 331 } {1}
332 332
333 # 333 #
334 # End rollback-hook testing. 334 # End rollback-hook testing.
335 #---------------------------------------------------------------------------- 335 #----------------------------------------------------------------------------
336 336
337 #----------------------------------------------------------------------------
338 # Test that if a commit-hook returns non-zero (causing a rollback), the
339 # rollback-hook is invoked.
340 #
341 proc commit_hook {} {
342 lappend ::hooks COMMIT
343 return 1
344 }
345 proc rollback_hook {} {
346 lappend ::hooks ROLLBACK
347 }
348 do_test hook-6.1 {
349 set ::hooks [list]
350 db commit_hook commit_hook
351 db rollback_hook rollback_hook
352 catchsql {
353 BEGIN;
354 INSERT INTO t1 VALUES('two', 'II');
355 COMMIT;
356 }
357 execsql { SELECT * FROM t1 }
358 } {one I}
359 do_test hook-6.2 {
360 set ::hooks
361 } {COMMIT ROLLBACK}
362 unset ::hooks
363
337 finish_test 364 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/fuzzer1.test ('k') | third_party/sqlite/src/test/icu.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698