# ESSENTIALs two sessions --disable_warnings DROP TABLE IF EXISTS t0, t1 ; DROP VIEW IF EXISTS v0; DROP PROCEDURE IF EXISTS test_proc10; DROP FUNCTION IF EXISTS test_func1; DROP FUNCTION IF EXISTS test_func10; DROP DATABASE IF EXISTS mysqltest_db1; --enable_warnings CREATE TABLE t0 (f1 BIGINT, f2 BIGINT); INSERT INTO t0 VALUES(1, 1); CREATE TABLE t1 AS SELECT * FROM t0; ################################################################################ # Establish the working connections # ################################################################################ --replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK connect (con1,localhost,root,,test); connection default; --replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK connect (con2,localhost,root,,test); connection default; --disable_abort_on_error --disable_warnings DROP FUNCTION IF EXISTS test_func1; --enable_warnings delimiter //; CREATE FUNCTION test_func1() RETURNS INT BEGIN RETURN (SELECT MAX(f1) FROM t1); END // delimiter ;// connection con1; PREPARE s1 FROM 'SELECT test_func1() FROM t1 LIMIT 1'; EXECUTE s1; connection con2; CREATE PROCEDURE test_proc10() SELECT 238; DROP PROCEDURE test_proc10; connection con1; EXECUTE s1; # ERROR 42000: FUNCTION test.test_func1 does not exist connection con2; CREATE PROCEDURE test_proc10() SELECT 238; DROP PROCEDURE test_proc10; connection con1; EXECUTE s1; # ERROR 42000: FUNCTION test.test_func1 does not exist #--------------------------------------------------------------------------# connection con1; PREPARE s1 FROM 'SELECT test_func1() FROM t1 LIMIT 1'; EXECUTE s1; connection con2; CREATE FUNCTION test_func10() RETURNS INT RETURN 5; DROP FUNCTION test_func10; connection con1; EXECUTE s1; # ERROR 42000: FUNCTION test.test_func1 does not exist connection con2; CREATE FUNCTION test_func10() RETURNS INT RETURN 5; DROP FUNCTION test_func10; connection con1; EXECUTE s1; # ERROR 42000: FUNCTION test.test_func1 does not exist #--------------------------------------------------------------------------# connection con1; PREPARE s1 FROM 'SELECT test_func1() FROM t1 LIMIT 1'; EXECUTE s1; connection con2; CREATE VIEW v0 AS SELECT * FROM t0; DROP VIEW v0; connection con1; EXECUTE s1; # ERROR 42000: FUNCTION test.test_func1 does not exist connection con2; CREATE VIEW v0 AS SELECT * FROM t0; DROP VIEW v0; connection con1; EXECUTE s1; # ERROR 42000: FUNCTION test.test_func1 does not exist