From c4c09afb1826f1d6f719854dc8a8b65e7f0f35fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= <cvicentiu@gmail.com> Date: Fri, 18 Oct 2013 05:11:31 -0700 Subject: [PATCH] Fixed _always_ true condition --- sql/sql_parse.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 90af112810e..ac6ac2763b3 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5203,8 +5203,8 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, { db_access= acl_get(sctx->host, sctx->ip, sctx->priv_user, db, db_is_pattern); - if (sctx->priv_role) - db_access|= acl_get("", "", sctx->priv_role, db, db_is_pattern); + if (sctx->priv_role[0]) + db_access|= acl_get("", "", sctx->priv_role, db, db_is_pattern); } else { @@ -5252,7 +5252,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, { db_access= acl_get(sctx->host, sctx->ip, sctx->priv_user, db, db_is_pattern); - if (sctx->priv_role) + if (sctx->priv_role[0]) { db_access|= acl_get("", "", sctx->priv_role, db, db_is_pattern); } -- 2.30.9