diff options
author | unknown <konstantin@mysql.com> | 2005-05-03 12:49:22 +0400 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2005-05-03 12:49:22 +0400 |
commit | b883aebae088aa156f0ddba943fba4b4f4c17f8e (patch) | |
tree | fe569864863fd1ff447cbf75426bfd6e56b5d464 /sql/item_func.cc | |
parent | 9f5a4955d0ccfd27f5338c04e17e5fabd3840616 (diff) | |
parent | 9fcda7fcc5efbc3f58049b8229c4e809c20cc503 (diff) | |
download | mariadb-git-b883aebae088aa156f0ddba943fba4b4f4c17f8e.tar.gz |
Merge mysql.com:/opt/local/work/mysql-4.1-root
into mysql.com:/opt/local/work/mysql-4.1-9096-fresh
sql/item.h:
Auto merged
sql/item_func.cc:
Auto merged
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 1b80ef06251..477849a66c5 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -863,10 +863,12 @@ void Item_func_neg::fix_length_and_dec() maximum number of bytes real or integer may require. Note that all constants are non negative so we don't need to account for removed '-'. B) argument returns a string. + Use val() to get value as arg_type doesn't mean that item is + Item_int or Item_real due to existence of Item_param. */ if (arg_result == STRING_RESULT || - (arg_type == REAL_ITEM && ((Item_real*)args[0])->value >= 0) || - (arg_type == INT_ITEM && ((Item_int*)args[0])->value > 0)) + (arg_type == REAL_ITEM && args[0]->val() >= 0) || + (arg_type == INT_ITEM && args[0]->val_int() > 0)) max_length++; if (args[0]->result_type() == INT_RESULT) @@ -882,8 +884,7 @@ void Item_func_neg::fix_length_and_dec() signed integers) */ if (args[0]->type() != INT_ITEM || - ((ulonglong) ((Item_uint*) args[0])->value <= - (ulonglong) LONGLONG_MIN)) + (((ulonglong) args[0]->val_int()) <= (ulonglong) LONGLONG_MIN)) hybrid_type= INT_RESULT; } } |