Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Added tests for multi-column primary keys. (CVS 585) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
ffc49e56b13096b35e6cbb1a2f7d5468 |
User & Date: | drh 2002-05-24 02:14:50 |
Context
2002-05-24
| ||
16:14 | Add support for the full SQL join syntax. This is just a parser enhancement. We now recognize all kinds of joins, but we don't actually do anything with them yet. (CVS 586) check-in: e238643e user: drh tags: trunk | |
02:14 | Added tests for multi-column primary keys. (CVS 585) check-in: ffc49e56 user: drh tags: trunk | |
02:04 | Split the IdList structure into IdList and SrcList. SrcList is used to represent a FROM clause and IdList is used for everything else. This change allows SrcList to grow to support outer joins without burdening the other uses of IdList. (CVS 584) check-in: a167b71d user: drh tags: trunk | |
Changes
Changes to test/misc1.test.
9 9 # 10 10 #*********************************************************************** 11 11 # This file implements regression tests for SQLite library. 12 12 # 13 13 # This file implements tests for miscellanous features that were 14 14 # left out of other test files. 15 15 # 16 -# $Id: misc1.test,v 1.5 2002/03/30 15:26:52 drh Exp $ 16 +# $Id: misc1.test,v 1.6 2002/05/24 02:14:50 drh Exp $ 17 17 18 18 set testdir [file dirname $argv0] 19 19 source $testdir/tester.tcl 20 20 21 21 # Test the creation and use of tables that have a large number 22 22 # of columns. 23 23 # ................................................................................ 181 181 } 182 182 } {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19} 183 183 do_test misc1-6.4 { 184 184 execsql { 185 185 SELECT abort+asc,max(key,pragma,temp) FROM t4 186 186 } 187 187 } {3 17} 188 - 188 + 189 +# Test for multi-column primary keys, and for multiple primary keys. 190 +# 191 +do_test misc1-7.1 { 192 + catchsql { 193 + CREATE TABLE error1( 194 + a TYPE PRIMARY KEY, 195 + b TYPE PRIMARY KEY 196 + ); 197 + } 198 +} {1 {table "error1" has more than one primary key}} 199 +do_test misc1-7.2 { 200 + catchsql { 201 + CREATE TABLE error1( 202 + a INTEGER PRIMARY KEY, 203 + b TYPE PRIMARY KEY 204 + ); 205 + } 206 +} {1 {table "error1" has more than one primary key}} 207 +do_test misc1-7.3 { 208 + execsql { 209 + CREATE TABLE t5(a,b,c,PRIMARY KEY(a,b)); 210 + INSERT INTO t5 VALUES(1,2,3); 211 + SELECT * FROM t5 ORDER BY a; 212 + } 213 +} {1 2 3} 214 +do_test misc1-7.4 { 215 + catchsql { 216 + INSERT INTO t5 VALUES(1,2,4); 217 + } 218 +} {1 {constraint failed}} 219 +do_test misc1-7.5 { 220 + catchsql { 221 + INSERT INTO t5 VALUES(0,2,4); 222 + } 223 +} {0 {}} 224 +do_test misc1-7.6 { 225 + execsql { 226 + SELECT * FROM t5 ORDER BY a; 227 + } 228 +} {0 2 4 1 2 3} 229 + 189 230 190 231 finish_test