1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Prevent a segfault described by ticket #1229. (CVS 2450)

FossilOrigin-Name: 0667eae9a97059125a77bd90452d19dc17c30a12
This commit is contained in:
drh
2005-04-29 02:10:00 +00:00
parent 89dec819d2
commit 7e62779a58
5 changed files with 45 additions and 13 deletions

View File

@ -13,7 +13,7 @@
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc2.test,v 1.21 2005/03/29 03:11:00 danielk1977 Exp $
# $Id: misc2.test,v 1.22 2005/04/29 02:10:00 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -250,4 +250,21 @@ ifcapable tempdb {
} [expr 5*5*5*5]
}
# Ticket #1229. Sometimes when a "NEW.X" appears in a SELECT without
# a FROM clause deep within a trigger, the code generator is unable to
# trace the NEW.X back to an original table and thus figure out its
# declared datatype.
#
# The SQL code below was causing a segfault.
#
do_test misc2-10.1 {
execsql {
CREATE TABLE t1229(x);
CREATE TRIGGER r1229 BEFORE INSERT ON t1229 BEGIN
INSERT INTO t1229 SELECT y FROM (SELECT new.x y);
END;
INSERT INTO t1229 VALUES(1);
}
} {}
finish_test