summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorramil/ram@mysql.com/myoffice.izhnet.ru <>2006-11-03 15:27:37 +0400
committerramil/ram@mysql.com/myoffice.izhnet.ru <>2006-11-03 15:27:37 +0400
commitafffedc0e3e0597c38a0ee9b362d6e05032f0349 (patch)
treefdea56ca877de5aeb535e0923ee75dee34fca32c /sql/slave.cc
parented95caceca5b5535ad700e8e725f11def963d035 (diff)
downloadmariadb-git-afffedc0e3e0597c38a0ee9b362d6e05032f0349.tar.gz
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.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc28
1 files changed, 15 insertions, 13 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 28bb7f12008..e3497a4f0ac 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -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, SLAVE_THD_TYPE thd_type)
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);