Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.1.67, 5.2.14, 5.3.12, 5.5(EOL), 10.0(EOL), 10.1(EOL)
-
RHEL 6
Description
If we create a temporary table with the same name within a store procedure, and try to drop some columns in two different sessions running at the same moment, error " Unknown column" may pop.
Although this is documented in
https://mariadb.com/kb/en/mariadb/documentation/sql-commands/data-definition/create/create-table/
"Temporary table names are specific to your session. They may conflict with other temporary tables from other sessions or shadow names of non-temporary tables."
But this is different behavior with Mysql
http://dev.mysql.com/doc/refman/5.5/en/create-table.html
This means that two different sessions can use the same temporary table name without conflicting with each other or with an existing non-TEMPORARY table of the same name. (The existing table is hidden until the temporary table is dropped.)
This is stopper if using Mariadb as a drop in replacement for Mysql, as this require rewrite all SPs with alter temporary statement.
Attachments
Issue Links
- relates to
-
MDEV-5816 MySQL WL#4179 - Stored programs: validation of stored program statements
-
- Closed
-
- links to
Thanks for the data, I was able to reproduce it now. It's a conflict not between sessions, but between several executions of the stored procedures. It's easily repeatable in a single session:
--delimiter |
--delimiter ;
call pr(1);
call pr(2);
It used to be an upstream bug, fixed in 5.6.6 by the following revision:
revno: 3857
revision-id: alexander.nozdrin@oracle.com-20120516123641-tnvnhoaimesc8bj9
parent: alexander.nozdrin@oracle.com-20120516110343-36sld7c7somcl3z8
committer: Alexander Nozdrin <alexander.nozdrin@oracle.com>
branch nick: trunk-stage.2
timestamp: Wed 2012-05-16 16:36:41 +0400
message:
WL#4179: Stored programs: validation of stored program statements.
Briefly, that's the implementation of WL#4179. The idea is to remember
the original query for SQL-statement within a Stored Programs and re-parse
it when meta-data has changed.