Bug #6142 SELECT DISTINCT on key field crashes server
Submitted: 18 Oct 2004 18:01 Modified: 20 Oct 2004 18:25
Reporter: Hakan Kuecuekyilmaz
Status: Closed
Category:Server Severity:S1 (Critical)
Version:5.0.2bk OS:Linux (Linux)
Assigned to: Ramil Kalimullin Target Version:

[18 Oct 2004 18:01] Hakan Kuecuekyilmaz
Description:
Following constellation crashes the server:

How to repeat:
CREATE TABLE "DD40L" (
  "TYPENAME" varchar(30),
  "AS4LOCAL" char(1),
  "ROWTYPE" varchar(30),
  PRIMARY KEY  ("TYPENAME","AS4LOCAL"),
  KEY "DD40L~1" ("ROWTYPE")
) Engine=InnoDB;

SELECT DISTINCT TYPENAME FROM DD40L;

[18:05] root@test> SELECT DISTINCT TYPENAME FROM DD40L;
ERROR 2013 (HY000): Lost connection to MySQL server during query
5.0.2-alpha-debug-log
[18 Oct 2004 19:43] Hartmut Holzgraefe
With the shorter (and *working*) example below i was able to verify this on latest 5.0 bk
source.  On 5.0.1 it works just fine

DROP TABLE IF EXISTS t;

CREATE TABLE t (
  a varchar(30),
  b varchar(30),
  PRIMARY KEY  (a)
  , KEY (b)
) Engine=InnoDB;

SELECT DISTINCT a FROM t;
[20 Oct 2004 18:25] Ramil Kalimullin
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