From a7eb7a78ddc49c32f0d651eb83d1d34a0e8b6756 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 2 Aug 2003 17:23:39 +0200 Subject: [PATCH] There were two wrong calls to tables_ok() in MySQL 4.0 (BUG#980), which are fixed now. In 4.1 there are 3 calls; 2 of them will be fixed when there is a merge; here I fix the 3rd, new one. --- sql/sql_acl.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 51c05ccbf33..f89341a18dd 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3221,8 +3221,17 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables) 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(1); + 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=tables[3].updating=1; + if (!tables_ok(0, tables)) + DBUG_RETURN(1); + tables[0].updating=tables[1].updating=tables[2].updating=tables[3].updating=0; + } #endif if (open_and_lock_tables(thd, tables))