mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fix for 1224 (USER() CURRENT_USER() functions in embedded library)
Now we return user@host for USER() in embedded library CURRENT_USER returns empty string if library compiled with NO_EMBEDDED_ACCESS_CHECKS libmysqld/embedded_priv.h: function's declarations trimmed libmysqld/lib_sql.cc: user/host names handling added libmysqld/libmysqld.c: user/host names handling added sql/sql_class.cc: we shouldn't free user/host names in embedded library
This commit is contained in:
@@ -323,12 +323,14 @@ THD::~THD()
|
||||
#endif
|
||||
|
||||
DBUG_PRINT("info", ("freeing host"));
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
if (host != my_localhost) // If not pointer to constant
|
||||
safeFree(host);
|
||||
if (user != delayed_user)
|
||||
safeFree(user);
|
||||
safeFree(db);
|
||||
safeFree(ip);
|
||||
#endif
|
||||
safeFree(db);
|
||||
free_root(&warn_root,MYF(0));
|
||||
free_root(&transaction.mem_root,MYF(0));
|
||||
mysys_var=0; // Safety (shouldn't be needed)
|
||||
|
||||
Reference in New Issue
Block a user