summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorunknown <gluh@gluh.mysql.r18.ru>2003-12-08 09:13:14 +0400
committerunknown <gluh@gluh.mysql.r18.ru>2003-12-08 09:13:14 +0400
commita0e4a6de568f11f437ed8509f8f748923332c716 (patch)
tree82e7ae89766b6885580f2d2d78eef741dda68fe4 /sql/slave.cc
parent573227ec7360d41da5d0df71fc1a65768c92aea2 (diff)
downloadmariadb-git-a0e4a6de568f11f437ed8509f8f748923332c716.tar.gz
Task ID 499:Add a new settable string variable(init_connect, init_slave)
to mysqld that is executed for all new connections. (Similar to the client command: mysql_options(... MYSQL_INIT_COMMAND ...). sql/mysql_priv.h: Task ID 499:Add a new settable string variable(init_connect, init_slave) to mysqld that is executed for all new connections. sql/mysqld.cc: Task ID 499:Add a new settable string variable(init_connect, init_slave) to mysqld that is executed for all new connections. sql/protocol.cc: Task ID 499:Add a new settable string variable(init_connect, init_slave) to mysqld that is executed for all new connections. sql/set_var.cc: Task ID 499:Add a new settable string variable(init_connect, init_slave) to mysqld that is executed for all new connections. sql/slave.cc: Task ID 499:Add a new settable string variable(init_connect, init_slave) to mysqld that is executed for all new connections. sql/sql_class.cc: Task ID 499:Add a new settable string variable(init_connect, init_slave) to mysqld that is executed for all new connections. sql/sql_class.h: Task ID 499:Add a new settable string variable(init_connect, init_slave) to mysqld that is executed for all new connections. sql/sql_parse.cc: Task ID 499:Add a new settable string variable(init_connect, init_slave) to mysqld that is executed for all new connections. sql/sql_show.cc: Task ID 499:Add a new settable string variable(init_connect, init_slave) to mysqld that is executed for all new connections.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc22
1 files changed, 1 insertions, 21 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index b9da8c7eca6..58eb214a319 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2448,24 +2448,6 @@ err:
}
-void init_slave_execute(THD *thd, sys_var_str *init_slave_var)
-{
- Vio* save_vio;
- ulong save_client_capabilities;
-
- thd->proc_info= "Execution of init_slave";
- thd->query= init_slave_var->value;
- thd->query_length= init_slave_var->value_length;
- save_client_capabilities= thd->client_capabilities;
- thd->client_capabilities|= CLIENT_MULTI_QUERIES;
- save_vio= thd->net.vio;
- thd->net.vio= 0;
- dispatch_command(COM_QUERY, thd, thd->query, thd->query_length+1);
- thd->client_capabilities= save_client_capabilities;
- thd->net.vio= save_vio;
-}
-
-
/* Slave SQL Thread entry point */
extern "C" pthread_handler_decl(handle_slave_sql,arg)
@@ -2551,9 +2533,7 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
/* execute init_slave variable */
if (sys_init_slave.value)
{
- rw_wrlock(&LOCK_sys_init_slave);
- init_slave_execute(thd, &sys_init_slave);
- rw_unlock(&LOCK_sys_init_slave);
+ execute_init_command(thd, &sys_init_slave, &LOCK_sys_init_slave);
if (thd->query_error)
{
sql_print_error("\