1
0
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:
unknown
2004-01-07 21:30:15 +04:00
parent 902c361910
commit 582886a3e9
4 changed files with 33 additions and 19 deletions

View File

@@ -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)