summaryrefslogtreecommitdiff
path: root/libmysql/libmysql.c
diff options
context:
space:
mode:
authorholyfoot/hf@mysql.com/hfmain.(none) <>2008-02-27 12:42:43 +0400
committerholyfoot/hf@mysql.com/hfmain.(none) <>2008-02-27 12:42:43 +0400
commit140ca5953815ac1f773ae518cb021783e3334e20 (patch)
tree59053e19fde04a14b780f67eb9ed983bf57e3d3b /libmysql/libmysql.c
parent663453d572cdce425787885cf25b6a547b6f2bb1 (diff)
downloadmariadb-git-140ca5953815ac1f773ae518cb021783e3334e20.tar.gz
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.
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r--libmysql/libmysql.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 4afc3ec5925..0320126a522 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1486,7 +1486,7 @@ my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql)
const char *STDCALL mysql_sqlstate(MYSQL *mysql)
{
- return mysql->net.sqlstate;
+ return mysql ? mysql->net.sqlstate : cant_connect_sqlstate;
}
uint STDCALL mysql_warning_count(MYSQL *mysql)