summaryrefslogtreecommitdiffstats
path: root/third_party/sqlite/test/fkey1.test
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-06 22:39:41 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-06 22:39:41 +0000
commit586381f8db3497c24c11f96234f1879b34e74bc7 (patch)
tree99f7d18350289b135ef6dd5c161baba8bce668a3 /third_party/sqlite/test/fkey1.test
parent6e3b12ff2cbbe8c481f986c8f0dd230bb50add2a (diff)
downloadchromium_src-586381f8db3497c24c11f96234f1879b34e74bc7.zip
chromium_src-586381f8db3497c24c11f96234f1879b34e74bc7.tar.gz
chromium_src-586381f8db3497c24c11f96234f1879b34e74bc7.tar.bz2
Upgrade our sqlite to 3.6.1, with the local changes made by Gears. I'm
checking in the full sqlite tree to make upstream merges easier. This means we'll have generated sources split out from the originals. One important change this makes is that "BEGIN" now defaults to "BEGIN IMMEDIATE" rather than "BEGIN DEFERRED". This doesn't affect us because we don't use unqualified BEGIN statements. The full CL is too big for Rietveld. I'm splitting it into 2. This one is reviewable. The other CL is just a fresh drop of: //depot/googleclient/gears/opensource/third_party/sqlite_google Review URL: http://codereview.chromium.org/15067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/sqlite/test/fkey1.test')
-rwxr-xr-xthird_party/sqlite/test/fkey1.test77
1 files changed, 77 insertions, 0 deletions
diff --git a/third_party/sqlite/test/fkey1.test b/third_party/sqlite/test/fkey1.test
new file mode 100755
index 0000000..52b52d3
--- /dev/null
+++ b/third_party/sqlite/test/fkey1.test
@@ -0,0 +1,77 @@
+# 2001 September 15
+#
+# 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 implements tests for foreign keys.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+ifcapable {!foreignkey} {
+ finish_test
+ return
+}
+
+# Create a table and some data to work with.
+#
+do_test fkey1-1.0 {
+ execsql {
+ CREATE TABLE t1(
+ a INTEGER PRIMARY KEY,
+ b INTEGER
+ REFERENCES t1 ON DELETE CASCADE
+ REFERENCES t2,
+ c TEXT,
+ FOREIGN KEY (b,c) REFERENCES t2(x,y) ON UPDATE CASCADE
+ );
+ }
+} {}
+do_test fkey1-1.1 {
+ execsql {
+ CREATE TABLE t2(
+ x INTEGER PRIMARY KEY,
+ y TEXT
+ );
+ }
+} {}
+do_test fkey1-1.2 {
+ execsql {
+ CREATE TABLE t3(
+ a INTEGER REFERENCES t2 ON INSERT RESTRICT,
+ b INTEGER REFERENCES t1,
+ FOREIGN KEY (a,b) REFERENCES t2(x,y)
+ );
+ }
+} {}
+
+do_test fkey1-2.1 {
+ execsql {
+ CREATE TABLE t4(a integer primary key);
+ CREATE TABLE t5(x references t4);
+ CREATE TABLE t6(x references t4);
+ CREATE TABLE t7(x references t4);
+ CREATE TABLE t8(x references t4);
+ CREATE TABLE t9(x references t4);
+ CREATE TABLE t10(x references t4);
+ DROP TABLE t7;
+ DROP TABLE t9;
+ DROP TABLE t5;
+ DROP TABLE t8;
+ DROP TABLE t6;
+ DROP TABLE t10;
+ }
+} {}
+
+
+
+
+finish_test