diff options
author | Sergei Golubchik <serg@mariadb.org> | 2022-06-08 15:20:36 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2022-06-15 14:55:35 +0200 |
commit | 2e7e89d6c94db51d473ddfb9e023d4f19925e524 (patch) | |
tree | f6d21afbccae719c1168a2223a19910a8ff1fb76 | |
parent | 124326d8108623e36f8e0a4a7c15774beed18015 (diff) | |
download | mariadb-git-2e7e89d6c94db51d473ddfb9e023d4f19925e524.tar.gz |
cleanup: move the check out of the loop
-rw-r--r-- | sql/sql_show.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 1316dcd9c94..a019c3c9dbd 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -6990,19 +6990,18 @@ static int get_check_constraints_record(THD *thd, TABLE_LIST *tables, #ifndef NO_EMBEDDED_ACCESS_CHECKS TABLE_LIST table_acl_check; bzero((char*) &table_acl_check, sizeof(table_acl_check)); + + if (!(thd->col_access & TABLE_ACLS)) + { + table_acl_check.db= *db_name; + table_acl_check.table_name= *table_name; + table_acl_check.grant.privilege= thd->col_access; + if (check_grant(thd, TABLE_ACLS, &table_acl_check, FALSE, 1, TRUE)) + DBUG_RETURN(res); + } #endif for (uint i= 0; i < tables->table->s->table_check_constraints; i++) { -#ifndef NO_EMBEDDED_ACCESS_CHECKS - if (!(thd->col_access & TABLE_ACLS)) - { - table_acl_check.db= *db_name; - table_acl_check.table_name= *table_name; - table_acl_check.grant.privilege= thd->col_access; - if (check_grant(thd, TABLE_ACLS, &table_acl_check, FALSE, 1, TRUE)) - continue; - } -#endif Virtual_column_info *check= tables->table->check_constraints[i]; table->field[0]->store(STRING_WITH_LEN("def"), system_charset_info); table->field[3]->store(check->name.str, check->name.length, |