diff options
author | dan <dan@noemail.net> | 2019-07-17 09:18:06 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2019-07-17 09:18:06 +0000 |
commit | 1ff9407198073f488d41782d3a97176018ded973 (patch) | |
tree | 05604afaf72ab4a7534d4e2cc3c5331e11f2a6cc /test/without_rowid7.test | |
parent | 4d02b5f7d0e346ea8faeeb8d65d57f516d1def44 (diff) | |
download | sqlite-1ff9407198073f488d41782d3a97176018ded973.tar.gz sqlite-1ff9407198073f488d41782d3a97176018ded973.zip |
Fix problems with duplicate fields in the PRIMARY KEYs of WITHOUT ROWID tables.
FossilOrigin-Name: bd9a47a3a2997bfbf9c8a11c5b7196e362974054e58a2fe701778b1580264de8
Diffstat (limited to 'test/without_rowid7.test')
-rw-r--r-- | test/without_rowid7.test | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/without_rowid7.test b/test/without_rowid7.test new file mode 100644 index 000000000..500f2bd15 --- /dev/null +++ b/test/without_rowid7.test @@ -0,0 +1,38 @@ +# 2019 July 17 +# +# 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. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl +set testprefix without_rowid7 + +do_execsql_test 1.0 { + CREATE TABLE t1(a, b COLLATE nocase, PRIMARY KEY(a, a, b)) WITHOUT ROWID; +} + +do_catchsql_test 1.1 { + INSERT INTO t1 VALUES(1, 'one'), (1, 'ONE'); +} {1 {UNIQUE constraint failed: t1.a, t1.b}} + + +do_execsql_test 2.0 { + CREATE TABLE t2(a, b, PRIMARY KEY(a, a COLLATE nocase, a)) WITHOUT ROWID; +} + +do_execsql_test 2.1 { + INSERT INTO t2 VALUES(1, 'one'); + SELECT b FROM t2; +} {one} + + +finish_test + |