diff options
Diffstat (limited to 'sql/item_xmlfunc.cc')
-rw-r--r-- | sql/item_xmlfunc.cc | 93 |
1 files changed, 47 insertions, 46 deletions
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc index b926564bdf9..0f5cc1c1250 100644 --- a/sql/item_xmlfunc.cc +++ b/sql/item_xmlfunc.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2005, 2019, Oracle and/or its affiliates. - Copyright (c) 2009, 2020, MariaDB + Copyright (c) 2009, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -141,21 +141,21 @@ public: fltend= (MY_XPATH_FLT*) tmp_native_value.end(); nodeset->length(0); } - const Type_handler *type_handler() const + const Type_handler *type_handler() const override { return &type_handler_xpath_nodeset; } - const Type_handler *fixed_type_handler() const + const Type_handler *fixed_type_handler() const override { return &type_handler_xpath_nodeset; } Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src, - const Tmp_field_param *param) + const Tmp_field_param *param) override { DBUG_ASSERT(0); return NULL; } - String *val_str(String *str) + String *val_str(String *str) override { prepare_nodes(); val_native(current_thd, &tmp2_native_value); @@ -189,7 +189,7 @@ public: } return str; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { max_length= MAX_BLOB_WIDTH; collation.collation= pxml->charset(); @@ -202,7 +202,7 @@ public: { return { STRING_WITH_LEN("nodeset") }; } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), arg, VCOL_IMPOSSIBLE); } @@ -220,8 +220,8 @@ public: { return { STRING_WITH_LEN("xpath_rootelement") }; } - bool val_native(THD *thd, Native *nodeset); - Item *get_copy(THD *thd) + bool val_native(THD *thd, Native *nodeset) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_nodeset_func_rootelement>(thd, this); } }; @@ -236,8 +236,8 @@ public: { return { STRING_WITH_LEN("xpath_union") }; } - bool val_native(THD *thd, Native *nodeset); - Item *get_copy(THD *thd) + bool val_native(THD *thd, Native *nodeset) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_nodeset_func_union>(thd, this); } }; @@ -276,8 +276,8 @@ public: { return { STRING_WITH_LEN("xpath_selfbyname") }; } - bool val_native(THD *thd, Native *nodeset); - Item *get_copy(THD *thd) + bool val_native(THD *thd, Native *nodeset) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_nodeset_func_selfbyname>(thd, this); } }; @@ -293,8 +293,8 @@ public: { return { STRING_WITH_LEN("xpath_childbyname") }; } - bool val_native(THD *thd, Native *nodeset); - Item *get_copy(THD *thd) + bool val_native(THD *thd, Native *nodeset) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_nodeset_func_childbyname>(thd, this); } }; @@ -312,8 +312,8 @@ public: { return { STRING_WITH_LEN("xpath_descendantbyname") }; } - bool val_native(THD *thd, Native *nodeset); - Item *get_copy(THD *thd) + bool val_native(THD *thd, Native *nodeset) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_nodeset_func_descendantbyname>(thd, this); } }; @@ -331,8 +331,8 @@ public: { return { STRING_WITH_LEN("xpath_ancestorbyname") }; } - bool val_native(THD *thd, Native *nodeset); - Item *get_copy(THD *thd) + bool val_native(THD *thd, Native *nodeset) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_nodeset_func_ancestorbyname>(thd, this); } }; @@ -349,8 +349,8 @@ public: { return { STRING_WITH_LEN("xpath_parentbyname") }; } - bool val_native(THD *thd, Native *nodeset); - Item *get_copy(THD *thd) + bool val_native(THD *thd, Native *nodeset) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_nodeset_func_parentbyname>(thd, this); } }; @@ -366,8 +366,8 @@ public: { return { STRING_WITH_LEN("xpath_attributebyname") }; } - bool val_native(THD *thd, Native *nodeset); - Item *get_copy(THD *thd) + bool val_native(THD *thd, Native *nodeset) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_nodeset_func_attributebyname>(thd, this); } }; @@ -386,8 +386,8 @@ public: { return { STRING_WITH_LEN("xpath_predicate") }; } - bool val_native(THD *thd, Native *nodeset); - Item *get_copy(THD *thd) + bool val_native(THD *thd, Native *nodeset) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_nodeset_func_predicate>(thd, this); } }; @@ -402,8 +402,8 @@ public: { return { STRING_WITH_LEN("xpath_elementbyindex") }; } - bool val_native(THD *thd, Native *nodeset); - Item *get_copy(THD *thd) + bool val_native(THD *thd, Native *nodeset) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_nodeset_func_elementbyindex>(thd, this); } }; @@ -425,7 +425,7 @@ public: { return { STRING_WITH_LEN("xpath_cast_bool") }; } - longlong val_int() + longlong val_int() override { if (args[0]->fixed_type_handler() == &type_handler_xpath_nodeset) { @@ -434,7 +434,7 @@ public: } return args[0]->val_real() ? 1 : 0; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_xpath_cast_bool>(thd, this); } }; @@ -450,8 +450,8 @@ public: { return { STRING_WITH_LEN("xpath_cast_number") }; } - virtual double val_real() { return args[0]->val_real(); } - Item *get_copy(THD *thd) + double val_real() override { return args[0]->val_real(); } + Item *get_copy(THD *thd) override { return get_item_copy<Item_xpath_cast_number>(thd, this); } }; @@ -465,12 +465,13 @@ public: Native *native_cache; Item_nodeset_context_cache(THD *thd, Native *native_arg, String *pxml): Item_nodeset_func(thd, pxml), native_cache(native_arg) { } - bool val_native(THD *thd, Native *nodeset) + bool val_native(THD *, Native *nodeset) override { return nodeset->copy(*native_cache); } - bool fix_length_and_dec() { max_length= MAX_BLOB_WIDTH;; return FALSE; } - Item *get_copy(THD *thd) + bool fix_length_and_dec() override + { max_length= MAX_BLOB_WIDTH; return FALSE; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_nodeset_context_cache>(thd, this); } }; @@ -486,15 +487,15 @@ public: { return { STRING_WITH_LEN("xpath_position") }; } - bool fix_length_and_dec() { max_length=10; return FALSE; } - longlong val_int() + bool fix_length_and_dec() override { max_length=10; return FALSE; } + longlong val_int() override { args[0]->val_native(current_thd, &tmp_native_value); if (tmp_native_value.elements() == 1) return tmp_native_value.element(0).pos + 1; return 0; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_xpath_position>(thd, this); } }; @@ -510,8 +511,8 @@ public: { return { STRING_WITH_LEN("xpath_count") }; } - bool fix_length_and_dec() { max_length=10; return FALSE; } - longlong val_int() + bool fix_length_and_dec() override { max_length=10; return FALSE; } + longlong val_int() override { uint predicate_supplied_context_size; args[0]->val_native(current_thd, &tmp_native_value); @@ -520,7 +521,7 @@ public: return predicate_supplied_context_size; return tmp_native_value.elements(); } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_xpath_count>(thd, this); } }; @@ -537,7 +538,7 @@ public: { return { STRING_WITH_LEN("xpath_sum") }; } - double val_real() + double val_real() override { double sum= 0; args[0]->val_native(current_thd, &tmp_native_value); @@ -568,7 +569,7 @@ public: } return sum; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_xpath_sum>(thd, this); } }; @@ -612,17 +613,17 @@ public: { return { STRING_WITH_LEN("xpath_nodeset_to_const_comparator") }; } - bool check_vcol_func_processor(void *arg) + bool check_vcol_func_processor(void *arg) override { return mark_unsupported_function(func_name(), arg, VCOL_IMPOSSIBLE); } Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src, - const Tmp_field_param *param) + const Tmp_field_param *param) override { DBUG_ASSERT(0); return NULL; } - longlong val_int() + longlong val_int() override { Item_func *comp= (Item_func*)args[1]; Item_string_xml_non_const *fake= @@ -653,7 +654,7 @@ public: } return 0; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_nodeset_to_const_comparator>(thd, this); } }; |