diff options
author | unknown <dlenev@brandersnatch.localdomain> | 2004-10-21 22:18:00 +0400 |
---|---|---|
committer | unknown <dlenev@brandersnatch.localdomain> | 2004-10-21 22:18:00 +0400 |
commit | 8537cf2f4ba91b7e08975842aba910d4debefc13 (patch) | |
tree | b557681e179a7a27aa8225e52e5623edc88c4db6 /sql/sql_parse.cc | |
parent | 8f8236008193394ea2785c0095adf02839cde83a (diff) | |
download | mariadb-git-8537cf2f4ba91b7e08975842aba910d4debefc13.tar.gz |
Fix for bug #6116 "SET time_zone := ... requires access to
mysql.time_zone* tables".
We are excluding implicitly used time zone tables from privilege
checking.
mysql-test/r/timezone2.result:
Added test for bug #6116 "SET time_zone := ... requires access to
mysql.time_zone tables"
mysql-test/t/timezone2.test:
Added test for bug #6116 "SET time_zone := ... requires access to
mysql.time_zone tables"
sql/sql_parse.cc:
check_table_access(): we should avoid privilege checking for implicitly
used time zone tables.
sql/tztime.cc:
Indicated dependancy between my_tz_get_table_list() function and
my_tz_check_n_skip_implicit_tables() function.
sql/tztime.h:
Added my_tz_check_n_skip_implicit_tables() function which allows easily
determine whenever we have found beggining of the list of implicitly used
time zone tables and fast-forward to its end.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index daa0bc1e063..9dd18f0f152 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3724,7 +3724,10 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables, TABLE_LIST *org_tables=tables; for (; tables ; tables=tables->next) { - if (tables->derived || (tables->table && (int)tables->table->tmp_table)) + if (tables->derived || + (tables->table && (int)tables->table->tmp_table) || + my_tz_check_n_skip_implicit_tables(&tables, + thd->lex->time_zone_tables_used)) continue; if ((thd->master_access & want_access) == (want_access & ~EXTRA_ACL) && thd->db) |