diff options
author | unknown <mkindahl@dl145h.mysql.com> | 2008-03-14 18:32:01 +0100 |
---|---|---|
committer | unknown <mkindahl@dl145h.mysql.com> | 2008-03-14 18:32:01 +0100 |
commit | 774d21cf3bcdf40ed3c2c33662766922cbbbb569 (patch) | |
tree | 0e9bbc644772de90097a81a9fcdbadb0b9513257 /sql/item_func.h | |
parent | 0b7d39fd5fa32c0dd3bbbdf27a2bc2cbe1bcd096 (diff) | |
parent | 269ebe54211cf96c4e64fa7268a1414588ca1de8 (diff) | |
download | mariadb-git-774d21cf3bcdf40ed3c2c33662766922cbbbb569.tar.gz |
Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
mysql-test/include/commit.inc:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
mysql-test/r/commit_1innodb.result:
Auto merged
mysql-test/r/variables.result:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/handler.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/log.cc:
Auto merged
sql/rpl_rli.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index 9ab30a2cf93..b6ee0a3de5e 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -54,7 +54,8 @@ public: NOT_FUNC, NOT_ALL_FUNC, NOW_FUNC, TRIG_COND_FUNC, SUSERVAR_FUNC, GUSERVAR_FUNC, COLLATE_FUNC, - EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP, UDF_FUNC }; + EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP, UDF_FUNC, + NEG_FUNC }; enum optimize_type { OPTIMIZE_NONE,OPTIMIZE_KEY,OPTIMIZE_OP, OPTIMIZE_NULL, OPTIMIZE_EQUAL }; enum Type type() const { return FUNC_ITEM; } @@ -192,6 +193,13 @@ public: void * arg, traverse_order order); bool is_expensive_processor(uchar *arg); virtual bool is_expensive() { return 0; } + inline double fix_result(double value) + { + if (isfinite(value)) + return value; + null_value=1; + return 0.0; + } }; @@ -477,7 +485,7 @@ public: longlong int_op(); my_decimal *decimal_op(my_decimal *); const char *func_name() const { return "-"; } - virtual bool basic_const_item() const { return args[0]->basic_const_item(); } + enum Functype functype() const { return NEG_FUNC; } void fix_length_and_dec(); void fix_num_length_and_dec(); uint decimal_precision() const { return args[0]->decimal_precision(); } @@ -509,18 +517,6 @@ class Item_dec_func :public Item_real_func decimals=NOT_FIXED_DEC; max_length=float_length(decimals); maybe_null=1; } - inline double fix_result(double value) - { -#ifndef HAVE_FINITE - return value; -#else - /* The following should be safe, even if we compare doubles */ - if (finite(value) && value != POSTFIX_ERROR) - return value; - null_value=1; - return 0.0; -#endif - } }; class Item_func_exp :public Item_dec_func |