List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:February 24 2000 3:52pm
Subject:corrupt mysql/{db,user}.MYI after GRANT
View as plain text  
Hi!

> When I do the request :
> select * from sites where name='patnom' and author='patauteur' and
> category=0;
> I receive "Empty set" where it should find one row.

<cut>

The problem is that you have found a bug in the handling of compressed
DECIMAL() keys.

The easy fix is to change category to int or bigint.

Anyway, here is a fix for this:

*** /my/monty/master/mysql-3.23.11-alpha/myisam/mi_search.c	Sat Jan 29 14:02:53 2000
--- ./mi_search.c	Thu Feb 24 17:44:17 2000
***************
*** 695,706 ****
  	if (swap_flag)
  	  swap(uchar*,a,b);
  	alength= *a++; blength= *b++;
! 	if ((flag=(int) (keyseg->length-key_length)) < 0)
! 	  flag=0;
! 	if (alength != blength+flag)
  	{
! 	  if ((alength > blength+flag && *a != '-') ||
! 	      (alength < blength+flag && *b == '-'))
  	    return 1;
  	  else
  	    return -1;
--- 695,704 ----
  	if (swap_flag)
  	  swap(uchar*,a,b);
  	alength= *a++; blength= *b++;
! 	if (alength != blength)
  	{
! 	  if ((alength > blength && *a != '-') ||
! 	      (alength < blength && *b == '-'))
  	    return 1;
  	  else
  	    return -1;

Reagrds,
Monty
Thread
corrupt mysql/{db,user}.MYI after GRANTMichael Widenius24 Feb