diff options
author | unknown <istruewing@stella.local> | 2008-03-14 12:02:11 +0100 |
---|---|---|
committer | unknown <istruewing@stella.local> | 2008-03-14 12:02:11 +0100 |
commit | e79249f81bbb7158fb263455e531bda4117b5fc9 (patch) | |
tree | b52789d6b0503cf1a56ee2fea977be99a7287207 /sql/item_func.h | |
parent | 28eb7e60d50795d110d4fe2d6477acdeb4c725d5 (diff) | |
parent | 269ebe54211cf96c4e64fa7268a1414588ca1de8 (diff) | |
download | mariadb-git-e79249f81bbb7158fb263455e531bda4117b5fc9.tar.gz |
Manual merge
configure.in:
Auto merged
mysql-test/r/func_misc.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/r/partition.result:
Auto merged
mysql-test/r/partition_symlink.result:
Auto merged
mysql-test/t/func_misc.test:
Auto merged
mysql-test/t/partition.test:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/partition_info.cc:
Auto merged
sql/partition_info.h:
Auto merged
sql/rpl_rli.cc:
Auto merged
sql/sql_plugin.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_parse.cc:
Manual merge. Needs later fix. New code in create table was not
accepted. Needs to be added to mysql_create_table_no_lock().
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 4f86337e390..0c5de8698c6 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; + } }; @@ -479,7 +487,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(); } @@ -511,18 +519,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 |