List:Commits« Previous MessageNext Message »
From:Jorgen Loland Date:April 13 2012 12:53pm
Subject:bzr push into mysql-trunk-jorgen branch (jorgen.loland:3828 to 3829)
View as plain text  
 3829 Jorgen Loland	2012-04-13
      Refactoring
       * review comments
       * added todo list
       * bar and martin now get commit/push emails

    added:
      TODO
    modified:
      .bzr-mysql/default.conf
      sql/field.cc
 3828 Jorgen Loland	2012-04-11
      Refactoring: change return type of Field::store() and friends
      from poorly defined int to enum.
            
      Rename type_covert_status to type_conversion_status
      Rename decimal_error_to_type_convert_status()
          to decimal_err_to_type_conv_status()

    modified:
      sql/field.cc
      sql/field.h
      sql/field_conv.cc
      sql/item.cc
      sql/item.h
      sql/item_func.cc
      sql/item_func.h
      sql/item_strfunc.h
      sql/item_timefunc.cc
      sql/item_timefunc.h
      sql/opt_range.cc
      sql/sql_select.h
      sql/unireg.cc
      unittest/gunit/field-t.cc
      unittest/gunit/item-t.cc
=== modified file '.bzr-mysql/default.conf'
--- a/.bzr-mysql/default.conf	2012-03-22 08:01:37 +0000
+++ b/.bzr-mysql/default.conf	2012-04-13 12:52:41 +0000
@@ -1,4 +1,4 @@
 [MYSQL]
-post_commit_to = "commits@stripped"
-post_push_to = "commits@stripped"
-tree_name = "mysql-trunk"
+post_commit_to = "commits@stripped,martin.hansson@stripped,alexander.barkov@stripped"
+post_push_to = "commits@stripped,martin.hansson@stripped,alexander.barkov@stripped"
+tree_name = "mysql-trunk-jorgen"

=== added file 'TODO'
--- a/TODO	1970-01-01 00:00:00 +0000
+++ b/TODO	2012-04-13 12:52:41 +0000
@@ -0,0 +1,33 @@
+A TODO to keep track of remaining tasks for Item::store() refactoring
+
+Things to do before refactoring can go into trunk
+=================================================
+
+Code:
+ - do the set_field_to_null() -> set_field_to_null_with_conversions()
+   change in a separate patch
+ - decision needed: shall TYPE_ERR_BAD_VALUE and TYPE_ERR_OOM be made a
+   single value? There is no special handling for those
+
+Tests:
+ - add a test for the new reset() in Item_hex_string::save_in_field()
+ - add a test for the TYPE_NOTE_TRUNCATED error returned if
+   check_string_copy_error() returns true
+ - Test more combinations of sql_modes? (Up for discussion)
+
+Other:
+ - remove Martin and Bar from default.conf
+ - remove todo file (this)
+
+Things that can or should wait until after refactoring is in trunk,
+but has been promised
+===================================================================
+ - Item::save() functions that take a no_conversions parameter should
+   call set_field_to_null_with_conversions(), not set_field_to_null().
+ - Refactor unit tests
+   - Reduce test lengths - smaller tests are better
+   - Investigate: Reuse classes in mock_field_datetime.h, mock_field_timestamp.h
+   - Investigate: Reuse fake_table.h
+   - Investigate: Call Field::store() directly instead of
+     Item::save_in_field()
+   - Comment every test, stating what it's supposed to test.

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2012-04-11 12:47:00 +0000
+++ b/sql/field.cc	2012-04-13 12:52:41 +0000
@@ -4915,7 +4915,8 @@ Field_temporal::store(const char *str, u
 
     const type_conversion_status tmp_error= store_internal_with_round(&ltime,
                                                            &status.warnings);
-    // @see type_conversion_status
+
+    // Return the most serious error of the two, @see type_conversion_status
     if (tmp_error > error)
       error= tmp_error;
   }
@@ -6619,7 +6620,7 @@ Field_string::store(const char *from,uin
   if (check_string_copy_error(well_formed_error_pos,
                               cannot_convert_error_pos, from_end_pos,
                               from + length, false, cs))
-    return TYPE_ERR_BAD_VALUE;
+    return TYPE_NOTE_TRUNCATED;
 
   return TYPE_OK;
 }

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-jorgen branch (jorgen.loland:3828 to 3829) Jorgen Loland13 Apr