summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp-error.result
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@sun.com>2009-12-10 16:22:41 +0100
committerMagne Mahre <magne.mahre@sun.com>2009-12-10 16:22:41 +0100
commitcc7239b2fc2a16a3c5d9c07108f85a91468f79fe (patch)
tree13c5fd0bfd3e58375a6a1db9ab3ae0c919e54e65 /mysql-test/r/sp-error.result
parent16f315157056230117cddf2f28ddb6603657786f (diff)
downloadmariadb-git-cc7239b2fc2a16a3c5d9c07108f85a91468f79fe.tar.gz
Bug#46374 crash, INSERT INTO t1 uses function, function modifies t1
An error occuring in the execution of a stored procedure, called from do_select is masked, since the error condition is not propagated back to the caller (join->conds->val_int() returns a result value, and not an error code) An explicit check was added to see if the thd error code has been set, and if so, the loop status is set to the error state. Backport from 6.0-codebase (revid: 2617.68.31)
Diffstat (limited to 'mysql-test/r/sp-error.result')
-rw-r--r--mysql-test/r/sp-error.result11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 00ae7dd4eca..034923bbd4f 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1687,6 +1687,17 @@ NULL
SELECT non_existent (a) FROM t1 WHERE b = 999999;
ERROR 42000: FUNCTION test.non_existent does not exist
DROP TABLE t1;
+CREATE TABLE t1 ( f2 INTEGER, f3 INTEGER );
+INSERT INTO t1 VALUES ( 1, 1 );
+CREATE FUNCTION func_1 () RETURNS INTEGER
+BEGIN
+INSERT INTO t1 SELECT * FROM t1 ;
+RETURN 1 ;
+END|
+INSERT INTO t1 SELECT * FROM (SELECT 2 AS f1, 2 AS f2) AS A WHERE func_1() = 5;
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+DROP FUNCTION func_1;
+DROP TABLE t1;
#
# Bug #47788: Crash in TABLE_LIST::hide_view_error on UPDATE + VIEW +
# SP + MERGE + ALTER