diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2017-05-02 15:47:43 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2017-05-02 15:47:43 +0400 |
commit | 3ea9d3e59eecadce877416218a7f7789e65ba69a (patch) | |
tree | 522544684c5edb376a69e42dc836b4af0cf4bf65 /sql | |
parent | 4a484e7a207f927089893a0344afa15031803e5d (diff) | |
download | mariadb-git-3ea9d3e59eecadce877416218a7f7789e65ba69a.tar.gz |
MDEV-12363 Assertion `0' failed in Type_handler_string_result::make_sort_key(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*).
maybe_null wasn't properly set for Item_json_func_keys.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_jsonfunc.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index caacd189664..c7639bc2513 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -444,6 +444,7 @@ void Item_func_json_value::fix_length_and_dec() collation.set(args[0]->collation); max_length= args[0]->max_length; path.set_constant_flag(args[1]->const_item()); + maybe_null= 1; } @@ -582,6 +583,7 @@ void Item_func_json_unquote::fix_length_and_dec() { collation.set(&my_charset_utf8_general_ci); max_length= args[0]->max_length; + maybe_null= 1; } @@ -683,6 +685,7 @@ void Item_func_json_extract::fix_length_and_dec() max_length= args[0]->max_length * (arg_count - 1); mark_constant_paths(paths, args+1, arg_count-1); + maybe_null= 1; } @@ -884,6 +887,7 @@ void Item_func_json_contains::fix_length_and_dec() { a2_constant= args[1]->const_item(); a2_parsed= FALSE; + maybe_null= 1; if (arg_count > 2) path.set_constant_flag(args[2]->const_item()); Item_int_func::fix_length_and_dec(); @@ -1129,6 +1133,7 @@ void Item_func_json_contains_path::fix_length_and_dec() { ooa_constant= args[1]->const_item(); ooa_parsed= FALSE; + maybe_null= 1; mark_constant_paths(paths, args+2, arg_count-2); Item_int_func::fix_length_and_dec(); } @@ -2042,6 +2047,7 @@ void Item_func_json_length::fix_length_and_dec() { if (arg_count > 1) path.set_constant_flag(args[1]->const_item()); + maybe_null= 1; } @@ -2178,6 +2184,7 @@ void Item_func_json_type::fix_length_and_dec() { collation.set(&my_charset_utf8_general_ci); max_length= 12; + maybe_null= 1; } @@ -2245,6 +2252,7 @@ void Item_func_json_insert::fix_length_and_dec() } fix_char_length_ulonglong(char_length); + maybe_null= 1; } @@ -2491,6 +2499,7 @@ void Item_func_json_remove::fix_length_and_dec() max_length= args[0]->max_length; mark_constant_paths(paths, args+1, arg_count-1); + maybe_null= 1; } @@ -2674,6 +2683,7 @@ void Item_func_json_keys::fix_length_and_dec() { collation.set(args[0]->collation); max_length= args[0]->max_length; + maybe_null= 1; if (arg_count > 1) path.set_constant_flag(args[1]->const_item()); } @@ -2815,6 +2825,7 @@ void Item_func_json_search::fix_length_and_dec() if (arg_count > 4) mark_constant_paths(paths, args+4, arg_count-4); + maybe_null= 1; } @@ -2996,6 +3007,7 @@ void Item_func_json_format::fix_length_and_dec() { decimals= 0; max_length= args[0]->max_length; + maybe_null= 1; } |