-C Ensure\sthat\sif\sa\sdeferred\sFK\sconstraint\sis\sviolated\sby\sa\sstatement\sthat\screates\sits\sown\simplicit\stransaction,\sthe\sstatement\sis\snot\san\s"active-write"\safter\ssqlite3_step()\sreturns.
-D 2011-01-24T16:00:59
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
- C Fix\sthe\sATTACH\scommand\sso\sthat\sthe\sfilename\sargument\scan\sbe\sany\sexpression\nand\sso\sthat\sif\sauthorizer\scallback\sgets\sa\sNULL\spointer\sfor\sthe\sfilename\nif\sthe\sfilename\sargument\sis\sanything\sother\sthan\sa\sstring\sliteral.\nTicket\s[9013e13dba5b58c7]
- D 2011-02-04T00:51:16.779
++C If\sa\sdeferred\sforeign\skey\sconstraint\sfails\son\sa\sstatement\sthat\sis\snot\spart\nof\sa\slarger\stransation,\smake\ssure\sthat\sthe\sstatement\sfully\sends\sso\sthat\nsubsequent\sinvocations\sof\sthe\ssame\sstatement\swill\snot\spass\sthe\sconstraint\nbecause\sthey\sthink\sthe\stransaction\sis\snot\sclosed.\s\sThis\sis\sa\smerge\sof\nthe\sdeferred-fk-quirk\sbranch\stogether\swith\sa\stest\scase.
++D 2011-02-04T05:47:51.496
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in de6498556d536ae60bb8bb10e8c1ba011448658c
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F test/fkey1.test 01c7de578e11747e720c2d9aeef27f239853c4da
F test/fkey2.test 080969fe219b3b082b0e097ac18c6af2e5b0631f
F test/fkey3.test 42f88d6048d8dc079e2a8cf7baad1cc1483a7620
++F test/fkey4.test c6c8f9f9be885f95c85c7bceb26f243ad906fd49
F test/fkey_malloc.test a5ede29bd2f6e56dea78c3d43fb86dd696c068c8
F test/format4.test 1f0cac8ff3895e9359ed87e41aaabee982a812eb
F test/fts1a.test 46090311f85da51bb33bd5ce84f7948359c6d8d7
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
- P 80225abe79b0a7723b922ec129954438af95855a
- R 9134f5db8961067a7ad82064d56946c9
-P a764915b87564fa91ee68e9b1f41394ce0f1fc7e
-R e8885ee042476ced2c7dfa4c7a736076
-T *branch * deferred-fk-quirk
-T *sym-deferred-fk-quirk *
-T -sym-trunk *
-U dan
-Z 2132121d7c9351a52aa9ba299c7514e3
++P e64e1453a9c204d93de1af92dc0b3ca26762b024 8063197ef141c0c62ba710efdd2b3421fbee4e5d
++R 69d3f0356b4d8f9e9f40d56c45da6c25
+U drh
- Z 7f194afc366d2267b4ef7a641cbf9923
++Z 9ed074a22966ce70581904f84a2ffc62
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.10 (Darwin)
+
- iEYEARECAAYFAk1LTYQACgkQoxKgR168RlH97QCeM1UBJYsYMQZNJnbRrKh8f7uy
- FdEAn2U2U1OAUNrDlkTLscL5hpCzQ3Wk
- =NxZv
++iEYEARECAAYFAk1LkwcACgkQoxKgR168RlE5awCdFnaZrUhXoj6KrFZElnyy4f9M
++kbMAn19H8xD5tiM5UH35kU9mL5D0eNXv
++=9S5i
+-----END PGP SIGNATURE-----
--- /dev/null
--- /dev/null
++# 2011 Feb 04
++#
++# The author disclaims copyright to this source code. In place of
++# a legal notice, here is a blessing:
++#
++# May you do good and not evil.
++# May you find forgiveness for yourself and forgive others.
++# May you share freely, never taking more than you give.
++#
++#***********************************************************************
++# This file implements regression tests for SQLite library.
++#
++# This file test deferred foreign key constraint processing to make
++# sure that when a statement not within BEGIN...END fails a constraint,
++# that statement doesn't hold the transaction open thus allowing
++# a subsequent statement to fail a deferred constraint with impunity.
++#
++
++set testdir [file dirname $argv0]
++source $testdir/tester.tcl
++
++ifcapable {!foreignkey||!trigger} {
++ finish_test
++ return
++}
++
++# Create a table and some data to work with.
++#
++do_test fkey4-1.1 {
++ execsql {
++ PRAGMA foreign_keys = ON;
++ CREATE TABLE t1(a PRIMARY KEY, b);
++ CREATE TABLE t2(c REFERENCES t1 DEFERRABLE INITIALLY DEFERRED, d);
++ INSERT INTO t1 VALUES(1,2);
++ INSERT INTO t2 VALUES(1,3);
++ }
++} {}
++
++do_test fkey4-1.2 {
++ set ::DB [sqlite3_connection_pointer db]
++ set ::SQL {INSERT INTO t2 VALUES(2,4)}
++ set ::STMT1 [sqlite3_prepare_v2 $::DB $::SQL -1 TAIL]
++ sqlite3_step $::STMT1
++} {SQLITE_CONSTRAINT}
++do_test fkey4-1.3 {
++ set ::STMT2 [sqlite3_prepare_v2 $::DB $::SQL -1 TAIL]
++ sqlite3_step $::STMT2
++} {SQLITE_CONSTRAINT}
++do_test fkey4-1.4 {
++ db eval {SELECT * FROM t2}
++} {1 3}
++sqlite3_finalize $::STMT1
++sqlite3_finalize $::STMT2
++
++finish_test