From: Michael Widenius Date: February 24 2000 2:45pm Subject: corrupt mysql/{db,user}.MYI after GRANT List-Archive: http://lists.mysql.com/bugs/21 Message-Id: <14517.17447.302380.553484@monty.pp.sci.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi! > Description: > After performing a simple GRANT statement, my db and user privilege > tables are corrupted: This happens only with MyISAM grant tables in the latest version when using with delayd_inserts. (The grant tables wasn't locked properly) Here is a fix for this: *** /my/monty/master/mysql-3.23.11-alpha/sql/sql_acl.cc Wed Feb 16 12:45:37 2000 --- ./sql_acl.cc Thu Feb 24 15:35:23 2000 *************** *** 1630,1636 **** tables[0].lock_type=tables[1].lock_type=tables[2].lock_type=TL_WRITE; tables[0].db=tables[1].db=tables[2].db=(char*) "mysql"; ! if (open_tables(thd,tables)) { // Should never happen close_thread_tables(thd); /* purecov: deadcode */ DBUG_RETURN(-1); /* purecov: deadcode */ --- 1630,1636 ---- tables[0].lock_type=tables[1].lock_type=tables[2].lock_type=TL_WRITE; tables[0].db=tables[1].db=tables[2].db=(char*) "mysql"; ! if (open_and_lock_tables(thd,tables)) { // Should never happen close_thread_tables(thd); /* purecov: deadcode */ DBUG_RETURN(-1); /* purecov: deadcode */ *************** *** 1783,1789 **** tables[0].lock_type=tables[1].lock_type=TL_WRITE; tables[0].db=tables[1].db=(char*) "mysql"; tables[0].table=tables[1].table=0; ! if (open_tables(thd,tables)) { // This should never happen close_thread_tables(thd); /* purecov: deadcode */ DBUG_RETURN(-1); /* purecov: deadcode */ --- 1783,1789 ---- tables[0].lock_type=tables[1].lock_type=TL_WRITE; tables[0].db=tables[1].db=(char*) "mysql"; tables[0].table=tables[1].table=0; ! if (open_and_lock_tables(thd,tables)) { // This should never happen close_thread_tables(thd); /* purecov: deadcode */ DBUG_RETURN(-1); /* purecov: deadcode */ Regards, Monty