diff options
author | dan miller | 2007-10-20 02:49:29 +0000 |
---|---|---|
committer | dan miller | 2007-10-20 02:49:29 +0000 |
commit | e36d23a85ebff914d74bb541558c2b6082b78edb (patch) | |
tree | 54b58fdf162e78af64055282a6035c8d2443389d /libraries/sqlite/unix/sqlite-3.5.1/test/index3.test | |
parent | * Fixed an issue whereby avatar chat distances were being calculated against ... (diff) | |
download | opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.zip opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.gz opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.bz2 opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.xz |
sqlite source (unix build) added to libraries
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/index3.test')
-rw-r--r-- | libraries/sqlite/unix/sqlite-3.5.1/test/index3.test | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/index3.test b/libraries/sqlite/unix/sqlite-3.5.1/test/index3.test new file mode 100644 index 0000000..c6c6ff4 --- /dev/null +++ b/libraries/sqlite/unix/sqlite-3.5.1/test/index3.test | |||
@@ -0,0 +1,58 @@ | |||
1 | # 2005 February 14 | ||
2 | # | ||
3 | # The author disclaims copyright to this source code. In place of | ||
4 | # a legal notice, here is a blessing: | ||
5 | # | ||
6 | # May you do good and not evil. | ||
7 | # May you find forgiveness for yourself and forgive others. | ||
8 | # May you share freely, never taking more than you give. | ||
9 | # | ||
10 | #*********************************************************************** | ||
11 | # This file implements regression tests for SQLite library. The | ||
12 | # focus of this file is testing the CREATE INDEX statement. | ||
13 | # | ||
14 | # $Id: index3.test,v 1.2 2005/08/20 03:03:04 drh Exp $ | ||
15 | |||
16 | |||
17 | set testdir [file dirname $argv0] | ||
18 | source $testdir/tester.tcl | ||
19 | |||
20 | # Ticket #1115. Make sure that when a UNIQUE index is created on a | ||
21 | # non-unique column (or columns) that it fails and that it leaves no | ||
22 | # residue behind. | ||
23 | # | ||
24 | do_test index3-1.1 { | ||
25 | execsql { | ||
26 | CREATE TABLE t1(a); | ||
27 | INSERT INTO t1 VALUES(1); | ||
28 | INSERT INTO t1 VALUES(1); | ||
29 | SELECT * FROM t1; | ||
30 | } | ||
31 | } {1 1} | ||
32 | do_test index3-1.2 { | ||
33 | catchsql { | ||
34 | BEGIN; | ||
35 | CREATE UNIQUE INDEX i1 ON t1(a); | ||
36 | } | ||
37 | } {1 {indexed columns are not unique}} | ||
38 | do_test index3-1.3 { | ||
39 | catchsql COMMIT; | ||
40 | } {0 {}} | ||
41 | integrity_check index3-1.4 | ||
42 | |||
43 | # This test corrupts the database file so it must be the last test | ||
44 | # in the series. | ||
45 | # | ||
46 | do_test index3-99.1 { | ||
47 | execsql { | ||
48 | PRAGMA writable_schema=on; | ||
49 | UPDATE sqlite_master SET sql='nonsense'; | ||
50 | } | ||
51 | db close | ||
52 | sqlite3 db test.db | ||
53 | catchsql { | ||
54 | DROP INDEX i1; | ||
55 | } | ||
56 | } {1 {malformed database schema - near "nonsense": syntax error}} | ||
57 | |||
58 | finish_test | ||