List:Commits« Previous MessageNext Message »
From:kgeorge Date:December 18 2007 5:01pm
Subject:bk commit into 5.0 tree (gkodinov:1.2591) BUG#33256
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-12-18 18:01:36+02:00, gkodinov@stripped +6 -0
  Bug #33256: CREATE ... SELECT creates obsolete table 
   w/ Field_date instead of Field_newdate
  
  Field_date was still used in temp table creation.
  Fixed by using Field_newdate consistently throughout the server
  except when reading tables defined with older MySQL version.
  No test suite is possible because both Field_date and Field_newdate
  return the same values in all the metadata calls. 

  mysql-test/r/type_decimal.result@stripped, 2007-12-18 18:01:35+02:00, gkodinov@stripped +0
-4
    Bug #33256: removed redundant warnings

  sql/field.h@stripped, 2007-12-18 18:01:35+02:00, gkodinov@stripped +4 -0
    Bug #33256: Add a constructor similar to 
    Field_date::Field_date()

  sql/item.cc@stripped, 2007-12-18 18:01:35+02:00, gkodinov@stripped +1 -1
    Bug #33256: Use Field_newdate instead of Field_date
    for all temp tables and CREATE .. SELECT

  sql/item_sum.cc@stripped, 2007-12-18 18:01:35+02:00, gkodinov@stripped +1 -1
    Bug #33256: Use Field_newdate instead of Field_date
    for all temp tables and CREATE .. SELECT

  sql/item_timefunc.cc@stripped, 2007-12-18 18:01:35+02:00, gkodinov@stripped +1 -1
    Bug #33256: Use Field_newdate instead of Field_date
    for all temp tables and CREATE .. SELECT

  sql/item_timefunc.h@stripped, 2007-12-18 18:01:35+02:00, gkodinov@stripped +3 -3
    Bug #33256: Use Field_newdate instead of Field_date
    for all temp tables and CREATE .. SELECT

diff -Nrup a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result
--- a/mysql-test/r/type_decimal.result	2007-10-29 13:39:54 +02:00
+++ b/mysql-test/r/type_decimal.result	2007-12-18 18:01:35 +02:00
@@ -786,10 +786,6 @@ from (select 1 as s,'t' as t union selec
 select group_concat(t) from t1 group by week(date)/10;
 group_concat(t)
 t
-Warnings:
-Warning	1292	Truncated incorrect datetime value: '0000-00-00'
-Warning	1292	Truncated incorrect datetime value: '0000-00-00'
-Warning	1292	Truncated incorrect datetime value: '0000-00-00'
 drop table t1;
 CREATE TABLE t1 (
 qty decimal(16,6) default NULL, 
diff -Nrup a/sql/field.h b/sql/field.h
--- a/sql/field.h	2007-11-17 14:42:36 +02:00
+++ b/sql/field.h	2007-12-18 18:01:35 +02:00
@@ -951,6 +951,10 @@ public:
     :Field_str(ptr_arg, 10, null_ptr_arg, null_bit_arg,
 	       unireg_check_arg, field_name_arg, table_arg, cs)
     {}
+  Field_newdate(bool maybe_null_arg, const char *field_name_arg,
+                struct st_table *table_arg, CHARSET_INFO *cs)
+    :Field_str((char*) 0,10, maybe_null_arg ? (uchar*) "": 0,0,
+               NONE, field_name_arg, table_arg, cs) {}
   enum_field_types type() const { return FIELD_TYPE_DATE;}
   enum_field_types real_type() const { return FIELD_TYPE_NEWDATE; }
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_UINT24; }
diff -Nrup a/sql/item.cc b/sql/item.cc
--- a/sql/item.cc	2007-12-13 12:49:11 +02:00
+++ b/sql/item.cc	2007-12-18 18:01:35 +02:00
@@ -4384,7 +4384,7 @@ Field *Item::tmp_table_field_from_field_
 			    name, table, 0, unsigned_flag);
   case MYSQL_TYPE_NEWDATE:
   case MYSQL_TYPE_DATE:
-    return new Field_date(maybe_null, name, table, &my_charset_bin);
+    return new Field_newdate(maybe_null, name, table, &my_charset_bin);
   case MYSQL_TYPE_TIME:
     return new Field_time(maybe_null, name, table, &my_charset_bin);
   case MYSQL_TYPE_TIMESTAMP:
diff -Nrup a/sql/item_sum.cc b/sql/item_sum.cc
--- a/sql/item_sum.cc	2007-12-15 13:00:52 +02:00
+++ b/sql/item_sum.cc	2007-12-18 18:01:35 +02:00
@@ -628,7 +628,7 @@ Field *Item_sum_hybrid::create_tmp_field
   */
   switch (args[0]->field_type()) {
   case MYSQL_TYPE_DATE:
-    return new Field_date(maybe_null, name, table, collation.collation);
+    return new Field_newdate(maybe_null, name, table, collation.collation);
   case MYSQL_TYPE_TIME:
     return new Field_time(maybe_null, name, table, collation.collation);
   case MYSQL_TYPE_TIMESTAMP:
diff -Nrup a/sql/item_timefunc.cc b/sql/item_timefunc.cc
--- a/sql/item_timefunc.cc	2007-12-17 08:53:30 +02:00
+++ b/sql/item_timefunc.cc	2007-12-18 18:01:35 +02:00
@@ -3303,7 +3303,7 @@ Field *Item_func_str_to_date::tmp_table_
   if (cached_field_type == MYSQL_TYPE_TIME)
     return (new Field_time(maybe_null, name, t_arg, &my_charset_bin));
   if (cached_field_type == MYSQL_TYPE_DATE)
-    return (new Field_date(maybe_null, name, t_arg, &my_charset_bin));
+    return (new Field_newdate(maybe_null, name, t_arg, &my_charset_bin));
   if (cached_field_type == MYSQL_TYPE_DATETIME)
     return (new Field_datetime(maybe_null, name, t_arg, &my_charset_bin));
   return (new Field_string(max_length, maybe_null, name, t_arg, &my_charset_bin));
diff -Nrup a/sql/item_timefunc.h b/sql/item_timefunc.h
--- a/sql/item_timefunc.h	2007-11-08 07:08:43 +02:00
+++ b/sql/item_timefunc.h	2007-12-18 18:01:35 +02:00
@@ -340,7 +340,7 @@ public:
   }
   Field *tmp_table_field(TABLE *t_arg)
   {
-    return (new Field_date(maybe_null, name, t_arg, &my_charset_bin));
+    return (new Field_newdate(maybe_null, name, t_arg, &my_charset_bin));
   }  
   bool result_as_longlong() { return TRUE; }
   my_decimal *val_decimal(my_decimal *decimal_value)
@@ -784,7 +784,7 @@ public:
   enum_field_types field_type() const { return MYSQL_TYPE_DATE; }
   Field *tmp_table_field(TABLE *t_arg)
   {
-    return (new Field_date(maybe_null, name, t_arg, &my_charset_bin));
+    return (new Field_newdate(maybe_null, name, t_arg, &my_charset_bin));
   }  
   void fix_length_and_dec()
   {
@@ -884,7 +884,7 @@ public:
   }
   Field *tmp_table_field(TABLE *t_arg)
   {
-    return (new Field_date(maybe_null, name, t_arg, &my_charset_bin));
+    return (new Field_newdate(maybe_null, name, t_arg, &my_charset_bin));
   }
   longlong val_int();
   my_decimal *val_decimal(my_decimal *decimal_value)
Thread
bk commit into 5.0 tree (gkodinov:1.2591) BUG#33256kgeorge18 Dec
  • Re: bk commit into 5.0 tree (gkodinov:1.2591) BUG#33256Sergei Golubchik19 Dec
    • Re: bk commit into 5.0 tree (gkodinov:1.2591) BUG#33256Georgi Kodinov21 Dec
      • Re: bk commit into 5.0 tree (gkodinov:1.2591) BUG#33256Sergei Golubchik21 Dec