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

The sqlite3ExprCodeFactorable() routine should make a copy of non-factorable

expressions, as they might be coming from a DEFAULT or generated column
in a table constraint.

FossilOrigin-Name: a2d6f108c5d07559b125823a04c9cb072c80be80d7913097891a6192c7e1e225
This commit is contained in:
drh
2020-03-10 02:57:37 +00:00
parent afa1ecac9b
commit 088489e8d9
4 changed files with 19 additions and 9 deletions

View File

@ -128,4 +128,13 @@ do_catchsql_test default-4.4 {
CREATE TABLE t2(a TEXT, b TEXT DEFAULT(98+coalesce(5,:xyz)));
} {1 {default value of column [b] is not constant}}
# 2020-03-09 out-of-bounds memory access discovered by "Eternal Sakura"
# and reported to chromium.
#
reset_db
do_catchsql_test default-5.1 {
CREATE TABLE t1 (a,b DEFAULT(random() NOTNULL IN (RAISE(IGNORE),2,3)));
INSERT INTO t1(a) VALUES(1);
} {1 {RAISE() may only be used within a trigger-program}}
finish_test