diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-30 11:15:30 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-30 11:15:30 +0200 |
commit | 898521e2dd8a4a6706cba01b6ef0a7cea4114fd0 (patch) | |
tree | 4ef9a6ddc4298574bb75db673c2412f83c107c5b /sql/item_cmpfunc.cc | |
parent | 571bcf9aaaf59b84e24bbfb809738dea25495d78 (diff) | |
parent | 199863d72b7cccaa4c75641c50c45a83b568ab8c (diff) | |
download | mariadb-git-898521e2dd8a4a6706cba01b6ef0a7cea4114fd0.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c753b963fd4..2b662c4de7d 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2331,7 +2331,7 @@ longlong Item_func_between::val_int_cmp_real() void Item_func_between::print(String *str, enum_query_type query_type) { - args[0]->print_parenthesised(str, query_type, precedence()); + args[0]->print_parenthesised(str, query_type, higher_precedence()); if (negated) str->append(STRING_WITH_LEN(" not")); str->append(STRING_WITH_LEN(" between ")); @@ -3348,27 +3348,28 @@ Item* Item_func_case_simple::propagate_equal_fields(THD *thd, } -void Item_func_case::print_when_then_arguments(String *str, - enum_query_type query_type, - Item **items, uint count) +inline void Item_func_case::print_when_then_arguments(String *str, + enum_query_type + query_type, + Item **items, uint count) { - for (uint i=0 ; i < count ; i++) + for (uint i= 0; i < count; i++) { str->append(STRING_WITH_LEN("when ")); - items[i]->print_parenthesised(str, query_type, precedence()); + items[i]->print(str, query_type); str->append(STRING_WITH_LEN(" then ")); - items[i + count]->print_parenthesised(str, query_type, precedence()); + items[i + count]->print(str, query_type); str->append(' '); } } -void Item_func_case::print_else_argument(String *str, - enum_query_type query_type, - Item *item) +inline void Item_func_case::print_else_argument(String *str, + enum_query_type query_type, + Item *item) { str->append(STRING_WITH_LEN("else ")); - item->print_parenthesised(str, query_type, precedence()); + item->print(str, query_type); str->append(' '); } @@ -5600,12 +5601,14 @@ void Item_func_like::print(String *str, enum_query_type query_type) str->append(STRING_WITH_LEN(" not ")); str->append(func_name()); str->append(' '); - args[1]->print_parenthesised(str, query_type, precedence()); if (escape_used_in_parsing) { + args[1]->print_parenthesised(str, query_type, precedence()); str->append(STRING_WITH_LEN(" escape ")); - escape_item->print(str, query_type); + escape_item->print_parenthesised(str, query_type, higher_precedence()); } + else + args[1]->print_parenthesised(str, query_type, higher_precedence()); } |