From a4b0a2cf67356c0f8f80b5291b3c1f4f8327cb97 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Feb 2008 12:42:43 +0400 Subject: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. There was no way to return an error from the client library if no MYSQL connections was established. So here i added variables to store that king of errors and made functions like mysql_error(NULL) to return these. client/mysql.cc: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. Show the error message on std_error include/sql_common.h: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. cant_connect_sqlstate constant declared libmysql/libmysql.c: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. mysql_sqlstate(NULL) returns 'unknown_sqlstate' libmysqld/lib_sql.cc: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. EMBEDDED_SERVER version of the vprint_msg_to_log() implemented sql-common/client.c: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. mysql_server_last_errno and mysql_server_last_error introduced to store errors not related to particular connections. mysql_error(NULL) and mysql_errno(NULL) now returns these mysql_server_last_error and errno respectively sql/log.cc: Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. EMBEDDED_LIBRARY implementation of the vprint_msg_to_log() moved to lib_sql.cc --- client/mysql.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'client') diff --git a/client/mysql.cc b/client/mysql.cc index 76ed82508be..af28dce2cdd 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -420,6 +420,7 @@ int main(int argc,char *argv[]) } if (mysql_server_init(emb_argc, emb_argv, (char**) server_default_groups)) { + put_error(NULL); free_defaults(defaults_argv); my_end(0); exit(1); -- cgit v1.2.1 From 99c0b5e10ff2f64df6b3d90096be0ece31130dcb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Mar 2008 11:15:49 +0200 Subject: Bug #34909: mysqldump returns a 0 status on error when using --master-data No error code was returned by mysqldump if it detects that binary logging is not enabled on the server. Fixed by returning error code. client/mysqldump.c: Bug #34909: add error code mysql-test/r/mysqldump-no-binlog.result: Bug #34909: test case mysql-test/t/mysqldump-no-binlog-master.opt: Bug #34909: test case mysql-test/t/mysqldump-no-binlog.test: Bug #34909: test case --- client/mysqldump.c | 1 + 1 file changed, 1 insertion(+) (limited to 'client') diff --git a/client/mysqldump.c b/client/mysqldump.c index 980013d539a..e8129a6fd73 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -3285,6 +3285,7 @@ static int do_show_master_status(MYSQL *mysql_con) my_printf_error(0, "Error: Binlogging on server not active", MYF(0)); mysql_free_result(master); + maybe_exit(EX_MYSQLERR); return 1; } mysql_free_result(master); -- cgit v1.2.1