Bug #28034 crash on ... WHERE <UNIQUE column>=<value> OR NOT(<same column>=<same value>)
Submitted: 23 Apr 2007 19:02
Reporter: Hakan Küçükyılmaz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[23 Apr 2007 19:02] Hakan Küçükyılmaz
Description:
crash on SELECT .. WHERE <UNIQUE column>=<value> OR NOT(<same column>=<same value>)

How to repeat:
# Testcase derived from the NIST tests
# schema1, basetab, dml024
# SCHEMA,USER: HU, TABLE: STAFF

SET SESSION STORAGE_ENGINE=jstar;

CREATE TABLE t1
(EMPNUM CHAR(3) NOT NULL UNIQUE,
EMPNAME CHAR(20),
GRADE DECIMAL(4),
CITY CHAR(15));

INSERT INTO t1 VALUES ('E1','Alice',12,'Deale');

SELECT EMPNUM,CITY
FROM t1
WHERE EMPNUM='E1' OR NOT(EMPNUM='E1');
2013: Lost connection to MySQL server during query

Attention:
   The variants
      WHERE EMPNUM='E1' OR EMPNUM='E2' without NOT
      WHERE NOT(EMPNUM='E1') without first condition
      WHERE EMPNUM='E1' without second condition
      WHERE EMPNUM='E1' OR NOT(EMPNUM='E2') first value ('E1') <> second ('E2')
      WHERE EMPNUM='E1' OR NOT(CITY='ABC') column CITY instead of EMPNUM
   are harmless.
   The crash disappears also when I remove the UNIQUE constraint.

So it looks like the combination <column> IS UNIQUE and
WHERE <column>=<value> OR NOT(<same column>=<same value>)
crashes the server.
[23 Apr 2007 19:02] Hakan Küçükyılmaz
Test case is falcon_bug_28034.test.