Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix test numbering in tkt2822.test. Ticket #2830. (CVS 4611) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
8fe8e9c460e0f8ebc4267de96b0c971c |
User & Date: | danielk1977 2007-12-12 04:38:27 |
Context
2007-12-12
| ||
12:00 | Add a new OP_StackDepth opcode to help detect VDBE stack leaks early, before they cause damage. For diagnostics in ticket #2832. (CVS 4612) check-in: 3fd6a267 user: drh tags: trunk | |
04:38 | Fix test numbering in tkt2822.test. Ticket #2830. (CVS 4611) check-in: 8fe8e9c4 user: danielk1977 tags: trunk | |
2007-12-11
| ||
20:04 | Fix a comment on the SQLITE_SQL_MAX_LENGTH definition. (CVS 4610) check-in: 9335c940 user: drh tags: trunk | |
Changes
Changes to test/tkt2822.test.
9 9 # 10 10 #*********************************************************************** 11 11 # 12 12 # This file is to test that the issues surrounding expressions in 13 13 # ORDER BY clauses on compound SELECT statements raised by ticket 14 14 # #2822 have been dealt with. 15 15 # 16 -# $Id: tkt2822.test,v 1.1 2007/12/10 18:51:48 danielk1977 Exp $ 16 +# $Id: tkt2822.test,v 1.2 2007/12/12 04:38:27 danielk1977 Exp $ 17 17 # 18 18 19 19 set testdir [file dirname $argv0] 20 20 source $testdir/tester.tcl 21 21 22 22 # Test plan: 23 23 # 24 -# tkt2820-1.* - Simple identifier as ORDER BY expression. 25 -# tkt2820-2.* - More complex ORDER BY expressions. 24 +# tkt2822-1.* - Simple identifier as ORDER BY expression. 25 +# tkt2822-2.* - More complex ORDER BY expressions. 26 26 27 -do_test tkt2820-1.1 { 27 +do_test tkt2822-1.1 { 28 28 execsql { 29 29 CREATE TABLE t1(a, b, c); 30 30 CREATE TABLE t2(c, b, a); 31 31 32 32 INSERT INTO t1 VALUES(1, 2, 3); 33 33 INSERT INTO t2 VALUES(3, 2, 1); 34 34 } 35 35 } {} 36 36 37 37 # If an ORDER BY expression matches two different columns, it is an error. 38 38 # 39 -do_test tkt2820-1.2 { 39 +do_test tkt2822-1.2 { 40 40 catchsql { 41 41 SELECT a, b FROM t1 UNION ALL SELECT b, a FROM t2 ORDER BY a; 42 42 } 43 43 } {1 {ORDER BY term number 1 is ambiguous}} 44 -do_test tkt2820-1.3 { 44 +do_test tkt2822-1.3 { 45 45 catchsql { 46 46 SELECT a, b, c FROM t2 UNION ALL SELECT c, b, a FROM t1 ORDER BY a; 47 47 } 48 48 } {1 {ORDER BY term number 1 is ambiguous}} 49 49 50 50 # But not if it matches the same column in two or more of the 51 51 # compounded SELECT statements. 52 52 # 53 -do_test tkt2820-1.4 { 53 +do_test tkt2822-1.4 { 54 54 execsql { 55 55 SELECT a, b, c FROM t2 UNION ALL SELECT a, b, c FROM t1 ORDER BY a; 56 56 } 57 57 } {1 2 3 1 2 3} 58 58 59 -do_test tkt2820-1.5 { 59 +do_test tkt2822-1.5 { 60 60 execsql { 61 61 SELECT a, b FROM t2 UNION ALL SELECT c, b FROM t1 ORDER BY c; 62 62 } 63 63 } {1 2 3 2} 64 64 65 65 # If a match cannot be found in any SELECT, return an error. 66 66 # 67 -do_test tkt2820-1.6 { 67 +do_test tkt2822-1.6 { 68 68 catchsql { 69 69 SELECT * FROM t2 UNION ALL SELECT * FROM t1 ORDER BY d; 70 70 } 71 71 } {1 {ORDER BY term number 1 does not match any result column}} 72 72 73 73 74 -do_test tkt2820-2.1 { 74 +do_test tkt2822-2.1 { 75 75 execsql { 76 76 SELECT a+1, b+1 FROM t1 UNION ALL SELECT a, c FROM t2 ORDER BY a+1; 77 77 } 78 78 } {1 3 2 3} 79 -do_test tkt2820-2.2 { 79 +do_test tkt2822-2.2 { 80 80 catchsql { 81 81 SELECT a+1, b+1 FROM t1 UNION ALL SELECT a, c FROM t2 ORDER BY a+2; 82 82 } 83 83 } {1 {ORDER BY term number 1 does not match any result column}} 84 -do_test tkt2820-2.3 { 84 +do_test tkt2822-2.3 { 85 85 catchsql { 86 86 SELECT a+1, b+1 FROM t1 UNION ALL SELECT c, a+1 FROM t2 ORDER BY a+1; 87 87 } 88 88 } {1 {ORDER BY term number 1 is ambiguous}} 89 89 90 -do_test tkt2820-2.4 { 90 +do_test tkt2822-2.4 { 91 91 execsql { 92 92 SELECT t1.a, b+1 FROM t1 UNION ALL SELECT c, a+1 FROM t2 ORDER BY a; 93 93 } 94 94 } {1 3 3 2} 95 -do_test tkt2820-2.5 { 95 +do_test tkt2822-2.5 { 96 96 execsql { 97 97 SELECT t1.a, b+1 FROM t1 UNION ALL SELECT c, a+1 FROM t2 ORDER BY t1.a; 98 98 } 99 99 } {1 3 3 2} 100 100 101 101 finish_test 102 102