Skip to content

Commit b214ca7

Browse files
committed
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.
1 parent 82310f9 commit b214ca7

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

mysql-test/main/view.result

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6990,4 +6990,15 @@ View Create View character_set_client collation_connection
69906990
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
69916991
DROP VIEW v1;
69926992
DROP TABLE t1;
6993+
#
6994+
# MDEV-35090: (Item_func_current_user) Assertion
6995+
# `typeid(*copy) == typeid(*this)' failed in
6996+
# Item_func_or_sum::do_build_clone
6997+
#
6998+
CREATE VIEW v AS SELECT 1;
6999+
SELECT * FROM v WHERE UpdateXML('<user>N/A</user>','/a',CURRENT_USER());
7000+
1
7001+
Warnings:
7002+
Warning 1292 Truncated incorrect INTEGER value: '<user>N/A</user>'
7003+
DROP VIEW v;
69937004
# End of 10.5 tests

mysql-test/main/view.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6755,4 +6755,17 @@ SHOW CREATE VIEW v1;
67556755
DROP VIEW v1;
67566756
DROP TABLE t1;
67576757

6758+
--echo #
6759+
--echo # MDEV-35090: (Item_func_current_user) Assertion
6760+
--echo # `typeid(*copy) == typeid(*this)' failed in
6761+
--echo # Item_func_or_sum::do_build_clone
6762+
--echo #
6763+
6764+
CREATE VIEW v AS SELECT 1;
6765+
6766+
SELECT * FROM v WHERE UpdateXML('<user>N/A</user>','/a',CURRENT_USER());
6767+
6768+
# Cleanup
6769+
DROP VIEW v;
6770+
67586771
--echo # End of 10.5 tests

sql/item_strfunc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,8 @@ class Item_func_current_user :public Item_func_user
10291029
return mark_unsupported_function(fully_qualified_func_name(), arg,
10301030
VCOL_SESSION_FUNC);
10311031
}
1032+
Item *do_get_copy(THD *thd) const override
1033+
{ return get_item_copy<Item_func_current_user>(thd, this); }
10321034
};
10331035

10341036

0 commit comments

Comments
 (0)