List:Commits« Previous MessageNext Message »
From:Dmitry Shulga Date:October 19 2012 12:34pm
Subject:bzr push into mysql-trunk branch (Dmitry.Shulga:4184 to 4185) WL#6030
View as plain text  
 4185 Dmitry Shulga	2012-10-19
      Follow-up for WL#6030 that fixes dead lines of sorce code
      discovered by test coverage.

    modified:
      sql/field.cc
      sql/field.h
      sql/sql_base.cc
 4184 Dmitry Shulga	2012-10-18
      WL#6030

    modified:
      mysql-test/r/insert_select.result
      mysql-test/r/key.result
      mysql-test/r/null.result
      mysql-test/r/warnings.result
      mysql-test/suite/funcs_1/r/innodb_trig_09.result
      mysql-test/suite/funcs_1/r/memory_trig_09.result
      mysql-test/suite/funcs_1/r/myisam_trig_09.result
      sql/field.cc
      sql/field.h
      sql/field_conv.cc
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster_cond.h
      sql/item.cc
      sql/item.h
      sql/item_cmpfunc.cc
      sql/item_func.h
      sql/item_sum.cc
      sql/opt_range.cc
      sql/partition_info.cc
      sql/rpl_record.cc
      sql/rpl_record_old.cc
      sql/sp.cc
      sql/sql_base.cc
      sql/sql_base.h
      sql/sql_executor.cc
      sql/sql_handler.cc
      sql/sql_insert.cc
      sql/sql_insert.h
      sql/sql_load.cc
      sql/sql_tmp_table.cc
      sql/sql_trigger.cc
      sql/sql_trigger.h
      sql/sql_union.cc
      sql/sql_update.cc
      sql/table.cc
      sql/table.h
      sql/unireg.cc
      tests/mysql_client_test.c
      unittest/gunit/field_date-t.cc
      unittest/gunit/field_datetime-t.cc
      unittest/gunit/field_long-t.cc
      unittest/gunit/field_newdecimal-t.cc
      unittest/gunit/mock_field_timestamp.h
      unittest/gunit/mock_field_timestampf.h
=== modified file 'sql/field.cc'
--- a/sql/field.cc	2012-10-18 14:55:03 +0000
+++ b/sql/field.cc	2012-10-19 12:33:26 +0000
@@ -1416,12 +1416,12 @@ type_conversion_status Field::check_cons
     return TYPE_OK;
 
   /*
-    If the field is of TIMESTAMP its default value is CURRENT_TIMESTAMP,
-    so we're OK.
+    If the field is of TIMESTAMP its default value is CURRENT_TIMESTAMP
+    and was set before calling this method. Therefore m_is_tmp_null == false
+    for such field and we leave check_constraints() before this
+    DBUG_ASSERT is fired.
   */
-
-  if (type() == MYSQL_TYPE_TIMESTAMP)
-    return TYPE_OK;
+  DBUG_ASSERT (type() != MYSQL_TYPE_TIMESTAMP);
 
   switch (m_count_cuted_fields_saved) {
   case CHECK_FIELD_WARN:
@@ -10617,8 +10617,6 @@ bool Field::set_warning(Sql_condition::e
 
   if (code == ER_BAD_NULL_ERROR)
     current_warning_mask= BAD_NULL_ERROR_PUSHED;
-  else if (code == ER_WARN_NULL_TO_NOTNULL)
-    current_warning_mask= WARN_NULL_TO_NOTNULL_PUSHED;
   else if (code == ER_NO_DEFAULT_FOR_FIELD)
     current_warning_mask= NO_DEFAULT_FOR_FIELD_PUSHED;
 

=== modified file 'sql/field.h'
--- a/sql/field.h	2012-10-18 14:55:03 +0000
+++ b/sql/field.h	2012-10-19 12:33:26 +0000
@@ -571,9 +571,8 @@ private:
   enum enum_pushed_warnings
   {
     BAD_NULL_ERROR_PUSHED= 1,
-    WARN_NULL_TO_NOTNULL_PUSHED= 2,
-    NO_DEFAULT_FOR_FIELD_PUSHED= 4,
-    NO_DEFAULT_FOR_VIEW_FIELD_PUSHED= 8
+    NO_DEFAULT_FOR_FIELD_PUSHED= 2,
+    NO_DEFAULT_FOR_VIEW_FIELD_PUSHED= 4
   };
 
   /*

=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2012-10-18 14:55:03 +0000
+++ b/sql/sql_base.cc	2012-10-19 12:33:26 +0000
@@ -8962,6 +8962,10 @@ static bool check_record(THD *thd, Field
 inline bool command_invokes_insert_triggers(enum trg_event_type event,
                                             enum_sql_command sql_command)
 {
+  /*
+    If it's 'INSERT INTO ... ON DUPLICATE KEY UPDATE ...' statement
+    the event is TRG_EVENT_UPDATE and the SQL-command is SQLCOM_INSERT.
+  */
   return event == TRG_EVENT_INSERT &&
         (sql_command == SQLCOM_INSERT ||
          sql_command == SQLCOM_INSERT_SELECT ||
@@ -9184,11 +9188,6 @@ fill_record_n_invoke_before_triggers(THD
 {
   bool rc;
 
-  /*
-    If it's 'INSERT INTO ... ON DUPLICATE KEY UPDATE ...' statement
-    the event is TRG_EVENT_UPDATE and the SQL-command is SQLCOM_INSERT.
-  */
-
   if (triggers)
   {
     triggers->enable_fields_temporary_nullability(thd);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (Dmitry.Shulga:4184 to 4185) WL#6030Dmitry Shulga22 Oct