diff options
author | unknown <monty@mysql.com> | 2005-01-25 21:27:51 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-01-25 21:27:51 +0200 |
commit | c2a2f5afb847b489cfddc88d8eb4b6309e298fe2 (patch) | |
tree | d9dcbad8d5c4fc3e392d04fe5c2ffe1598760471 /client/mysqlbinlog.cc | |
parent | 3ec5446c0afe1827045027a348ddde3f6f31333e (diff) | |
download | mariadb-git-c2a2f5afb847b489cfddc88d8eb4b6309e298fe2.tar.gz |
Cleanups during review
BitKeeper/etc/ignore:
added libmysqld/examples/mysqltest_embedded
client/mysqlbinlog.cc:
Call mysql_close() before die()
innobase/include/eval0eval.ic:
Remove assert that fails on 64 bit machines
(Tested with BUILD/compile-pentium64-valgrind-max on 64 bit Intel CPU)
sql/mysqld.cc:
Force lower_case_table_names to 0 if set to 2 on case insensitive file name
sql/sql_select.cc:
Remove #if 0
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 7ddb01d9ec8..0b15ad893e2 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -687,7 +687,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"); @@ -695,8 +695,12 @@ 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); + } return local_mysql; } @@ -717,7 +721,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); |