# Test variations inspired by # Bug#12713 Error in a stored function called from a SELECT doesn't cause # ROLLBACK of statement --source include/have_innodb.inc let $engine = MyISAM; --disable_abort_on_error --disable_warnings DROP TABLE IF EXISTS t1_aux; DROP TABLE IF EXISTS t1_not_null; DROP FUNCTION IF EXISTS f1_two_inserts; --enable_warnings SET SESSION sql_mode = ''; --replace_result $engine eval CREATE TABLE t1_not_null (f1 BIGINT, f2 BIGINT NOT NULL) ENGINE = $engine; --replace_result $engine eval CREATE TABLE t1_aux (f1 BIGINT, f2 BIGINT) ENGINE = $engine; SELECT * FROM t1_not_null; INSERT INTO t1_aux VALUES (1,1); COMMIT; delimiter //; CREATE FUNCTION f1_two_inserts() returns INTEGER BEGIN INSERT INTO t1_not_null SET f1 = 10, f2 = NULL; RETURN 1; END// delimiter ;// UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts(); # Cleanup DROP TABLE t1_aux; DROP TABLE t1_not_null; DROP FUNCTION f1_two_inserts;