Skip to content

Commit 88cc6db

Browse files
committed
MDEV-13453: Executing a query via CTE requires more permissions than the query itself
Fix of nondebuging version issue
1 parent 5e7435c commit 88cc6db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sql/sql_acl.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7558,7 +7558,8 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
75587558
sctx= t_ref->security_ctx ? t_ref->security_ctx : thd->security_ctx;
75597559

75607560
if (tl->with ||
7561-
(tl->with= tl->select_lex->find_table_def_in_with_clauses(tl)))
7561+
(tl->select_lex &&
7562+
(tl->with= tl->select_lex->find_table_def_in_with_clauses(tl))))
75627563
continue;
75637564

75647565
const ACL_internal_table_access *access=

0 commit comments

Comments
 (0)