diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-10-25 11:26:37 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-10-25 11:26:37 +0300 |
commit | 9a0b9e336081619d88211d17895e3e7f8030ab3f (patch) | |
tree | dff672703c5309b1e34227330ea027ab13e6c29a /sql/sql_show.cc | |
parent | 2f7a0072b6f343051fc2dbd77ea46519617b94ab (diff) | |
parent | 667d3fbbb51044b20d23150992adbbad1f04aad8 (diff) | |
download | mariadb-git-9a0b9e336081619d88211d17895e3e7f8030ab3f.tar.gz |
Merge 10.4 into 10.5
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 6cf99144a56..d8a441f2e10 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -6020,6 +6020,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) @@ -6039,14 +6048,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++) { |