diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-28 10:01:50 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-28 10:01:50 +0200 |
commit | a8de8f261d1b7621b8e16396e87dfaac14891162 (patch) | |
tree | 9b8ec45858c2757305e0bdecf237fcb59251020c /sql/item_cmpfunc.cc | |
parent | e183aec1d75ea7b424ebe237e6b1643961903f2d (diff) | |
parent | 42e1815ad850384fad292534665ff61b78dd96f6 (diff) | |
download | mariadb-git-a8de8f261d1b7621b8e16396e87dfaac14891162.tar.gz |
Merge 10.2 into 10.3
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 2d4501ed222..195d30c222b 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2251,7 +2251,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 ")); @@ -3238,27 +3238,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(' '); } @@ -5232,12 +5233,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()); } |