diff options
Diffstat (limited to 'mysql-test/t/sp_trans.test')
-rw-r--r-- | mysql-test/t/sp_trans.test | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index 0b04b9d7668..ce18b2b578e 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -592,6 +592,44 @@ select distinct f1, bug13575(f1) from t3 order by f1| drop function bug13575| drop table t3| +--echo # +--echo # End of 5.1 tests +--echo # + +--echo # +--echo # Bug #35877 Update .. WHERE with function, constraint violation, crash +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1_aux| +DROP TABLE IF EXISTS t1_not_null| +DROP FUNCTION IF EXISTS f1_two_inserts| +--enable_warnings + +-- echo # MyISAM test +CREATE TABLE t1_not_null (f1 BIGINT, f2 BIGINT NOT NULL)| +CREATE TABLE t1_aux (f1 BIGINT, f2 BIGINT)| +INSERT INTO t1_aux VALUES (1,1)| + +CREATE FUNCTION f1_two_inserts() returns INTEGER +BEGIN + INSERT INTO t1_not_null SET f1 = 10, f2 = NULL; + RETURN 1; +END| + +-- error ER_BAD_NULL_ERROR +UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()| + +-- echo # InnoDB test +ALTER TABLE t1_not_null ENGINE = InnoDB| +ALTER TABLE t1_aux ENGINE = InnoDB| + +-- error ER_BAD_NULL_ERROR +UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()| + +DROP TABLE t1_aux, t1_not_null| +DROP FUNCTION f1_two_inserts| + # # BUG#NNNN: New bug synopsis |