diff options
author | Jan Mercl <0xjnml@gmail.com> | 2020-07-26 22:36:18 +0200 |
---|---|---|
committer | Jan Mercl <0xjnml@gmail.com> | 2020-07-26 22:36:18 +0200 |
commit | b406626c64313ae348996c243a0a05d3f6ed2c3c (patch) | |
tree | 0eaae4fa6348b150568725e6f2ec0b4c4203b5f8 /testdata/tcl/orderby4.test | |
parent | d8d9f40ce80062793349c0ea47520b6878312f4a (diff) |
release v1.4.0-beta1v1.4.0-beta1
Diffstat (limited to 'testdata/tcl/orderby4.test')
-rw-r--r-- | testdata/tcl/orderby4.test | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/testdata/tcl/orderby4.test b/testdata/tcl/orderby4.test new file mode 100644 index 0000000..ec6eb04 --- /dev/null +++ b/testdata/tcl/orderby4.test @@ -0,0 +1,56 @@ +# 2013 March 26 +# +# 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. The +# focus of this file is testing that the optimizations that disable +# ORDER BY clauses work correctly on multi-value primary keys and +# unique indices when only some prefix of the terms in the key are +# used. See ticket http://www.sqlite.org/src/info/a179fe74659 +# + + +set testdir [file dirname $argv0] +source $testdir/tester.tcl +set ::testprefix orderby4 + +# Generate test data for a join. Verify that the join gets the +# correct answer. +# +do_execsql_test 1.1 { + CREATE TABLE t1(a, b, PRIMARY KEY(a,b)); + INSERT INTO t1 VALUES(1,1),(1,2); + CREATE TABLE t2(x, y, PRIMARY KEY(x,y)); + INSERT INTO t2 VALUES(3,3),(4,4); + SELECT a, x FROM t1, t2 ORDER BY 1, 2; +} {1 3 1 3 1 4 1 4} +do_execsql_test 1.2 { + SELECT a, x FROM t1 CROSS JOIN t2 ORDER BY 1, 2; +} {1 3 1 3 1 4 1 4} +do_execsql_test 1.3 { + SELECT a, x FROM t2 CROSS JOIN t1 ORDER BY 1, 2; +} {1 3 1 3 1 4 1 4} + +do_execsql_test 2.1 { + CREATE TABLE t3(a); + INSERT INTO t3 VALUES(1),(1); + CREATE INDEX t3a ON t3(a); + CREATE TABLE t4(x); + INSERT INTO t4 VALUES(3),(4); + CREATE INDEX t4x ON t4(x); + SELECT a, x FROM t3, t4 ORDER BY 1, 2; +} {1 3 1 3 1 4 1 4} +do_execsql_test 2.2 { + SELECT a, x FROM t3 CROSS JOIN t4 ORDER BY 1, 2; +} {1 3 1 3 1 4 1 4} +do_execsql_test 2.3 { + SELECT a, x FROM t4 CROSS JOIN t3 ORDER BY 1, 2; +} {1 3 1 3 1 4 1 4} + +finish_test |