Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: third_party/sqlite/src/test/collate2.test

Issue 901033002: Import SQLite 3.8.7.4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chromium changes to support SQLite 3.8.7.4. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # 1 #
2 # 2001 September 15 2 # 2001 September 15
3 # 3 #
4 # The author disclaims copyright to this source code. In place of 4 # The author disclaims copyright to this source code. In place of
5 # a legal notice, here is a blessing: 5 # a legal notice, here is a blessing:
6 # 6 #
7 # May you do good and not evil. 7 # May you do good and not evil.
8 # May you find forgiveness for yourself and forgive others. 8 # May you find forgiveness for yourself and forgive others.
9 # May you share freely, never taking more than you give. 9 # May you share freely, never taking more than you give.
10 # 10 #
11 #*********************************************************************** 11 #***********************************************************************
12 # This file implements regression tests for SQLite library. The 12 # This file implements regression tests for SQLite library. The
13 # focus of this script is page cache subsystem. 13 # focus of this script is page cache subsystem.
14 # 14 #
15 # $Id: collate2.test,v 1.6 2008/08/20 16:35:10 drh Exp $ 15 # $Id: collate2.test,v 1.6 2008/08/20 16:35:10 drh Exp $
16 16
17 set testdir [file dirname $argv0] 17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl 18 source $testdir/tester.tcl
19 19
20 set ::testprefix collate2
21
20 # 22 #
21 # Tests are organised as follows: 23 # Tests are organised as follows:
22 # 24 #
23 # collate2-1.* WHERE <expr> expressions (sqliteExprIfTrue). 25 # collate2-1.* WHERE <expr> expressions (sqliteExprIfTrue).
24 # collate2-2.* WHERE NOT <expr> expressions (sqliteExprIfFalse). 26 # collate2-2.* WHERE NOT <expr> expressions (sqliteExprIfFalse).
25 # collate2-3.* SELECT <expr> expressions (sqliteExprCode). 27 # collate2-3.* SELECT <expr> expressions (sqliteExprCode).
26 # collate2-4.* Precedence of collation/data types in binary comparisons 28 # collate2-4.* Precedence of collation/data types in binary comparisons
27 # collate2-5.* JOIN syntax. 29 # collate2-5.* JOIN syntax.
28 # 30 #
29 31
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 SELECT collate2t1.a FROM collate2t1, collate2t2 631 SELECT collate2t1.a FROM collate2t1, collate2t2
630 WHERE collate2t2.b = collate2t1.b; 632 WHERE collate2t2.b = collate2t1.b;
631 } 633 }
632 } {aa} 634 } {aa}
633 635
634 # Test that when one side has a default collation type and the other 636 # Test that when one side has a default collation type and the other
635 # does not, the collation type is used. 637 # does not, the collation type is used.
636 do_test collate2-4.3 { 638 do_test collate2-4.3 {
637 execsql { 639 execsql {
638 SELECT collate2t1.a FROM collate2t1, collate2t3 640 SELECT collate2t1.a FROM collate2t1, collate2t3
639 WHERE collate2t1.b = collate2t3.b||''; 641 WHERE collate2t1.b = collate2t3.b||''
642 ORDER BY +collate2t1.a DESC;
640 } 643 }
641 } {aa aA Aa AA} 644 } {aa aA Aa AA}
642 do_test collate2-4.4 { 645 do_test collate2-4.4 {
643 execsql { 646 execsql {
644 SELECT collate2t1.a FROM collate2t1, collate2t3 647 SELECT collate2t1.a FROM collate2t1, collate2t3
645 WHERE collate2t3.b||'' = collate2t1.b; 648 WHERE collate2t3.b||'' = collate2t1.b
649 ORDER BY +collate2t1.a DESC;
646 } 650 }
647 } {aa aA Aa AA} 651 } {aa aA Aa AA}
648 652
649 do_test collate2-4.5 { 653 do_test collate2-4.5 {
650 execsql { 654 execsql {
651 DROP TABLE collate2t3; 655 DROP TABLE collate2t3;
652 } 656 }
653 } {} 657 } {}
654 658
655 # 659 #
(...skipping 28 matching lines...) Expand all
684 execsql { 688 execsql {
685 SELECT collate2t2.b FROM collate2t1 LEFT OUTER JOIN collate2t2 USING (b) ord er by collate2t1.oid; 689 SELECT collate2t2.b FROM collate2t1 LEFT OUTER JOIN collate2t2 USING (b) ord er by collate2t1.oid;
686 } 690 }
687 } {{} aa {} {} {} aa {} {} {} aa {} {} {} aa {} {} {}} 691 } {{} aa {} {} {} aa {} {} {} aa {} {} {} aa {} {} {}}
688 do_test collate2-5.5 { 692 do_test collate2-5.5 {
689 execsql { 693 execsql {
690 SELECT collate2t1.b, collate2t2.b FROM collate2t2 LEFT OUTER JOIN collate2t1 USING (b); 694 SELECT collate2t1.b, collate2t2.b FROM collate2t2 LEFT OUTER JOIN collate2t1 USING (b);
691 } 695 }
692 } {aa aa} 696 } {aa aa}
693 697
698 do_execsql_test 6.1 {
699 CREATE TABLE t1(x);
700 INSERT INTO t1 VALUES('b');
701 INSERT INTO t1 VALUES('B');
702 }
703 do_execsql_test 6.2 {
704 SELECT * FROM t1 WHERE x COLLATE nocase BETWEEN 'a' AND 'c';
705 } {b B}
706 do_execsql_test 6.3 {
707 SELECT * FROM t1 WHERE x BETWEEN 'a' COLLATE nocase AND 'c' COLLATE nocase;
708 } {b B}
709 do_execsql_test 6.4 {
710 SELECT * FROM t1
711 WHERE x COLLATE nocase BETWEEN 'a' COLLATE nocase AND 'c' COLLATE nocase;
712 } {b B}
713 do_execsql_test 6.5 {
714 SELECT * FROM t1 WHERE +x COLLATE nocase BETWEEN 'a' AND 'c';
715 } {b B}
716 do_execsql_test 6.6 {
717 SELECT * FROM t1 WHERE +x BETWEEN 'a' COLLATE nocase AND 'c' COLLATE nocase;
718 } {b B}
719 do_execsql_test 6.7 {
720 SELECT * FROM t1
721 WHERE +x COLLATE nocase BETWEEN 'a' COLLATE nocase AND 'c' COLLATE nocase;
722 } {b B}
723
694 finish_test 724 finish_test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698