List:Commits« Previous MessageNext Message »
From:ahristov Date:February 20 2006 11:01pm
Subject:bk commit into 5.1 tree (andrey:1.2146)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey 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.2146 06/02/21 00:01:39 andrey@lmy004. +4 -0
  manual merge

  sql/event_timed.cc
    1.35 06/02/21 00:01:32 andrey@lmy004. +2 -3
    manual merge

  sql/sql_show.cc
    1.309 06/02/20 23:54:50 andrey@lmy004. +0 -0
    Auto merged

  sql/event.h
    1.23 06/02/20 23:54:50 andrey@lmy004. +0 -1
    Auto merged

  sql/event.cc
    1.31 06/02/20 23:54:50 andrey@lmy004. +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:	andrey
# Host:	lmy004.
# Root:	/work/mysql-5.1-bug16407/RESYNC

--- 1.308/sql/sql_show.cc	2006-02-17 20:06:00 +01:00
+++ 1.309/sql/sql_show.cc	2006-02-20 23:54:50 +01:00
@@ -3954,8 +3954,16 @@ fill_events_copy_to_schema_table(THD *th
   sch_table->field[3]->store(et.definer.str, et.definer.length, scs);
   sch_table->field[4]->store(et.body.str, et.body.length, scs);
 
-  // [9] is SQL_MODE and is NULL for now, will be fixed later
-  sch_table->field[9]->set_null();
+  // [9] is SQL_MODE 
+  {
+    const char *sql_mode_str="";
+    ulong sql_mode_len=0;
+    sql_mode_str=
+           sys_var_thd_sql_mode::symbolic_mode_representation(thd, et.sql_mode,
+                                                              &sql_mode_len);  
+    sch_table->field[9]->store((const char*)sql_mode_str, sql_mode_len, scs);
+  }
+  
   if (et.expression)
   {
     String show_str;
@@ -4802,7 +4810,7 @@ ST_FIELD_INFO events_fields_info[]=
   {"EXECUTE_AT", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Execute at"},
   {"INTERVAL_VALUE", 256, MYSQL_TYPE_STRING, 0, 1, "Interval value"},
   {"INTERVAL_FIELD", 18, MYSQL_TYPE_STRING, 0, 1, "Interval field"},
-  {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 1, 0},
+  {"SQL_MODE", 65535, MYSQL_TYPE_STRING, 0, 0, 0},
   {"STARTS", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Starts"},
   {"ENDS", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Ends"},
   {"STATUS", 8, MYSQL_TYPE_STRING, 0, 0, "Status"},

--- 1.30/sql/event.cc	2006-02-16 13:11:06 +01:00
+++ 1.31/sql/event.cc	2006-02-20 23:54:50 +01:00
@@ -623,10 +623,18 @@ evex_fill_row(THD *thd, TABLE *table, ev
 
   table->field[EVEX_FIELD_STATUS]->store((longlong)et->status);
 
+  /*
+    Change the SQL_MODE only if body was present in an ALTER EVENT and of course
+    always during CREATE EVENT.
+  */ 
   if (et->body.str)
+  {
+    table->field[EVEX_FIELD_SQL_MODE]->store((longlong)thd->variables.sql_mode);
+
     if (table->field[field_num= EVEX_FIELD_BODY]->
                      store(et->body.str, et->body.length, system_charset_info))
       goto trunc_err;
+  }
 
   if (et->starts.year)
   {

--- 1.22/sql/event.h	2006-02-16 05:20:55 +01:00
+++ 1.23/sql/event.h	2006-02-20 23:54:50 +01:00
@@ -112,7 +112,6 @@ public:
   enum enum_event_status status;
   sp_head *sphead;
   ulong sql_mode;
-
   const uchar *body_begin;
 
   bool dropped;

--- 1.34/sql/event_timed.cc	2006-02-16 16:10:54 +01:00
+++ 1.35/sql/event_timed.cc	2006-02-21 00:01:32 +01:00
@@ -45,6 +45,8 @@ event_timed::init()
   definer_user.str= definer_host.str= 0;
   definer_user.length= definer_host.length= 0;
 
+  sql_mode= 0;
+
   DBUG_VOID_RETURN;
 }
 
@@ -579,6 +581,9 @@ event_timed::load_from_row(MEM_ROOT *mem
     et->comment.length= strlen(et->comment.str);
   else
     et->comment.length= 0;
+    
+
+  et->sql_mode= (ulong) table->field[EVEX_FIELD_SQL_MODE]->val_int();
 
   DBUG_RETURN(0);
 error:
@@ -1232,6 +1237,7 @@ event_timed::compile(THD *thd, MEM_ROOT 
   char *old_query;
   uint old_query_len;
   st_sp_chistics *p;
+  ulong old_sql_mode= thd->variables.sql_mode;
   char create_buf[2048];
   String show_create(create_buf, sizeof(create_buf), system_charset_info);
   CHARSET_INFO *old_character_set_client,
@@ -1251,6 +1257,8 @@ event_timed::compile(THD *thd, MEM_ROOT 
   thd->update_charset();
 
   DBUG_ENTER("event_timed::compile");
+  DBUG_PRINT("info",("old_sql_mode=%d new_sql_mode=%d",old_sql_mode, sql_mode));
+  thd->variables.sql_mode= this->sql_mode;
   /* Change the memory root for the execution time */
   if (mem_root)
   {
@@ -1302,7 +1310,7 @@ event_timed::compile(THD *thd, MEM_ROOT 
     TODO: Handle sql_mode!!
   */
   sphead->set_definer(definer.str, definer.length);
-  sphead->set_info(0, 0, &lex.sp_chistics, 0/*sql_mode*/);
+  sphead->set_info(0, 0, &lex.sp_chistics, sql_mode);
   sphead->optimize();
   ret= 0;
 done:
@@ -1316,6 +1324,7 @@ done:
   thd->query_length= old_query_len;
   thd->db= old_db;
 
+  thd->variables.sql_mode= old_sql_mode;
   thd->variables.character_set_client= old_character_set_client;
   thd->variables.character_set_results= old_character_set_results;
   thd->variables.collation_connection= old_collation_connection;
Thread
bk commit into 5.1 tree (andrey:1.2146)ahristov21 Feb