Bug #9383 INFORMATION_SCHEMA.COLUMNS, JOIN, Crash, prepared statement
Submitted: 24 Mar 2005 15:14 Modified: 26 Apr 2005 0:37
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0 OS:
Assigned to: Sergei Glukhov CPU Architecture:Any

[24 Mar 2005 15:14] Matthias Leich
Description:
If I execute a prepared statement with a simple join of 
INFORMATION_SCHEMA.COLUMNS with another table 
more than on time the server crashes.
Example from the NIST tests:

SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS A,
         INFORMATION_SCHEMA.COLUMNS B
WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
     AND A.TABLE_NAME = B.TABLE_NAME
     AND A.COLUMN_NAME = B.COLUMN_NAME
The statement does not look very useful for customer needs.
However the very probable statement:
SELECT A.TABLE_NAME, A.COLUMN_NAME, A.DATA_TYPE
                FROM INFORMATION_SCHEMA.COLUMNS A,
                     t1               B
                WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
                  AND A.TABLE_NAME   = B.TABLE_NAME
where table B could contain useful userdefined data crashes too.
The crash will disappear, if t1 is the first mentioned join table.
Please have a look into the attached test case. It contains
several crashing and non crashing statements for comparison.
My environment:
   - Intel PC with Linux(SuSE 9.1)
   - MySQL compiled from source
        Version 5.0 ChangeSet@1.1837, 2005-03-24

How to repeat:
Please use my attached test file ml56.test , copy it to mysql-test/t
  ./mysql-test-run ml56
[24 Mar 2005 15:15] Matthias Leich
Test case

Attachment: ml56.test (application/test, text), 2.48 KiB.

[24 Mar 2005 16:01] Matthias Leich
I forgot one step:
Please create a dummy file with expected results via
   touch r/ml56.result
just before starting mysql-test-run  .
[1 Apr 2005 7:12] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23553
[5 Apr 2005 11:09] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23660
[5 Apr 2005 11:10] Sergei Glukhov
Fixed in 5.0.4
[26 Apr 2005 0:37] Paul DuBois
Noted in 5.0.4 changelog.