Bug #23743 * and "as" in SELECT statement with JOIN causes lost of connection during query
Submitted: 28 Oct 2006 15:58 Modified: 30 Oct 2006 11:49
Reporter: Mathias Kahl Email Updates:
Status: Can't repeat Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.10a OS:Linux (Linux (SuSe 9.3))
Assigned to: CPU Architecture:Any
Tags: as, asterisk, during query, join, Lost connection, SELECT

[28 Oct 2006 15:58] Mathias Kahl
Using an asterisk and "as" in a SELECT statement on a JOIN of two tables causes the "Lost Connection During Query" error. 

The query works in version 5.0.18, not in 4.1.10a, though. 

How to repeat:
Example query: 
SELECT *,table2.field as `something` FROM table1,table2 WHERE 1

Just join two tables and use a SELECT with * and using "as".

Suggested fix:
Client side fix: Avoid using * and "as" when joining two tables with MySQL version  4.1.10a
[28 Oct 2006 16:01] Mathias Kahl
(just edited the tags)
[28 Oct 2006 22:25] Hartmut Holzgraefe
can't reproduce with 4.1.10a, can you please do the following:

- check whether you can reproduce this on the current 4.1.21 release
  (as 4.1.10a is pretty outdated)

- provide CREATE TABLE statements 

- provide sample table data unless the statement fails 
  on empty tables already
[29 Oct 2006 9:42] Mathias Kahl
I know that version 4.1.10a is outdated. Still, a rather big provider, HostEurope, seems to be using it for their Linux V-Servers. (And my problem is, that my client is hosting his website on one of those)

Unfortunately i don't have access to 4.1.21 .

I will attach a SQL file with CREATE statements for both actual tables and sample data, as well as a query that produces the Lost Connection error.
[29 Oct 2006 9:44] Mathias Kahl
two real tables, the error occured on, and sample data, as well as the query that causes the lost connection error

Attachment: temp.sql (text/x-sql), 13.45 KiB.

[30 Oct 2006 11:49] Sveta Smirnova
Thank you for the report.

I can not repeat it using current BK sources.