1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-13439: Database permissions are not enough to run a subquery with GROUP BY within a view

The bug is result adding ability to have derived tables inside views.
Fixed checks should be a switch between view/derived or select derived and information schema.
This commit is contained in:
Oleksandr Byelkin
2017-08-07 13:42:35 +02:00
parent bdab49d389
commit cb2a57c203
4 changed files with 52 additions and 4 deletions

View File

@ -822,13 +822,14 @@ exit:
table->derived_select_number= first_select->select_number;
table->s->tmp_table= INTERNAL_TMP_TABLE;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (derived->referencing_view)
if (derived->is_view())
table->grant= derived->grant;
else
{
DBUG_ASSERT(derived->is_derived());
DBUG_ASSERT(derived->is_anonymous_derived_table());
table->grant.privilege= SELECT_ACL;
if (derived->is_derived())
derived->grant.privilege= SELECT_ACL;
derived->grant.privilege= SELECT_ACL;
}
#endif
/* Add new temporary table to list of open derived tables */