diff options
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 6b0d1850d8c..0fc8f1a3d0c 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -237,8 +237,7 @@ public: } Field *tmp_table_field(TABLE *t_arg) { - if (!t_arg) return result_field; - return new Field_date(maybe_null, name, t_arg); + return (!t_arg) ? result_field : new Field_date(maybe_null, name, t_arg); } unsigned int size_of() { return sizeof(*this);} }; @@ -256,9 +255,9 @@ public: } Field *tmp_table_field(TABLE *t_arg) { - if (!t_arg) return result_field; - return new Field_datetime(maybe_null, name, t_arg); - } + return (!t_arg) ? result_field : new Field_datetime(maybe_null, name, + t_arg); + } unsigned int size_of() { return sizeof(*this);} }; @@ -284,8 +283,7 @@ public: } Field *tmp_table_field(TABLE *t_arg) { - if (!t_arg) return result_field; - return new Field_time(maybe_null, name, t_arg); + return (!t_arg) ? result_field : new Field_time(maybe_null, name, t_arg); } unsigned int size_of() { return sizeof(*this);} }; @@ -381,11 +379,11 @@ public: } Field *tmp_table_field(TABLE *t_arg) { - if (!t_arg) return result_field; - return new Field_time(maybe_null, name, t_arg); - } + return (!t_arg) ? result_field : new Field_time(maybe_null, name, t_arg); + } }; + enum interval_type { INTERVAL_YEAR, INTERVAL_MONTH, INTERVAL_DAY, INTERVAL_HOUR, INTERVAL_MINUTE, INTERVAL_SECOND, INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR, @@ -447,8 +445,7 @@ public: } Field *tmp_table_field(TABLE *t_arg) { - if (!t_arg) return result_field; - return new Field_date(maybe_null, name, t_arg); + return (!t_arg) ? result_field : new Field_date(maybe_null, name, t_arg); } }; @@ -463,9 +460,8 @@ public: } Field *tmp_table_field(TABLE *t_arg) { - if (!t_arg) return result_field; - return new Field_time(maybe_null, name, t_arg); - } + return (!t_arg) ? result_field : new Field_time(maybe_null, name, t_arg); + } }; class Item_datetime_typecast :public Item_typecast @@ -479,7 +475,7 @@ public: } Field *tmp_table_field(TABLE *t_arg) { - if (!t_arg) return result_field; - return new Field_datetime(maybe_null, name, t_arg); - } + return (!t_arg) ? result_field : new Field_datetime(maybe_null, name, + t_arg); + } }; |