Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.0, 13.1, 13.2
-
None
Description
CREATE OR REPLACE TABLE t1 (a INT); |
DROP TABLE IF EXISTS t2; |
DELIMITER $$
|
CREATE OR REPLACE FUNCTION f1() RETURNS TYPE OF t1.a |
BEGIN
|
RETURN 5; |
END; |
$$
|
CREATE OR REPLACE PROCEDURE p1() |
BEGIN
|
FOR i IN 1..2 DO |
-- The type of f1() is erroneously cached during the first execution |
CREATE OR REPLACE TABLE t2 AS SELECT f1() AS c1; |
SHOW CREATE TABLE t2; |
ALTER TABLE t1 MODIFY a TEXT; |
END FOR; |
END; |
$$
|
DELIMITER ;
|
CALL p1;
|
returns the following output:
+-------+-----------------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+-----------------------------------------------------------------------------------------------------------------------+
|
| t2 | CREATE TABLE `t2` (
|
`c1` int(11) DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
|
+-------+-----------------------------------------------------------------------------------------------------------------------+
|
1 row in set (0.056 sec)
|
 |
+-------+-----------------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+-----------------------------------------------------------------------------------------------------------------------+
|
| t2 | CREATE TABLE `t2` (
|
`c1` int(11) DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
|
+-------+-----------------------------------------------------------------------------------------------------------------------+
|
1 row in set (0.260 sec)
|
Notice, it creates an INT field both times. Whereas, during the second execution RETURNS TYPE OF t1.a should resolve to TEXT, according to ALTER inside p1.
Attachments
Issue Links
- blocks
-
MDEV-41137 Add support for CHARACTER SET ANY_CS and CHARACTER SET var%CHARSET
-
- In Progress
-