mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
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
This commit is contained in:
parent
a8cd1d2773
commit
5c08e1c1f4
2 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue