diff options
-rw-r--r-- | sql/item_timefunc.cc | 2 | ||||
-rw-r--r-- | sql/sql_class.h | 3 | ||||
-rw-r--r-- | sql/sql_error.cc | 2 | ||||
-rw-r--r-- | sql/sql_table.cc | 8 |
4 files changed, 9 insertions, 6 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 1ea20e9d7cc..85ba3bfd0e4 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2199,7 +2199,7 @@ String *Item_char_typecast::val_str(String *str) push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_TRUNCATED_WRONG_VALUE, ER(ER_TRUNCATED_WRONG_VALUE), char_type, - res->c_ptr()); + res->c_ptr_safe()); res->length((uint) length); } null_value= 0; diff --git a/sql/sql_class.h b/sql/sql_class.h index e712af19a5c..517bf92abff 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1410,7 +1410,8 @@ public: inline void send_kill_message() const { int err= killed_errno(); - my_message(err, ER(err), MYF(0)); + if (err) + my_message(err, ER(err), MYF(0)); } /* return TRUE if we will abort query if we make a warning now */ inline bool really_abort_on_warning() diff --git a/sql/sql_error.cc b/sql/sql_error.cc index c1e1afa9eeb..04fd27abef5 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -133,7 +133,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, thd->spcont= spcont; thd->no_warnings_for_error= no_warnings_for_error; - /* Store error in error list (as my_message() didn't do it in this case */ + /* Store error in error list (as my_message() didn't do it) */ level= MYSQL_ERROR::WARN_LEVEL_ERROR; } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 49ecd2591dd..4b40ff7638c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3740,9 +3740,11 @@ copy_data_between_tables(TABLE *from,TABLE *to, goto err; }; - /* Handler must be told explicitly to retrieve all columns, because - this function does not set field->query_id in the columns to the - current query id */ + /* + Handler must be told explicitly to retrieve all columns, because + this function does not set field->query_id in the columns to the + current query id + */ from->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1,1); if (ignore || |