List:Bugs« Previous MessageNext Message »
From:Michael Widenius Date:February 24 2000 2:45pm
Subject:corrupt mysql/{db,user}.MYI after GRANT
View as plain text  
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
Thread
corrupt mysql/{db,user}.MYI after GRANTMichael Widenius24 Feb