MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:ramil Date:November 3 2006 11:27am
Subject:bk commit into 5.0 tree (ramil:1.2348) BUG#19736
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram 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-03 15:27:37+04:00, ramil@stripped +2 -0
  Fix for bug #19736 VIEW: column names not quoted properly when view is replicated
  
  When we write 'query=...' string to a frm file for views on a slave, 
  indentifiers are not properly quoted due to missing OPTION_QUOTE_SHOW_CREATE 
  flag in the thd->options.
  
  Fix: properly set thd->options for the slave thread.

  mysql-test/r/rpl_view.result@stripped, 2006-11-03 15:27:32+04:00, ramil@stripped +2 -2
    Fix for bug #19736 VIEW: column names not quoted properly when view is replicated
      - result adjusted.

  sql/slave.cc@stripped, 2006-11-03 15:27:33+04:00, ramil@stripped +15 -13
    Fix for bug #19736 VIEW: column names not quoted properly when view is replicated
      - properly set thd->options only in one place (in the set_slave_thread_options()),
        using thd_startup_options. As a side effect we have OPTION_BIG_SELECTS flag set
        after the set_slave_thread_options() call from the 
        log_enevt.cc:Rotate_log_event::exec_event().

# 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:	ramil
# Host:	myoffice.izhnet.ru
# Root:	/usr/home/ram/work/bug19736/my50-bug19736

--- 1.281/sql/slave.cc	2006-11-03 15:27:46 +04:00
+++ 1.282/sql/slave.cc	2006-11-03 15:27:46 +04:00
@@ -2854,8 +2854,21 @@ improper_arguments: %d  timed_out: %d",
 
 void set_slave_thread_options(THD* thd)
 {
-  thd->options = ((opt_log_slave_updates) ? OPTION_BIN_LOG:0) |
-    OPTION_AUTO_IS_NULL;
+  /*
+     It's nonsense to constrain the slave threads with max_join_size; if a
+     query succeeded on master, we HAVE to execute it. So set
+     OPTION_BIG_SELECTS. Setting max_join_size to HA_POS_ERROR is not enough
+     (and it's not needed if we have OPTION_BIG_SELECTS) because an INSERT
+     SELECT examining more than 4 billion rows would still fail (yes, because
+     when max_join_size is 4G, OPTION_BIG_SELECTS is automatically set, but
+     only for client threads.
+  */
+  ulonglong options= thd->options | OPTION_BIG_SELECTS;
+  if (opt_log_slave_updates)
+    options|= OPTION_BIN_LOG;
+  else
+    options&= ~OPTION_BIN_LOG;
+  thd->options= options;
   thd->variables.completion_type= 0;
 }
 
@@ -2885,17 +2898,6 @@ static int init_slave_thread(THD* thd, S
   thd->net.read_timeout = slave_net_timeout;
   thd->slave_thread = 1;
   set_slave_thread_options(thd);
-  /* 
-     It's nonsense to constrain the slave threads with max_join_size; if a
-     query succeeded on master, we HAVE to execute it. So set
-     OPTION_BIG_SELECTS. Setting max_join_size to HA_POS_ERROR is not enough
-     (and it's not needed if we have OPTION_BIG_SELECTS) because an INSERT
-     SELECT examining more than 4 billion rows would still fail (yes, because
-     when max_join_size is 4G, OPTION_BIG_SELECTS is automatically set, but
-     only for client threads.
-  */
-  thd->options = ((opt_log_slave_updates) ? OPTION_BIN_LOG:0) |
-    OPTION_AUTO_IS_NULL | OPTION_BIG_SELECTS;
   thd->client_capabilities = CLIENT_LOCAL_FILES;
   thd->real_id=pthread_self();
   pthread_mutex_lock(&LOCK_thread_count);

--- 1.7/mysql-test/r/rpl_view.result	2006-11-03 15:27:46 +04:00
+++ 1.8/mysql-test/r/rpl_view.result	2006-11-03 15:27:46 +04:00
@@ -47,11 +47,11 @@ show binlog events limit 1,100;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 slave-bin.000001	#	Query	1	#	use `test`; create table t1 (a int)
 slave-bin.000001	#	Query	1	#	use `test`; insert into t1 values (1)
-slave-bin.000001	#	Query	1	#	use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost SQL SECURITY DEFINER VIEW v1 AS select a from t1
+slave-bin.000001	#	Query	1	#	use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select a from t1
 slave-bin.000001	#	Query	1	#	use `test`; insert into v1 values (2)
 slave-bin.000001	#	Query	1	#	use `test`; update v1 set a=3 where a=1
 slave-bin.000001	#	Query	1	#	use `test`; delete from v1 where a=2
-slave-bin.000001	#	Query	1	#	use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=root@localhost SQL SECURITY DEFINER VIEW v1 AS select a as b from t1
+slave-bin.000001	#	Query	1	#	use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select a as b from t1
 slave-bin.000001	#	Query	1	#	use `test`; drop view v1
 slave-bin.000001	#	Query	1	#	use `test`; drop table t1
 
Thread
bk commit into 5.0 tree (ramil:1.2348) BUG#19736ramil3 Nov