Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
N/A
-
None
Description
Since XMLTYPE got methods (has_methods() returns true), a two-part identifier t1.col whose first part names an XMLTYPE SP variable is always treated as a method call on the variable. A variable of another type with the same name lets t1.col resolve to the column.
Regression from MDEV-36261 (5370405937a): at its parent 6f18dc2d117 the same test returns 2 and 1.
CREATE TABLE t1 (a INT, getrootelement INT); |
INSERT INTO t1 VALUES (1, 2); |
--delimiter $$
|
CREATE PROCEDURE p1() |
BEGIN
|
DECLARE t1 XMLTYPE DEFAULT '<r/>'; |
SELECT t1.getrootelement FROM t1; |
END$$ |
--delimiter ;
|
--echo # BUG if not 2
|
CALL p1();
|
--delimiter $$
|
--echo # BUG if error: t1.a is a column, as with an INT variable
|
CREATE PROCEDURE p2() |
BEGIN
|
DECLARE t1 XMLTYPE DEFAULT '<r/>'; |
SELECT t1.a FROM t1; |
END$$ |
--delimiter ;
|
CALL p2();
|
DROP PROCEDURE p1; |
DROP PROCEDURE p2; |
DROP TABLE t1; |
CALL p1();
|
t1.getrootelement
|
r
|
CREATE PROCEDURE p2() ...
|
ERROR 42000: FUNCTION t1.a does not exist
|
Attachments
Issue Links
- relates to
-
MDEV-36261 XMLTYPE: methods - step 1
-
- In Testing
-