1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Test that an explicit collation sequence overrides an implicit one attached to a 'new' reference (it does). No code changes. (CVS 4186)

FossilOrigin-Name: a443b07ed659223401ee7acaf613d0b04f33fc89
This commit is contained in:
danielk1977
2007-07-26 10:16:30 +00:00
parent e0fc52618c
commit 0c3f607c21
3 changed files with 37 additions and 8 deletions

View File

@ -12,7 +12,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script is collation sequences in concert with triggers.
#
# $Id: collate6.test,v 1.2 2004/11/04 04:42:28 drh Exp $
# $Id: collate6.test,v 1.3 2007/07/26 10:16:30 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -107,5 +107,34 @@ do_test collate6-1.9 {
}
} {}
# Test that an explicit collation sequence overrides an implicit
# one attached to a 'new' reference.
#
do_test collate6-2.1 {
execsql {
CREATE TABLE abc(a COLLATE binary, b, c);
CREATE TABLE def(a, b, c);
CREATE TRIGGER abc_t1 AFTER INSERT ON abc BEGIN
INSERT INTO def SELECT * FROM abc WHERE a < new.a COLLATE nocase;
END
}
} {}
do_test collate6-2.2 {
execsql {
INSERT INTO abc VALUES('One', 'Two', 'Three');
INSERT INTO abc VALUES('one', 'two', 'three');
SELECT * FROM def;
}
} {}
do_test collate6-2.3 {
execsql {
UPDATE abc SET a = 'four' WHERE a = 'one';
CREATE TRIGGER abc_t2 AFTER UPDATE ON abc BEGIN
INSERT INTO def SELECT * FROM abc WHERE a < new.a COLLATE nocase;
END;
SELECT * FROM def;
}
} {}
finish_test