/ Check-in [a443b07e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Test that an explicit collation sequence overrides an implicit one attached to a 'new' reference (it does). No code changes. (CVS 4186)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a443b07ed659223401ee7acaf613d0b04f33fc89
User & Date: danielk1977 2007-07-26 10:16:30
Context
2007-07-30
14:40
Fix a bug with explicit collation sequences attached to a column reference expression that is on the right-hand-side of a binary comparison operator. (CVS 4187) check-in: 7b699686 user: danielk1977 tags: trunk
2007-07-26
10:16
Test that an explicit collation sequence overrides an implicit one attached to a 'new' reference (it does). No code changes. (CVS 4186) check-in: a443b07e user: danielk1977 tags: trunk
06:50
Fix two obscure memory leaks that can follow a malloc() failure in sqlite3_set_auxdata(). Ticket #2534. (CVS 4185) check-in: b88af182 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to test/collate6.test.

     8      8   #    May you find forgiveness for yourself and forgive others.
     9      9   #    May you share freely, never taking more than you give.
    10     10   #
    11     11   #***********************************************************************
    12     12   # This file implements regression tests for SQLite library.  The
    13     13   # focus of this script is collation sequences in concert with triggers.
    14     14   #
    15         -# $Id: collate6.test,v 1.2 2004/11/04 04:42:28 drh Exp $
           15  +# $Id: collate6.test,v 1.3 2007/07/26 10:16:30 danielk1977 Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   # There are no tests in this file that will work without
    21     21   # trigger support.
    22     22   #
................................................................................
   102    102   } {}
   103    103   
   104    104   do_test collate6-1.9 {
   105    105     execsql {
   106    106       DROP TABLE collate6tab;
   107    107     }
   108    108   } {}
          109  +
          110  +# Test that an explicit collation sequence overrides an implicit 
          111  +# one attached to a 'new' reference.
          112  +#
          113  +do_test collate6-2.1 {
          114  +  execsql {
          115  +    CREATE TABLE abc(a COLLATE binary, b, c);
          116  +    CREATE TABLE def(a, b, c);
          117  +    CREATE TRIGGER abc_t1 AFTER INSERT ON abc BEGIN
          118  +      INSERT INTO def SELECT * FROM abc WHERE a < new.a COLLATE nocase;
          119  +    END
          120  +  }
          121  +} {}
          122  +do_test collate6-2.2 {
          123  +  execsql {
          124  +    INSERT INTO abc VALUES('One', 'Two', 'Three');
          125  +    INSERT INTO abc VALUES('one', 'two', 'three');
          126  +    SELECT * FROM def;
          127  +  }
          128  +} {}
          129  +do_test collate6-2.3 {
          130  +  execsql {
          131  +    UPDATE abc SET a = 'four' WHERE a = 'one';
          132  +    CREATE TRIGGER abc_t2 AFTER UPDATE ON abc BEGIN
          133  +      INSERT INTO def SELECT * FROM abc WHERE a < new.a COLLATE nocase;
          134  +    END;
          135  +    SELECT * FROM def;
          136  +  }
          137  +} {}
   109    138   
   110    139   
   111    140   finish_test