diff options
author | unknown <guilhem@mysql.com> | 2003-08-02 16:10:26 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2003-08-02 16:10:26 +0200 |
commit | 5a696ebd164f3e9dcf9edad1a5702d54961d6049 (patch) | |
tree | b974f545bbb1a532dd33f2a0e46af7d74b343141 /sql | |
parent | 46f96a30b0484bb9877a9bdb2c7dec108b6e2963 (diff) | |
download | mariadb-git-5a696ebd164f3e9dcf9edad1a5702d54961d6049.tar.gz |
Mark tables 'updating' in sql_acl.cc (mysql_grant(), mysql_table_grant()) so that
tables_ok() does not ignore them. This fixes random bug #980.
sql/sql_acl.cc:
Mark tables 'updating' so that tables_ok() does not ignore them;
this fixes random bug #980.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_acl.cc | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 755a72bec32..d73e8b236e5 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2107,8 +2107,17 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, GRANT and REVOKE are applied the slave in/exclusion rules as they are some kind of updates to the mysql.% tables. */ - if (thd->slave_thread && table_rules_on && !tables_ok(0, tables)) - DBUG_RETURN(0); + if (thd->slave_thread && table_rules_on) + { + /* + The tables must be marked "updating" so that tables_ok() takes them into + account in tests. + */ + tables[0].updating=tables[1].updating=tables[2].updating=1; + if (!tables_ok(0, tables)) + DBUG_RETURN(0); + tables[0].updating=tables[1].updating=tables[2].updating=0; + } #endif if (open_and_lock_tables(thd,tables)) @@ -2279,8 +2288,17 @@ int mysql_grant (THD *thd, const char *db, List <LEX_USER> &list, GRANT and REVOKE are applied the slave in/exclusion rules as they are some kind of updates to the mysql.% tables. */ - if (thd->slave_thread && table_rules_on && !tables_ok(0, tables)) - DBUG_RETURN(0); + if (thd->slave_thread && table_rules_on) + { + /* + The tables must be marked "updating" so that tables_ok() takes them into + account in tests. + */ + tables[0].updating=tables[1].updating=1; + if (!tables_ok(0, tables)) + DBUG_RETURN(0); + tables[0].updating=tables[1].updating=0; + } #endif if (open_and_lock_tables(thd,tables)) |