diff options
author | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2022-01-26 03:02:45 +0530 |
---|---|---|
committer | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2022-03-30 17:00:17 +0530 |
commit | 3eb1e11d8a68b5667193d14d718b5e672fe18fb7 (patch) | |
tree | 741082e6b477928875c9147296528cee9f30ab13 /sql/item_jsonfunc.cc | |
parent | 12abe61af44205a17c75ace71252db1bad05b184 (diff) | |
download | mariadb-git-3eb1e11d8a68b5667193d14d718b5e672fe18fb7.tar.gz |
MDEV-23479: Add a THD* argument to Item_func_or_sum::fix_length_and_dec()
Fix: Added THD *thd argument in Item_func_or_sum::fix_length_and_dec() and in
fix_length_and_dec() for all derived classes of Item_func_or_sum.
Diffstat (limited to 'sql/item_jsonfunc.cc')
-rw-r--r-- | sql/item_jsonfunc.cc | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index bf151baf9c4..561bc529ce4 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -394,9 +394,9 @@ longlong Item_func_json_valid::val_int() } -bool Item_func_json_equals::fix_length_and_dec() +bool Item_func_json_equals::fix_length_and_dec(THD *thd) { - if (Item_bool_func::fix_length_and_dec()) + if (Item_bool_func::fix_length_and_dec(thd)) return TRUE; set_maybe_null(); return FALSE; @@ -454,9 +454,9 @@ end: } -bool Item_func_json_exists::fix_length_and_dec() +bool Item_func_json_exists::fix_length_and_dec(THD *thd) { - if (Item_bool_func::fix_length_and_dec()) + if (Item_bool_func::fix_length_and_dec(thd)) return TRUE; set_maybe_null(); path.set_constant_flag(args[1]->const_item()); @@ -507,7 +507,7 @@ err_return: } -bool Item_func_json_value::fix_length_and_dec() +bool Item_func_json_value::fix_length_and_dec(THD *thd) { collation.set(args[0]->collation); max_length= args[0]->max_length; @@ -517,7 +517,7 @@ bool Item_func_json_value::fix_length_and_dec() } -bool Item_func_json_query::fix_length_and_dec() +bool Item_func_json_query::fix_length_and_dec(THD *thd) { collation.set(args[0]->collation); max_length= args[0]->max_length; @@ -629,7 +629,7 @@ bool Json_engine_scan::check_and_get_value_complex(String *res, int *error) } -bool Item_func_json_quote::fix_length_and_dec() +bool Item_func_json_quote::fix_length_and_dec(THD *thd) { collation.set(&my_charset_utf8mb4_bin); /* @@ -665,7 +665,7 @@ String *Item_func_json_quote::val_str(String *str) } -bool Item_func_json_unquote::fix_length_and_dec() +bool Item_func_json_unquote::fix_length_and_dec(THD *thd) { collation.set(&my_charset_utf8mb3_general_ci, DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII); @@ -785,7 +785,7 @@ void Item_json_str_multipath::cleanup() } -bool Item_func_json_extract::fix_length_and_dec() +bool Item_func_json_extract::fix_length_and_dec(THD *thd) { collation.set(args[0]->collation); max_length= args[0]->max_length * (arg_count - 1); @@ -1055,14 +1055,14 @@ my_decimal *Item_func_json_extract::val_decimal(my_decimal *to) -bool Item_func_json_contains::fix_length_and_dec() +bool Item_func_json_contains::fix_length_and_dec(THD *thd) { a2_constant= args[1]->const_item(); a2_parsed= FALSE; set_maybe_null(); if (arg_count > 2) path.set_constant_flag(args[2]->const_item()); - return Item_bool_func::fix_length_and_dec(); + return Item_bool_func::fix_length_and_dec(thd); } @@ -1306,13 +1306,13 @@ bool Item_func_json_contains_path::fix_fields(THD *thd, Item **ref) } -bool Item_func_json_contains_path::fix_length_and_dec() +bool Item_func_json_contains_path::fix_length_and_dec(THD *thd) { ooa_constant= args[1]->const_item(); ooa_parsed= FALSE; set_maybe_null(); mark_constant_paths(paths, args+2, arg_count-2); - return Item_bool_func::fix_length_and_dec(); + return Item_bool_func::fix_length_and_dec(thd); } @@ -1643,7 +1643,7 @@ append_null: } -bool Item_func_json_array::fix_length_and_dec() +bool Item_func_json_array::fix_length_and_dec(THD *thd) { ulonglong char_length= 2; uint n_arg; @@ -1712,7 +1712,7 @@ err_return: } -bool Item_func_json_array_append::fix_length_and_dec() +bool Item_func_json_array_append::fix_length_and_dec(THD *thd) { uint n_arg; ulonglong char_length; @@ -2651,7 +2651,7 @@ null_return: } -bool Item_func_json_length::fix_length_and_dec() +bool Item_func_json_length::fix_length_and_dec(THD *thd) { if (arg_count > 1) path.set_constant_flag(args[1]->const_item()); @@ -2797,7 +2797,7 @@ longlong Item_func_json_depth::val_int() } -bool Item_func_json_type::fix_length_and_dec() +bool Item_func_json_type::fix_length_and_dec(THD *thd) { collation.set(&my_charset_utf8mb3_general_ci); max_length= 12; @@ -2855,7 +2855,7 @@ error: } -bool Item_func_json_insert::fix_length_and_dec() +bool Item_func_json_insert::fix_length_and_dec(THD *thd) { uint n_arg; ulonglong char_length; @@ -3119,7 +3119,7 @@ return_null: } -bool Item_func_json_remove::fix_length_and_dec() +bool Item_func_json_remove::fix_length_and_dec(THD *thd) { collation.set(args[0]->collation); max_length= args[0]->max_length; @@ -3308,7 +3308,7 @@ null_return: } -bool Item_func_json_keys::fix_length_and_dec() +bool Item_func_json_keys::fix_length_and_dec(THD *thd) { collation.set(args[0]->collation); max_length= args[0]->max_length; @@ -3476,7 +3476,7 @@ bool Item_func_json_search::fix_fields(THD *thd, Item **ref) static const uint SQR_MAX_BLOB_WIDTH= (uint) sqrt(MAX_BLOB_WIDTH); -bool Item_func_json_search::fix_length_and_dec() +bool Item_func_json_search::fix_length_and_dec(THD *thd) { collation.set(args[0]->collation); @@ -3676,7 +3676,7 @@ LEX_CSTRING Item_func_json_format::func_name_cstring() const } -bool Item_func_json_format::fix_length_and_dec() +bool Item_func_json_format::fix_length_and_dec(THD *thd) { decimals= 0; collation.set(args[0]->collation); @@ -4023,7 +4023,7 @@ end: } -bool Item_func_json_normalize::fix_length_and_dec() +bool Item_func_json_normalize::fix_length_and_dec(THD *thd) { collation.set(&my_charset_utf8mb4_bin); /* 0 becomes 0.0E0, thus one character becomes 5 chars */ @@ -4390,11 +4390,11 @@ error: return 0; } -bool Item_func_json_overlaps::fix_length_and_dec() +bool Item_func_json_overlaps::fix_length_and_dec(THD *thd) { a2_constant= args[1]->const_item(); a2_parsed= FALSE; set_maybe_null(); - return Item_bool_func::fix_length_and_dec(); + return Item_bool_func::fix_length_and_dec(thd); } |