List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:April 14 2006 5:38pm
Subject:bk commit into 5.1 tree (cmiller:1.2351)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of cmiller. When cmiller 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
  1.2351 06/04/14 11:38:09 cmiller@zippy.(none) +3 -0
  Merge zippy.(none):/home/cmiller/work/mysql/merge/tmp_merge
  into  zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.1-new
  
  (With hand-merged tests.)

  sql/sql_insert.cc
    1.197 06/04/14 11:35:29 cmiller@zippy.(none) +0 -0
    Auto merged

  sql/item_timefunc.h
    1.67 06/04/14 11:35:29 cmiller@zippy.(none) +0 -0
    Auto merged

  sql/item_timefunc.cc
    1.111 06/04/14 11:35:29 cmiller@zippy.(none) +0 -0
    Auto merged

# 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:	cmiller
# Host:	zippy.(none)
# Root:	/home/cmiller/work/mysql/merge/mysql-5.1-new/RESYNC

--- 1.110/sql/item_timefunc.cc	2006-04-07 06:29:28 -04:00
+++ 1.111/sql/item_timefunc.cc	2006-04-14 11:35:29 -04:00
@@ -2002,6 +2002,41 @@
     ((date*100L + ltime.hour)*100L+ ltime.minute)*100L + ltime.second;
 }
 
+
+
+bool Item_date_add_interval::eq(const Item *item, bool binary_cmp) const
+{
+  INTERVAL interval, other_interval;
+  String val= value;   // Because of const
+
+  if (this == item)
+    return TRUE;
+
+  if ((item->type() != FUNC_ITEM) ||
+      (arg_count != ((Item_func*) item)->arg_count) ||
+      (func_name() != ((Item_func*) item)->func_name()))
+    return FALSE;
+
+  Item_date_add_interval *other= (Item_date_add_interval*) item;
+
+  if ((int_type != other->int_type) ||
+      (!args[0]->eq(other->args[0], binary_cmp)) ||
+      (get_interval_value(args[1], int_type, &val, &interval)))
+    return FALSE;
+
+  val= other->value;
+
+  if ((get_interval_value(other->args[1], other->int_type, &val,
+                         &other_interval)) ||
+      ((date_sub_interval ^ interval.neg) ^
+       (other->date_sub_interval ^ other_interval.neg)))
+    return FALSE;
+
+  // Assume comparing same types here due to earlier check
+  return memcmp(&interval, &other_interval, sizeof(INTERVAL)) == 0;
+}
+
+
 static const char *interval_names[]=
 {
   "year", "quarter", "month", "day", "hour",

--- 1.66/sql/item_timefunc.h	2006-01-18 14:41:04 -05:00
+++ 1.67/sql/item_timefunc.h	2006-04-14 11:35:29 -04:00
@@ -647,6 +647,7 @@
   double val_real() { DBUG_ASSERT(fixed == 1); return (double) val_int(); }
   longlong val_int();
   bool get_date(TIME *res, uint fuzzy_date);
+  bool eq(const Item *item, bool binary_cmp) const;
   void print(String *str);
 };
 
Thread
bk commit into 5.1 tree (cmiller:1.2351)Chad MILLER14 Apr