MDEV-35090 (Item_func_current_user) Assertion `typeid(*copy) == typeid(*this)' failed in Item_func_or_sum::do_build_clone

Added missing do_get_copy of Item_func_current_user.
This commit is contained in:
Oleksandr Byelkin 2025-01-23 11:29:52 +01:00
parent 82310f926b
commit b214ca7219
3 changed files with 26 additions and 0 deletions

View file

@ -6990,4 +6990,15 @@ View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` from `t1` union (select 1 AS `1` from DUAL where 1 group by 1 having 1 for update) latin1 latin1_swedish_ci
DROP VIEW v1;
DROP TABLE t1;
#
# MDEV-35090: (Item_func_current_user) Assertion
# `typeid(*copy) == typeid(*this)' failed in
# Item_func_or_sum::do_build_clone
#
CREATE VIEW v AS SELECT 1;
SELECT * FROM v WHERE UpdateXML('<user>N/A</user>','/a',CURRENT_USER());
1
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '<user>N/A</user>'
DROP VIEW v;
# End of 10.5 tests

View file

@ -6755,4 +6755,17 @@ SHOW CREATE VIEW v1;
DROP VIEW v1;
DROP TABLE t1;
--echo #
--echo # MDEV-35090: (Item_func_current_user) Assertion
--echo # `typeid(*copy) == typeid(*this)' failed in
--echo # Item_func_or_sum::do_build_clone
--echo #
CREATE VIEW v AS SELECT 1;
SELECT * FROM v WHERE UpdateXML('<user>N/A</user>','/a',CURRENT_USER());
# Cleanup
DROP VIEW v;
--echo # End of 10.5 tests

View file

@ -1029,6 +1029,8 @@ public:
return mark_unsupported_function(fully_qualified_func_name(), arg,
VCOL_SESSION_FUNC);
}
Item *do_get_copy(THD *thd) const override
{ return get_item_copy<Item_func_current_user>(thd, this); }
};