List:Commits« Previous MessageNext Message »
From:holyfoot Date:November 1 2006 11:41am
Subject:bk commit into 5.0 tree (holyfoot:1.2290)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of hf. When hf 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, 2006-11-01 15:41:51+04:00, holyfoot@stripped +5 -0
  Merge mysql.com:/home/hf/work/19491/my50-19491
  into  mysql.com:/home/hf/work/mysql-5.0.19491
  MERGE: 1.2244.38.2

  sql/field.cc@stripped, 2006-11-01 15:41:45+04:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.322.1.1

  sql/field.h@stripped, 2006-11-01 15:41:45+04:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.188.1.1

  sql/item.cc@stripped, 2006-11-01 15:41:46+04:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.232.2.1

  sql/item.h@stripped, 2006-11-01 15:41:46+04:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.206.2.1

  sql/item_timefunc.cc@stripped, 2006-11-01 15:41:46+04:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.124.1.1

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	holyfoot
# Host:	deer.(none)
# Root:	/home/hf/work/mysql-5.0.19491/RESYNC

--- 1.326/sql/field.cc	2006-11-01 15:41:58 +04:00
+++ 1.327/sql/field.cc	2006-11-01 15:41:58 +04:00
@@ -2425,6 +2425,13 @@ int Field_new_decimal::store_decimal(con
 }
 
 
+int Field_new_decimal::store_time(TIME *ltime, timestamp_type t_type)
+{
+    my_decimal decimal_value;
+    return store_value(date2my_decimal(ltime, &decimal_value));
+}
+
+
 double Field_new_decimal::val_real(void)
 {
   double dbl;

--- 1.189/sql/field.h	2006-11-01 15:41:58 +04:00
+++ 1.190/sql/field.h	2006-11-01 15:41:58 +04:00
@@ -489,6 +489,7 @@ public:
   int  store(const char *to, uint length, CHARSET_INFO *charset);
   int  store(double nr);
   int  store(longlong nr, bool unsigned_val);
+  int store_time(TIME *ltime, timestamp_type t_type);
   int  store_decimal(const my_decimal *);
   double val_real(void);
   longlong val_int(void);

--- 1.236/sql/item.cc	2006-11-01 15:41:58 +04:00
+++ 1.237/sql/item.cc	2006-11-01 15:41:59 +04:00
@@ -272,6 +272,34 @@ my_decimal *Item::val_decimal_from_strin
 }
 
 
+my_decimal *Item::val_decimal_from_date(my_decimal *decimal_value)
+{
+  DBUG_ASSERT(fixed == 1);
+  TIME ltime;
+  longlong date;
+  if (get_date(&ltime, TIME_FUZZY_DATE))
+  {
+    my_decimal_set_zero(decimal_value);
+    return 0;
+  }
+  return date2my_decimal(&ltime, decimal_value);
+}
+
+
+my_decimal *Item::val_decimal_from_time(my_decimal *decimal_value)
+{
+  DBUG_ASSERT(fixed == 1);
+  TIME ltime;
+  longlong date;
+  if (get_time(&ltime))
+  {
+    my_decimal_set_zero(decimal_value);
+    return 0;
+  }
+  return date2my_decimal(&ltime, decimal_value);
+}
+
+
 double Item::val_real_from_decimal()
 {
   /* Note that fix_fields may not be called for Item_avg_field items */
@@ -293,6 +321,25 @@ longlong Item::val_int_from_decimal()
     return 0;
   my_decimal2int(E_DEC_FATAL_ERROR, dec_val, unsigned_flag, &result);
   return result;
+}
+
+int Item::save_time_in_field(Field *field)
+{
+  TIME ltime;
+  if (get_time(&ltime))
+    return set_field_to_null(field);
+  field->set_notnull();
+  return field->store_time(&ltime, MYSQL_TIMESTAMP_TIME);
+}
+
+
+int Item::save_date_in_field(Field *field)
+{
+  TIME ltime;
+  if (get_date(&ltime, TIME_FUZZY_DATE))
+    return set_field_to_null(field);
+  field->set_notnull();
+  return field->store_time(&ltime, MYSQL_TIMESTAMP_DATETIME);
 }
 
 

--- 1.209/sql/item.h	2006-11-01 15:41:59 +04:00
+++ 1.210/sql/item.h	2006-11-01 15:41:59 +04:00
@@ -617,8 +617,13 @@ public:
   my_decimal *val_decimal_from_real(my_decimal *decimal_value);
   my_decimal *val_decimal_from_int(my_decimal *decimal_value);
   my_decimal *val_decimal_from_string(my_decimal *decimal_value);
+  my_decimal *val_decimal_from_date(my_decimal *decimal_value);
+  my_decimal *val_decimal_from_time(my_decimal *decimal_value);
   longlong val_int_from_decimal();
   double val_real_from_decimal();
+
+  int save_time_in_field(Field *field);
+  int save_date_in_field(Field *field);
 
   virtual Field *get_tmp_table_field() { return 0; }
   /* This is also used to create fields in CREATE ... SELECT: */

--- 1.126/sql/item_timefunc.cc	2006-11-01 15:41:59 +04:00
+++ 1.127/sql/item_timefunc.cc	2006-11-01 15:41:59 +04:00
@@ -1294,17 +1294,6 @@ String *Item_date::val_str(String *str)
 }
 
 
-int Item_date::save_in_field(Field *field, bool no_conversions)
-{
-  TIME ltime;
-  if (get_date(&ltime, TIME_FUZZY_DATE))
-    return set_field_to_null(field);
-  field->set_notnull();
-  field->store_time(&ltime, MYSQL_TIMESTAMP_DATE);
-  return 0;
-}
-
-
 longlong Item_date::val_int()
 {
   DBUG_ASSERT(fixed == 1);
Thread
bk commit into 5.0 tree (holyfoot:1.2290)holyfoot1 Nov