From 140ca5953815ac1f773ae518cb021783e3334e20 Mon Sep 17 00:00:00 2001 From: "holyfoot/hf@mysql.com/hfmain.(none)" <> 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. --- libmysqld/lib_sql.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libmysqld') diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index ce692169a5f..b0a47727c7c 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -47,6 +47,8 @@ C_MODE_START #include #include "embedded_priv.h" +extern unsigned int mysql_server_last_errno; +extern char mysql_server_last_error[MYSQL_ERRMSG_SIZE]; static my_bool emb_read_query_result(MYSQL *mysql); @@ -1084,3 +1086,11 @@ bool Protocol::net_store_data(const char *from, uint length) return false; } + +void vprint_msg_to_log(enum loglevel level __attribute__((unused)), + const char *format, va_list argsi) +{ + vsnprintf(mysql_server_last_error, sizeof(mysql_server_last_error), + format, argsi); + mysql_server_last_errno= CR_UNKNOWN_ERROR; +} -- cgit v1.2.1