summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/Makefile.am8
-rw-r--r--sql/client_settings.h33
-rw-r--r--sql/repl_failsafe.cc5
-rw-r--r--sql/slave.cc9
-rw-r--r--sql/sql_repl.cc1
5 files changed, 45 insertions, 11 deletions
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 608b959a8b9..eeaf96ce190 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -55,9 +55,9 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
opt_range.h opt_ft.h protocol.h \
sql_select.h structs.h table.h sql_udf.h hash_filo.h\
lex.h lex_symbol.h sql_acl.h sql_crypt.h \
- log_event.h mini_client.h sql_repl.h slave.h \
+ log_event.h sql_repl.h slave.h \
stacktrace.h sql_sort.h sql_cache.h set_var.h \
- spatial.h gstream.h
+ spatial.h gstream.h client_settings.h
mysqld_SOURCES = sql_lex.cc sql_handler.cc \
item.cc item_sum.cc item_buff.cc item_func.cc \
item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \
@@ -83,7 +83,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \
sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
slave.cc sql_repl.cc sql_union.cc sql_derived.cc \
- mini_client.cc mini_client_errors.c pack.c\
+ client.c mini_client_errors.c pack.c\
stacktrace.c repl_failsafe.h repl_failsafe.cc sql_olap.cc\
gstream.cc spatial.cc sql_help.cc protocol_cursor.cc
gen_lex_hash_SOURCES = gen_lex_hash.cc
@@ -104,6 +104,8 @@ link_sources:
@LN_CP_F@ ../libmysql/errmsg.c mini_client_errors.c
rm -f pack.c
@LN_CP_F@ ../sql-common/pack.c pack.c
+ rm -f client.c
+ @LN_CP_F@ ../sql-common/client.c client.c
gen_lex_hash.o: gen_lex_hash.cc lex.h
$(CXXCOMPILE) -c $(INCLUDES) $<
diff --git a/sql/client_settings.h b/sql/client_settings.h
new file mode 100644
index 00000000000..de0c7f40717
--- /dev/null
+++ b/sql/client_settings.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+#ifndef _client_settings_h
+#define _client_settings_h
+#include <thr_alarm.h>
+#include <mysql_embed.h>
+#include <mysql_com.h>
+
+
+#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | \
+ CLIENT_LOCAL_FILES | CLIENT_SECURE_CONNECTION)
+
+
+extern ulong slave_net_timeout;
+#define init_sigpipe_variables
+#define set_sigpipe(mysql)
+#define reset_sigpipe(mysql)
+#endif /* _client_settings_h */
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 1d0801fc3c1..2aa8f492ed3 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -23,7 +23,6 @@
#include "sql_repl.h"
#include "slave.h"
#include "sql_acl.h"
-#include "mini_client.h"
#include "log_event.h"
#include <mysql.h>
@@ -669,9 +668,9 @@ int connect_to_master(THD *thd, MYSQL* mysql, MASTER_INFO* mi)
strmov(mysql->net.last_error, "Master is not configured");
DBUG_RETURN(1);
}
+ mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *)&slave_net_timeout);
if (!mysql_real_connect(mysql, mi->host, mi->user, mi->password, 0,
- mi->port, 0, 0,
- slave_net_timeout))
+ mi->port, 0, 0))
DBUG_RETURN(1);
DBUG_RETURN(0);
}
diff --git a/sql/slave.cc b/sql/slave.cc
index cc40df38eff..a49389e0ec7 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -20,12 +20,12 @@
#include <mysql.h>
#include <myisam.h>
-#include "mini_client.h"
#include "slave.h"
#include "sql_repl.h"
#include "repl_failsafe.h"
#include <thr_alarm.h>
#include <my_dir.h>
+#include <sql_common.h>
bool use_slave_mask = 0;
MY_BITMAP slave_error_mask;
@@ -2948,9 +2948,10 @@ static int connect_to_master(THD* thd, MYSQL* mysql, MASTER_INFO* mi,
while (!(slave_was_killed = io_slave_killed(thd,mi)) &&
(reconnect ? mysql_reconnect(mysql) != 0:
- !mysql_real_connect(mysql, mi->host, mi->user, mi->password, 0,
- mi->port, 0, client_flag,
- thd->variables.net_read_timeout)))
+ !(mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT,
+ (char *)&thd->variables.net_read_timeout),
+ mysql_real_connect(mysql, mi->host, mi->user, mi->password, 0,
+ mi->port, 0, client_flag))))
{
/* Don't repeat last error */
if ((int)mysql_errno(mysql) != last_errno)
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index b8f6de30840..fe47e553cf3 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -22,7 +22,6 @@
#include "sql_repl.h"
#include "sql_acl.h"
#include "log_event.h"
-#include "mini_client.h"
#include <my_dir.h>
extern const char* any_db;