Bug #17590 Different key-len and # rows reported on all platforms
Submitted: 20 Feb 2006 17:44 Modified: 23 Feb 2006 9:32
Reporter: Joerg Bruehe Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S2 (Serious)
Version:5.1.7-beta OS:Any (All)
Assigned to: CPU Architecture:Any

[20 Feb 2006 17:44] Joerg Bruehe
Description:
Build of 5.1.7-beta, based on ChangeSet
  1.2139 06/02/20 00:32:07 kent@mysql.com +3 -0
  mysql-test-run.pl:
    Added --restart-cleanup option
  drop-on-restart.inc:
    DROP commands to cleanup on restart
    new file
  mysqltest.c:
    Added option --include=<sql-file>

The following difference occurs on _all_ platforms, in all runs (including debug):
-------------------------------------------------------
*** r/group_min_max.result
--- r/group_min_max.reject
***************
*** 299,305
  1     SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_1        147     NULL    14      Using where; Using index for group-by
  explain select a1,a2,b,min(c),max(c) from t1 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
  id    select_type     table   type    possible_keys   key     key_len ref     rows    Extra
! 1     SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_1        147     NULL    17      Using where; Using index for group-by
  explain select a1,a2,b,       max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
  id    select_type     table   type    possible_keys   key     key_len ref     rows    Extra
  1     SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_1        147     NULL    10      Using where; Using index for group-by
--- 299,305
  1     SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_1        147     NULL    14      Using where; Using index for group-by
  explain select a1,a2,b,min(c),max(c) from t1 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
  id    select_type     table   type    possible_keys   key     key_len ref     rows    Extra
! 1     SIMPLE  t1      index   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_1        163     NULL    128     Using where; Using index
  explain select a1,a2,b,       max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
  id    select_type     table   type    possible_keys   key     key_len ref     rows    Extra
  1     SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_1        147     NULL    10      Using where; Using index for group-by
***************
*** 335,341
  1     SIMPLE  t2      range   idx_t2_0,idx_t2_1,idx_t2_2      idx_t2_1        146     NULL    #       Using where; Using index for group-by
  explain select a1,a2,b,min(c),max(c) from t2 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
  id    select_type     table   type    possible_keys   key     key_len ref     rows    Extra
! 1     SIMPLE  t2      range   idx_t2_0,idx_t2_1,idx_t2_2      idx_t2_1        163     NULL    #       Using where; Using index for group-by
  explain select a1,a2,b,       max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
  id    select_type     table   type    possible_keys   key     key_len ref     rows    Extra
  1     SIMPLE  t2      range   idx_t2_0,idx_t2_1,idx_t2_2      idx_t2_1        146     NULL    #       Using where; Using index for group-by
--- 335,341
  1     SIMPLE  t2      range   idx_t2_0,idx_t2_1,idx_t2_2      idx_t2_1        146     NULL    #       Using where; Using index for group-by
  explain select a1,a2,b,min(c),max(c) from t2 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
  id    select_type     table   type    possible_keys   key     key_len ref     rows    Extra
! 1     SIMPLE  t2      index   idx_t2_0,idx_t2_1,idx_t2_2      idx_t2_1        163     NULL    #       Using where; Using index
  explain select a1,a2,b,       max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
  id    select_type     table   type    possible_keys   key     key_len ref     rows    Extra
  1     SIMPLE  t2      range   idx_t2_0,idx_t2_1,idx_t2_2      idx_t2_1        146     NULL    #       Using where; Using index for group-by
-------------------------------------------------------

How to repeat:
Run the suite on any platform.
[23 Feb 2006 9:32] Valeriy Kravchuk
Thank you for a problem report. Sorry, but I was not able to repeat the failure you described with 5.1.8-beta-debug (ChangeSet@1.2169, 2006-02-23 00:35:32+01:00) on SuSE 9.3:

openxs@suse:~/dbs/5.0> cd ../5.1/mysql-test/
openxs@suse:~/dbs/5.1/mysql-test> ./mysql-test-run group_min_max
Stopping master cluster
Installing Test Databases
Removing Stale Files
Installing Master Databases
running  ../libexec/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=.. --datadir=mysql-test/var/master-data --skip-innodb --skip-ndbcluster --skip-bdb
Installing Master Databases 1
running  ../libexec/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=.. --datadir=mysql-test/var/master-data1 --skip-innodb --skip-ndbcluster
--skip-bdb
Installing Slave Databases
running  ../libexec/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=.. --datadir=mysql-test/var/slave-data --skip-innodb --skip-ndbcluster --skip-bdb
Manager disabled, skipping manager start.
Loading Standard Test Databases
Starting Tests

TEST                            RESULT
-------------------------------------------------------
group_min_max                  [ pass ]
-------------------------------------------------------

Ending Tests
Shutting-down MySQL daemon

Master shutdown finished
Slave shutdown finished
All 1 tests were successful.