sqlite/test/altertab2.test
dan 34566c4434 By default, make all "ALTER TABLE RENAME" statements executed within a virtual
table xRename() method exhibit the legacy behaviour.

FossilOrigin-Name: 71947337e98b90debb13b390119bc2a6b39dd41535151b836071ee327a31e45d
2018-09-20 17:21:21 +00:00

47 lines
1.0 KiB
Plaintext

# 2018 September 30
#
# 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.
#
#*************************************************************************
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix altertab
# If SQLITE_OMIT_ALTERTABLE is defined, omit this file.
ifcapable !altertable {
finish_test
return
}
ifcapable fts5 {
do_execsql_test 1.0 {
CREATE TABLE rr(a, b);
CREATE VIRTUAL TABLE ff USING fts5(a, b);
CREATE TRIGGER tr1 AFTER INSERT ON rr BEGIN
INSERT INTO ff VALUES(new.a, new.b);
END;
INSERT INTO rr VALUES('hello', 'world');
SELECT * FROM ff;
} {hello world}
do_execsql_test 1.1 {
ALTER TABLE ff RENAME TO ffff;
}
do_execsql_test 1.2 {
INSERT INTO rr VALUES('in', 'tcl');
SELECT * FROM ffff;
} {hello world in tcl}
}
finish_test