File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed
plugin/type_xmltype/mysql-test/type_xmltype Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -219,4 +219,11 @@ CREATE SEQUENCE s;
219219CREATE TABLE t ( a XMLTYPE DEFAULT NEXTVAL(s));
220220ERROR HY000: Cannot cast 'bigint' as 'xmltype' in assignment of `test`.`t`.`a`
221221DROP SEQUENCE s;
222+ CREATE TABLE t1 AS SELECT UpdateXML('<a><b>ccc</b><d></d></a>', '/a', '<e>fff</e>') as x;
223+ SHOW CREATE TABLE t1;
224+ Table Create Table
225+ t1 CREATE TABLE `t1` (
226+ `x` xmltype CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL
227+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
228+ DROP TABLE t1;
222229# End of 11.8 tests
Original file line number Diff line number Diff line change @@ -151,5 +151,9 @@ CREATE SEQUENCE s;
151151CREATE TABLE t ( a XMLTYPE DEFAULT NEXTVAL(s));
152152DROP SEQUENCE s;
153153
154+ CREATE TABLE t1 AS SELECT UpdateXML('<a><b>ccc</b><d></d></a>', '/a', '<e>fff</e>') as x;
155+ SHOW CREATE TABLE t1;
156+ DROP TABLE t1;
157+
154158--echo # End of 11.8 tests
155159
Original file line number Diff line number Diff line change @@ -3072,6 +3072,26 @@ String *Item_func_xml_extractvalue::val_str(String *str)
30723072}
30733073
30743074
3075+ const Type_handler *Item_func_xml_update::xml_handler= NULL ;
3076+
3077+
3078+ bool Item_func_xml_update::fix_length_and_dec (THD *thd)
3079+ {
3080+ static LEX_CSTRING name= {STRING_WITH_LEN (" XMLTYPE" )};
3081+
3082+ if (!xml_handler)
3083+ xml_handler= Type_handler::handler_by_name (thd, name);
3084+
3085+ return Item_xml_str_func::fix_length_and_dec (thd);
3086+ }
3087+
3088+
3089+ const Type_handler *Item_func_xml_update::type_handler () const
3090+ {
3091+ return xml_handler ? xml_handler : Item_xml_str_func::type_handler ();
3092+ }
3093+
3094+
30753095bool Item_func_xml_update::collect_result (String *str,
30763096 const MY_XML_NODE *cut,
30773097 const String *replace)
Original file line number Diff line number Diff line change @@ -157,6 +157,10 @@ class Item_func_xml_update: public Item_xml_str_func
157157 static LEX_CSTRING name= {STRING_WITH_LEN (" updatexml" ) };
158158 return name;
159159 }
160+ static const Type_handler *xml_handler;
161+ const Type_handler *type_handler () const override ;
162+ bool fix_length_and_dec (THD *thd) override ;
163+
160164 String *val_str (String *) override ;
161165 Item *do_get_copy (THD *thd) const override
162166 { return get_item_copy<Item_func_xml_update>(thd, this ); }
You can’t perform that action at this time.
0 commit comments