diff options
author | unknown <hf@deer.(none)> | 2003-09-29 21:07:51 +0500 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2003-09-29 21:07:51 +0500 |
commit | 5c08e1c1f4c4f40476e80413dcac45bb04186e33 (patch) | |
tree | da9dbcf4be514cfba333709b35b599678791a83a | |
parent | a8cd1d277336214680d17b42d8becd58c900eb85 (diff) | |
download | mariadb-git-5c08e1c1f4c4f40476e80413dcac45bb04186e33.tar.gz |
bugfix for #1375
libmysqld/lib_sql.cc:
some programs check mysql_error for empty string
sql/log.cc:
in embedded library these members can be NULL
-rw-r--r-- | libmysqld/lib_sql.cc | 2 | ||||
-rw-r--r-- | sql/log.cc | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 36b03279707..8d20dd9ba34 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -91,6 +91,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, memcpy(net->last_error, thd->net.last_error, sizeof(net->last_error)); memcpy(net->sqlstate, thd->net.sqlstate, sizeof(net->sqlstate)); } + else + net->last_error[0]= 0; mysql->warning_count= ((THD*)mysql->thd)->total_warn_count; return result; } diff --git a/sql/log.cc b/sql/log.cc index 9ad779a119b..608a7e94431 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1586,8 +1586,8 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, tmp_errno=errno; } if (my_b_printf(&log_file, "# User@Host: %s[%s] @ %s [%s]\n", - thd->priv_user, - thd->user, + thd->priv_user ? thd->priv_user : "", + thd->user ? thd->user : "", thd->host ? thd->host : "", thd->ip ? thd->ip : "") == (uint) -1) tmp_errno=errno; |