summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2003-07-20 12:26:18 +0200
committerunknown <serg@serg.mylan>2003-07-20 12:26:18 +0200
commitc1ed639cb654cc12f2971d840a541c0d9fa80327 (patch)
treef5346590101ec960b64abe165293a334df435f5b /sql/item_func.cc
parent56b220b11e06c5b6074c49cc114c39ee50be1cd1 (diff)
downloadmariadb-git-c1ed639cb654cc12f2971d840a541c0d9fa80327.tar.gz
bug #715: SELECT YEAR+0 FROM foobar is parsed as 'SELECT' 'YEAR' '+0' => syntax error
mysql-test/r/bigint.result: test results updated mysql-test/r/type_decimal.result: test results updated mysql-test/t/bigint.test: new tests added mysql-test/t/type_decimal.test: error numbers updated sql/item.h: round(9999999999999999999) fixed sql/sql_yacc.yy: bug #715: SELECT YEAR+0 FROM foobar is parsed as 'SELECT' 'YEAR' '+0' => syntax error unary '+' added
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index ea3c3980a50..9ecc062d645 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -597,7 +597,8 @@ void Item_func_neg::fix_length_and_dec()
{
decimals=args[0]->decimals;
max_length=args[0]->max_length;
- hybrid_type= args[0]->result_type() == INT_RESULT ? INT_RESULT : REAL_RESULT;
+ hybrid_type= args[0]->result_type() == INT_RESULT && !args[0]->unsigned_flag ?
+ INT_RESULT : REAL_RESULT;
}
double Item_func_abs::val()