summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 1227863ad81..2320c148b3a 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -6093,6 +6093,15 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
show_table->use_all_columns(); // Required for default
restore_record(show_table, s->default_values);
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ check_access(thd, SELECT_ACL, db_name->str,
+ &tables->grant.privilege, 0, 0, MY_TEST(tables->schema_table));
+ if (is_temporary_table(tables))
+ {
+ tables->grant.privilege|= TMP_TABLE_ACLS;
+ }
+#endif
+
for (; (field= *ptr) ; ptr++)
{
if(field->invisible > INVISIBLE_USER)
@@ -6112,14 +6121,13 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
restore_record(table, s->default_values);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- ulonglong col_access;
- check_access(thd,SELECT_ACL, db_name->str,
- &tables->grant.privilege, 0, 0, MY_TEST(tables->schema_table));
- col_access= get_column_grant(thd, &tables->grant,
- db_name->str, table_name->str,
- field->field_name.str) & COL_ACLS;
- if (!tables->schema_table && !col_access)
+ ulonglong col_access=
+ get_column_grant(thd, &tables->grant, db_name->str, table_name->str,
+ field->field_name.str) & COL_ACLS;
+
+ if (!col_access && !tables->schema_table)
continue;
+
char *end= tmp;
for (uint bitnr=0; col_access ; col_access>>=1,bitnr++)
{