List:Commits« Previous MessageNext Message »
From:Sergey Petrunia Date:January 24 2006 12:34pm
Subject:bk commit into 5.1 tree (sergefp:1.2073)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of psergey. When psergey 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.2073 06/01/24 15:34:02 sergefp@stripped +4 -0
  Merge spetrunia@stripped:/home/bk/mysql-5.1-new
  into  mysql.com:/home/psergey/mysql-5.1-ppruning-r5-push

  sql/sql_class.cc
    1.241 06/01/24 15:33:58 sergefp@stripped +0 -0
    Auto merged

  sql/mysqld.cc
    1.524 06/01/24 15:33:58 sergefp@stripped +0 -0
    Auto merged

  sql/item_timefunc.cc
    1.104 06/01/24 15:33:57 sergefp@stripped +0 -0
    Auto merged

  mysql-test/r/binlog_row_ctype_cp932.result
    1.3 06/01/24 15:33:57 sergefp@stripped +0 -1
    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:	sergefp
# Host:	pylon.mylan
# Root:	/home/psergey/mysql-5.1-ppruning-r5-push/RESYNC

--- 1.103/sql/item_timefunc.cc	2005-12-27 15:04:27 +03:00
+++ 1.104/sql/item_timefunc.cc	2006-01-24 15:33:57 +03:00
@@ -1165,7 +1165,7 @@
   To make code easy, allow interval objects without separators.
 */
 
-static bool get_interval_value(Item *args,interval_type int_type,
+bool get_interval_value(Item *args,interval_type int_type,
 			       String *str_value, INTERVAL *interval)
 {
   ulonglong array[5];
@@ -2024,110 +2024,15 @@
   long period,sign;
   INTERVAL interval;
 
-  ltime->neg= 0;
   if (args[0]->get_date(ltime, TIME_NO_ZERO_DATE) ||
       get_interval_value(args[1],int_type,&value,&interval))
     goto null_date;
-  sign= (interval.neg ? -1 : 1);
+
   if (date_sub_interval)
-    sign = -sign;
+    interval.neg = !interval.neg;
 
-  null_value=0;
-  switch (int_type) {
-  case INTERVAL_SECOND:
-  case INTERVAL_SECOND_MICROSECOND:
-  case INTERVAL_MICROSECOND:
-  case INTERVAL_MINUTE:
-  case INTERVAL_HOUR:
-  case INTERVAL_MINUTE_MICROSECOND:
-  case INTERVAL_MINUTE_SECOND:
-  case INTERVAL_HOUR_MICROSECOND:
-  case INTERVAL_HOUR_SECOND:
-  case INTERVAL_HOUR_MINUTE:
-  case INTERVAL_DAY_MICROSECOND:
-  case INTERVAL_DAY_SECOND:
-  case INTERVAL_DAY_MINUTE:
-  case INTERVAL_DAY_HOUR:
-  {
-    longlong sec, days, daynr, microseconds, extra_sec;
-    ltime->time_type= MYSQL_TIMESTAMP_DATETIME; // Return full date
-    microseconds= ltime->second_part + sign*interval.second_part;
-    extra_sec= microseconds/1000000L;
-    microseconds= microseconds%1000000L;
-
-    sec=((ltime->day-1)*3600*24L+ltime->hour*3600+ltime->minute*60+
-	 ltime->second +
-	 sign* (longlong) (interval.day*3600*24L +
-                           interval.hour*LL(3600)+interval.minute*LL(60)+
-                           interval.second))+ extra_sec;
-    if (microseconds < 0)
-    {
-      microseconds+= LL(1000000);
-      sec--;
-    }
-    days= sec/(3600*LL(24));
-    sec-= days*3600*LL(24);
-    if (sec < 0)
-    {
-      days--;
-      sec+= 3600*LL(24);
-    }
-    ltime->second_part= (uint) microseconds;
-    ltime->second= (uint) (sec % 60);
-    ltime->minute= (uint) (sec/60 % 60);
-    ltime->hour=   (uint) (sec/3600);
-    daynr= calc_daynr(ltime->year,ltime->month,1) + days;
-    /* Day number from year 0 to 9999-12-31 */
-    if ((ulonglong) daynr >= MAX_DAY_NUMBER)
-      goto invalid_date;
-    get_date_from_daynr((long) daynr, &ltime->year, &ltime->month,
-                        &ltime->day);
-    break;
-  }
-  case INTERVAL_DAY:
-  case INTERVAL_WEEK:
-    period= (calc_daynr(ltime->year,ltime->month,ltime->day) +
-             sign * (long) interval.day);
-    /* Daynumber from year 0 to 9999-12-31 */
-    if ((ulong) period >= MAX_DAY_NUMBER)
-      goto invalid_date;
-    get_date_from_daynr((long) period,&ltime->year,&ltime->month,&ltime->day);
-    break;
-  case INTERVAL_YEAR:
-    ltime->year+= sign * (long) interval.year;
-    if ((ulong) ltime->year >= 10000L)
-      goto invalid_date;
-    if (ltime->month == 2 && ltime->day == 29 &&
-	calc_days_in_year(ltime->year) != 366)
-      ltime->day=28;				// Was leap-year
-    break;
-  case INTERVAL_YEAR_MONTH:
-  case INTERVAL_QUARTER:
-  case INTERVAL_MONTH:
-    period= (ltime->year*12 + sign * (long) interval.year*12 +
-	     ltime->month-1 + sign * (long) interval.month);
-    if ((ulong) period >= 120000L)
-      goto invalid_date;
-    ltime->year= (uint) (period / 12);
-    ltime->month= (uint) (period % 12L)+1;
-    /* Adjust day if the new month doesn't have enough days */
-    if (ltime->day > days_in_month[ltime->month-1])
-    {
-      ltime->day = days_in_month[ltime->month-1];
-      if (ltime->month == 2 && calc_days_in_year(ltime->year) == 366)
-	ltime->day++;				// Leap-year
-    }
-    break;
-  default:
-    goto null_date;
-  }
-  return 0;					// Ok
+  return (null_value= date_add_interval(ltime, int_type, interval));
 
-invalid_date:
-  push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
-                      ER_DATETIME_FUNCTION_OVERFLOW,
-                      ER(ER_DATETIME_FUNCTION_OVERFLOW),
-                      "datetime");
  null_date:
   return (null_value=1);
 }

--- 1.523/sql/mysqld.cc	2006-01-20 16:26:30 +03:00
+++ 1.524/sql/mysqld.cc	2006-01-24 15:33:58 +03:00
@@ -2497,9 +2497,7 @@
     {
       NET *net= &thd->net;
       net->report_error= 1;
-#ifndef EMBEDDED_LIBRARY  /* TODO query cache in embedded library*/
       query_cache_abort(net);
-#endif
       if (!net->last_error[0])			// Return only first message
       {
 	strmake(net->last_error, str, sizeof(net->last_error)-1);

--- 1.240/sql/sql_class.cc	2006-01-20 18:12:41 +03:00
+++ 1.241/sql/sql_class.cc	2006-01-24 15:33:58 +03:00
@@ -988,7 +988,9 @@
   thd->sent_row_count++;
   if (!thd->vio_ok())
     DBUG_RETURN(0);
-  if (!thd->net.report_error)
+  if (thd->net.report_error)
+    protocol->remove_last_row();
+  else
     DBUG_RETURN(protocol->write());
   DBUG_RETURN(1);
 }
@@ -2039,10 +2041,8 @@
   cuted_fields= 0;
   transaction.savepoints= 0;
 
-#ifndef EMBEDDED_LIBRARY
   /* Surpress OK packets in case if we will execute statements */
   net.no_send_ok= TRUE;
-#endif
 }
 
 
Thread
bk commit into 5.1 tree (sergefp:1.2073)Sergey Petrunia24 Jan