Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stored procedure: temp table created in procedure not visible #8762

Open
zachmu opened this issue Jan 16, 2025 · 0 comments
Open

Stored procedure: temp table created in procedure not visible #8762

zachmu opened this issue Jan 16, 2025 · 0 comments

Comments

@zachmu
Copy link
Member

zachmu commented Jan 16, 2025

Temporary tables created during stored procedure execution are not visible in the session in later statements.

Repro:

DROP PROCEDURE IF EXISTS CreateTemporaryTable;
DELIMITER //
CREATE PROCEDURE CreateTemporaryTable()
BEGIN
  DROP TEMPORARY TABLE IF EXISTS TEMP_TABLE;
  CREATE TEMPORARY TABLE TEMP_TABLE (NAME TEXT);
  INSERT INTO TEMP_TABLE VALUES ('A'),('B');

  SELECT * FROM TEMP_TABLE;
END //
DELIMITER ;

CALL CreateTemporaryTable();

Related bug: DROP TEMPORARY TABLE does not parse correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant