MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / make_user_name

Function make_user_name

sql/sql_class.h:3848–3857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3846
3847#define MAX_USER_HOST_SIZE 512
3848static inline uint make_user_name(THD *thd, char *buf)
3849{
3850 Security_context *sctx= thd->security_ctx;
3851 return strxnmov(buf, MAX_USER_HOST_SIZE,
3852 sctx->priv_user[0] ? sctx->priv_user : "", "[",
3853 sctx->user ? sctx->user : "", "] @ ",
3854 sctx->get_host()->length() ? sctx->get_host()->ptr() :
3855 "", " [", sctx->get_ip()->length() ? sctx->get_ip()->ptr() :
3856 "", "]", NullS) - buf;
3857}
3858
3859
3860extern pthread_attr_t *get_connection_attrib(void);

Callers 1

general_log_writeMethod · 0.85

Calls 5

strxnmovFunction · 0.85
get_hostMethod · 0.80
lengthMethod · 0.45
ptrMethod · 0.45
get_ipMethod · 0.45

Tested by

no test coverage detected