From 2c4fa340cccbf11dc7b7f944cf7ca30af48edf4f Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Thu, 8 Aug 2002 03:12:02 +0300 Subject: Lots of code fixes to the replication code (especially the binary logging and index log file handling) Fixed bugs in my last changeset that made MySQL hard to compile. Added mutex around some data that could cause table cache corruptions when using OPTIMIZE TABLE / REPAIR TABLE or automatic repair of MyISAM tables. Added mutex around some data in the slave start/stop code that could cause THD linked list corruptions Extended my_chsize() to allow one to specify a filler character. Extend vio_blocking to return the old state (This made some usage of this function much simpler) Added testing for some functions that they caller have got the required mutexes before calling the function. Use setrlimit() to ensure that we can write core file if one specifies --core-file. Added --slave-compressed-protocol Made 2 the minimum length for ft_min_word_len Added variables foreign_key_checks & unique_checks. Less logging from replication code (if not started with --log-warnings) Changed that SHOW INNODB STATUS requre the SUPER privilege More DBUG statements and a lot of new code comments --- sql/item_timefunc.h | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'sql/item_timefunc.h') 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); + } }; -- cgit v1.2.1