List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:March 10 2006 2:22pm
Subject:bk commit into 5.1 tree (aelkin:1.2169)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of elkin. When elkin 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.2169 06/03/10 16:22:13 aelkin@stripped +3 -0
  Merge mysql.com:/usr_rh9/home/elkin.rh9/MySQL/FIXES/5.0.20-bug15101-sysdate
  into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/5.1

  sql/mysqld.cc
    1.544 06/03/10 16:22:07 aelkin@stripped +1 -1
    #BUG15101 manual merge

  sql/sql_yacc.yy
    1.476 06/03/10 16:14:30 aelkin@stripped +0 -0
    Auto merged

  sql/sql_class.h
    1.288 06/03/10 16:14:30 aelkin@stripped +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:	aelkin
# Host:	dsl-hkigw8-feb0de00-199.dhcp.inet.fi
# Root:	/usr_rh9/home/elkin.rh9/MySQL/Merge/5.1/RESYNC

--- 1.543/sql/mysqld.cc	2006-03-10 03:05:56 +02:00
+++ 1.544/sql/mysqld.cc	2006-03-10 16:22:07 +02:00
@@ -4813,6 +4813,7 @@
   OPT_TABLE_LOCK_WAIT_TIMEOUT,
   OPT_PLUGIN_DIR,
   OPT_LOG_OUTPUT,
+  OPT_SYSDATE_IS_NOW,
   OPT_PORT_OPEN_TIMEOUT
 };
 
@@ -6291,6 +6292,10 @@
    (gptr*) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
    REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT),
    0, 1, 0},
+  {"sysdate-is-now", OPT_SYSDATE_IS_NOW,
+   "Non-default flag to alias SYSDATE() to NOW() to be safe-replicatable. Since 5.0 SYSDATE returns a `dynamic' value different for different invocation even within a query",
+   (gptr*) &global_system_variables.sysdate_is_now,
+   0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 

--- 1.287/sql/sql_class.h	2006-03-08 07:55:11 +02:00
+++ 1.288/sql/sql_class.h	2006-03-10 16:14:30 +02:00
@@ -276,6 +276,7 @@
   DATE_TIME_FORMAT *date_format;
   DATE_TIME_FORMAT *datetime_format;
   DATE_TIME_FORMAT *time_format;
+  my_bool sysdate_is_now;
 };
 
 

--- 1.475/sql/sql_yacc.yy	2006-03-09 19:41:18 +02:00
+++ 1.476/sql/sql_yacc.yy	2006-03-10 16:14:30 +02:00
@@ -6342,9 +6342,19 @@
 	| SUBSTRING_INDEX '(' expr ',' expr ',' expr ')'
 	  { $$= new Item_func_substr_index($3,$5,$7); }
 	| SYSDATE optional_braces
-	  { $$= new Item_func_sysdate_local(); Lex->safe_to_cache_query=0;}
+          {
+            if (global_system_variables.sysdate_is_now == 0)
+              $$= new Item_func_sysdate_local();
+            else $$= new Item_func_now_local();
+            Lex->safe_to_cache_query=0;
+          }
 	| SYSDATE '(' expr ')'
-	  { $$= new Item_func_sysdate_local($3); Lex->safe_to_cache_query=0;}
+          {
+            if (global_system_variables.sysdate_is_now == 0)
+              $$= new Item_func_sysdate_local($3);
+            else $$= new Item_func_now_local($3);
+            Lex->safe_to_cache_query=0;
+          }
 	| TIME_SYM '(' expr ')'
 	  { $$= new Item_time_typecast($3); }
 	| TIMESTAMP '(' expr ')'
Thread
bk commit into 5.1 tree (aelkin:1.2169)Andrei Elkin10 Mar