Bug #10227 empty select
Submitted: 28 Apr 2005 7:15 Modified: 7 May 2005 7:22
Reporter: Jan Benda Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S1 (Critical)
Version:5.0.4 OS:Linux (Fedora3,Windows98)
Assigned to: Timour Katchaounov CPU Architecture:Any

[28 Apr 2005 7:15] Jan Benda
Description:
There are records in the table (select count(*) returns 1), but select * returns empty recordset

How to repeat:
DROP TABLE IF EXISTS ugo;
CREATE TABLE ugo (
  AKCE_1 char(1) default '',
  AUT_KOD char(10) default '',
  BONUS_CR char(1) default '',
  BR_BODOVA decimal(6,2) default '0.00',
  BR_BODOVA2 decimal(6,2) default '0.00',
  BR_RATA int(11) default '0',
  BR_UG char(10) default '',
  BR_UG2 char(10) default ''
) ENGINE=MyISAM DEFAULT CHARSET=cp1250;
insert into ugo ( BONUS_CR, BR_BODOVA, BR_BODOVA2) values (  'a' ,  0,  0);
insert into ugo ( BONUS_CR, BR_BODOVA, BR_BODOVA2) values (  'b' ,  0,  0);
select count(*) from ugo;
#returns 2
select * from ugo;
#returns nothing !
[28 Apr 2005 7:32] Hartmut Holzgraefe
also happens with current bk build
[7 May 2005 7:22] Timour Katchaounov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

I could reproduce the bug on an a several days old tree, but it can't be reproduced in the latest
BK tree. Therefore I assume that the bug has been already fixed by some current push.

Some info just in case: I localized the problem down to the insertion of rows with default values.
In this case if there are more than 7 columns, the remaining columns got NULLs stored instead of
the default value for the column.