summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorserg@serg.mylan <>2005-01-26 09:54:12 +0100
committerserg@serg.mylan <>2005-01-26 09:54:12 +0100
commit160f254d34bc6da403ec10ff50706a01326bfc08 (patch)
treeded6c587a2f9935db6accfaa14edfa14f4213e8f /client
parent7db99fa5591da5c71f28ee50f185bdc023210705 (diff)
parentd8f35cec21f5450ecff1e54729aafdaa40fed4a9 (diff)
downloadmariadb-git-160f254d34bc6da403ec10ff50706a01326bfc08.tar.gz
merged
Diffstat (limited to 'client')
-rw-r--r--client/mysqlbinlog.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 45daa64705a..caf126f2830 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -744,7 +744,7 @@ static int parse_args(int *argc, char*** argv)
static MYSQL* safe_connect()
{
- MYSQL *local_mysql = mysql_init(NULL);
+ MYSQL *local_mysql= mysql_init(NULL);
if (!local_mysql)
die("Failed on mysql_init");
@@ -752,9 +752,13 @@ static MYSQL* safe_connect()
if (opt_protocol)
mysql_options(local_mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
if (!mysql_real_connect(local_mysql, host, user, pass, 0, port, sock, 0))
- die("failed on connect: %s", mysql_error(local_mysql));
+ {
+ char errmsg[256];
+ strmake(errmsg, mysql_error(local_mysql), sizeof(errmsg)-1);
+ mysql_close(local_mysql);
+ die("failed on connect: %s", errmsg);
+ }
local_mysql->reconnect= 1;
-
return local_mysql;
}
@@ -781,9 +785,8 @@ static int check_master_version(MYSQL* mysql,
if (mysql_query(mysql, "SELECT VERSION()") ||
!(res = mysql_store_result(mysql)))
{
- char errmsg[FN_REFLEN];
-
- strmake(errmsg, mysql_error(mysql), sizeof(errmsg) - 1);
+ char errmsg[256];
+ strmake(errmsg, mysql_error(mysql), sizeof(errmsg)-1);
mysql_close(mysql);
die("Error checking master version: %s", errmsg);
}