diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-10-29 19:22:04 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-10-29 19:22:04 +0200 |
commit | 1ebfa2af62246b98e17cd255a9ccd858151b355a (patch) | |
tree | f9cf4670ebe96b46f8e0107acc31f7235ec4c554 /sql/sql_show.cc | |
parent | dd9da61dcfd7f5e675ed876cf38886b29d0ddc57 (diff) | |
parent | 64143741789a3e1c2bb8c6bf627eaec3751af0c6 (diff) | |
download | mariadb-git-1ebfa2af62246b98e17cd255a9ccd858151b355a.tar.gz |
Merge branch '10.6' into 10.7
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index c8a48b505db..2978c0fc319 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -6054,6 +6054,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) @@ -6073,14 +6082,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++) { |