diff options
author | unknown <bell@sanja.is.com.ua> | 2003-10-28 12:45:37 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2003-10-28 12:45:37 +0200 |
commit | 683dcaae6bfc101d352755f834ecda48f4ea4700 (patch) | |
tree | 1088bf30fb5febda5000cffc7db8982c9e5d1257 /sql/item_cmpfunc.cc | |
parent | 87eb9ea2b10e5ae9d251444e9f3372b958f6a7ea (diff) | |
parent | 47f3a4fd4aa4ac7f2944c85aa20333fa0259ac77 (diff) | |
download | mariadb-git-683dcaae6bfc101d352755f834ecda48f4ea4700.tar.gz |
merge
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 62 |
1 files changed, 59 insertions, 3 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 4e6301d2626..d183c81b230 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -112,6 +112,14 @@ longlong Item_func_not_all::val_int() return (!null_value && value == 0) ? 1 : 0; } +void Item_func_not_all::print(String *str) +{ + if (show) + Item_func::print(str); + else + args[0]->print(str); +} + /* Convert a constant expression or string to an integer. This is done when comparing DATE's of different formats and @@ -704,6 +712,18 @@ longlong Item_func_between::val_int() return 0; } + +void Item_func_between::print(String *str) +{ + str->append('('); + args[0]->print(str); + str->append(" between "); + args[1]->print(str); + str->append(" and "); + args[2]->print(str); + str->append(')'); +} + void Item_func_ifnull::fix_length_and_dec() { @@ -1097,7 +1117,27 @@ void Item_func_case::fix_length_and_dec() void Item_func_case::print(String *str) { - str->append("case "); // Not yet complete + str->append("(case "); + if (first_expr_num != -1) + { + args[first_expr_num]->print(str); + str->append(' '); + } + for (uint i=0 ; i < ncases ; i+=2) + { + str->append("when "); + args[i]->print(str); + str->append(" then "); + args[i+1]->print(str); + str->append(' '); + } + if (else_expr_num != -1) + { + str->append("else "); + args[else_expr_num]->print(str); + str->append(' '); + } + str->append("end)"); } /* @@ -1504,8 +1544,15 @@ void Item_func_in::fix_length_and_dec() void Item_func_in::print(String *str) { str->append('('); - Item_func::print(str); - str->append(')'); + args[0]->print(str); + str->append(" IN ("); + for (uint i=1 ; i < arg_count ; i++) + { + if (i > 1) + str->append(','); + args[i]->print(str); + } + str->append("))"); } @@ -1866,12 +1913,21 @@ void Item_is_not_null_test::update_used_tables() } } + longlong Item_func_isnotnull::val_int() { return args[0]->is_null() ? 0 : 1; } +void Item_func_isnotnull::print(String *str) +{ + str->append('('); + args[0]->print(str); + str->append(" is not null)"); +} + + longlong Item_func_like::val_int() { String* res = args[0]->val_str(&tmp_value1); |