Bug #4012 '' in select returns no rows
Submitted: 4 Jun 2004 16:34 Modified: 4 Jun 2004 16:53
Reporter: Thomas Mayer Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.20 OS:Linux (SuSE Linux 8.2)
Assigned to: Dean Ellis CPU Architecture:Any

[4 Jun 2004 16:34] Thomas Mayer
Description:
Using a String '' as Field in a select statements returns no rows in any case

How to repeat:
-- returns all rows with one column called Test and String 'Test' as value:
select 'Test' from test.testtable

-- returns all rows with one column called Test and String '' as value:
select '' as Test from test.testtable

-- returns an empty set (which is not expected behaviour):
select '' from test.testtable

Suggested fix:
The content of a constant string should have no effect wether all rows are returned or no row is returned.

In case a constant is empty, a unique column name should be generated (as it is the case when using two fields with the same field name)
[4 Jun 2004 16:53] Dean Ellis
I cannot repeat this with out 4.0.20 Standard binary, or the current development sources.

It returns '' (with empty column name as well) for each row in the table.

If you are trying this with our official binaries, please submit a test case consisting of the SQL to create, populate and query the table.  This really would not seem necessary for your case, but I cannot repeat the behavior you report.