Bug #10170 Table CREATE in procedure not visible in called procedure
Submitted: 26 Apr 2005 11:05 Modified: 29 Apr 2005 13:54
Reporter: Anders Karlsson Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.4 OS:Linux (Linux Fedora 2)
Assigned to: Assigned Account CPU Architecture:Any

[26 Apr 2005 11:05] Anders Karlsson
Description:
When a table is created in a stored procedure, which then in turn calls another procedure that access this table, when calliing the first procedure an error that the table does not exist is returned.

How to repeat:
DROP PROCEDURE IF EXISTS foo;
delimiter //
CREATE PROCEDURE foo()
BEGIN
	CREATE TABLE footab(col1 INTEGER);
	CALL bar();
END;
//
delimiter ;

DROP PROCEDURE IF EXISTS bar;
delimiter //
CREATE PROCEDURE bar()
BEGIN
	INSERT INTO footab VALUES(1);
END;
//
delimiter ;

CALL foo();
ERROR 1146 (42S02) at line 22: Table 'test.footab' doesn't exist
[29 Apr 2005 13:54] Per-Erik Martin
This is a duplicate of BUG#8766.