diff options
author | unknown <serg@serg.mylan> | 2005-01-25 21:11:04 +0100 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2005-01-25 21:11:04 +0100 |
commit | 036e9fcf039db5ed04603a5dc5f6632aee026612 (patch) | |
tree | 9335e37ecd31fcbde0bb4ab192d32d64381fbf15 /client/mysqlbinlog.cc | |
parent | 286ebc10481154e3ea674615b525ed9872f51b7a (diff) | |
parent | 90b15d3ec2627a42aae13ec94225cb06e1259485 (diff) | |
download | mariadb-git-036e9fcf039db5ed04603a5dc5f6632aee026612.tar.gz |
merged
BitKeeper/etc/ignore:
auto-union
BUILD/SETUP.sh:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_select.cc:
Auto merged
Diffstat (limited to 'client/mysqlbinlog.cc')
-rw-r--r-- | client/mysqlbinlog.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 6917797c03c..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; } @@ -780,7 +784,12 @@ static int check_master_version(MYSQL* mysql, if (mysql_query(mysql, "SELECT VERSION()") || !(res = mysql_store_result(mysql))) - die("Error checking master version: %s", mysql_error(mysql)); + { + char errmsg[256]; + strmake(errmsg, mysql_error(mysql), sizeof(errmsg)-1); + mysql_close(mysql); + die("Error checking master version: %s", errmsg); + } if (!(row = mysql_fetch_row(res))) { mysql_free_result(res); |