List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:May 10 2000 12:08am
Subject:Re: Bug with delete still exists !!!
View as plain text  
>>>>> "sasha" == sasha  <sasha@stripped> writes:

sasha> Ok, I've verified the bug. Here is a very simple test case:
sasha> use test;
sasha> drop table if exists foo;
sasha> create table foo ( word char(25) binary  not null primary key)
sasha>  delay_key_write = 1;
sasha> load data infile '/usr/dict/words' into table foo;
sasha> select word from foo where word = 'a' or word = 'b';
sasha> delete from foo where word < 'l';
sasha> check table foo;

sasha> Monty and I will have a race on who can produce a patch faster. He knows the
sasha> code better, but I am going to have a head start :-)

I assume Sasha has already posted a patch for this :)

Here is the official patch for this:

*** /my/monty/master/mysql-3.23.15-alpha/mysys/mf_keycache.c	Fri Apr 28 01:16:30 2000
--- mysys/mf_keycache.c	Wed May 10 01:31:51 2000
***************
*** 551,557 ****
  	  *pos++=used;
  	  _my_cache_write++;
  	}
! 	if (type != FLUSH_KEEP)
  	{
  	  /* This will not destroy position or data */
  	  used->changed=0;
--- 551,557 ----
  	  *pos++=used;
  	  _my_cache_write++;
  	}
! 	if (type != FLUSH_KEEP && type != FLUSH_FORCE_WRITE)
  	{
  	  /* This will not destroy position or data */
  	  used->changed=0;
***************
*** 567,573 ****
        if ((error=flush_cached_blocks(file, cache, (uint) (pos-cache))))
  	last_errno=error;
      }
!     if (type != FLUSH_KEEP)			/* This happens very seldom */
      {
        for (used=file_blocks[(uint) file & CHANGED_BLOCKS_MASK];
  	   used ;
--- 567,574 ----
        if ((error=flush_cached_blocks(file, cache, (uint) (pos-cache))))
  	last_errno=error;
      }
!     /* The following happens very seldom */
!     if (type != FLUSH_KEEP && type != FLUSH_FORCE_WRITE)
      {
        for (used=file_blocks[(uint) file & CHANGED_BLOCKS_MASK];
  	   used ;
*** /my/monty/master/mysql-3.23.15-alpha/myisam/mi_check.c	Fri May  5 06:07:11 2000
--- myisam/mi_check.c	Wed May 10 01:32:12 2000
***************
*** 246,251 ****
--- 246,253 ----
  
    if (!(param->testflag & T_SILENT)) puts("- check file-size");
  
+   flush_key_blocks(info->s->kfile, FLUSH_FORCE_WRITE); /* If called externally */
+ 
    size=my_seek(info->s->kfile,0L,MY_SEEK_END,MYF(0));
    if ((skr=(my_off_t) info->state->key_file_length) != size)
    {

Thread
How do I give a name to a result....Penphoe12 Mar
  • mod_auth_mysqlMike McLagan13 Mar
    • Re: mod_auth_mysqlMike McLagan13 Mar
  • Re: How do I give a name to a result....Christian Mack13 Mar
  • Re: Bug with delete still exists !!!Kyle Hayes10 May
  • Re: Bug with delete still exists !!!Michael Widenius10 May
Re: mod_auth_mysqlDavey14 Mar