Bug #27235 Naked wildcard can fail query
Submitted: 17 Mar 2007 11:05 Modified: 18 Mar 2007 17:50
Reporter: Jared S (Silver Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:5.0.36 OS:Windows (WinXP)
Assigned to: CPU Architecture:Any
Tags: qc, query, wilcard

[17 Mar 2007 11:05] Jared S
Description:
When query is performed with raw wildcard after named fields, it will fail.

How to repeat:
DROP TABLE IF EXISTS `test`.`new table`;
CREATE TABLE  `test`.`new table` (
  `id` int(10) unsigned NOT NULL auto_increment,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

mysql> select `id`, `new table`.* from `new table`;
Empty set (0.00 sec)

mysql> select `id`, * from `new table`;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* from `new table`' at line 1
[18 Mar 2007 15:16] Martin Friebe
this looks like Bug #26066.

I have been proposed a patch on the internals mailing list, but it looks that the sql standard actually is that an "unqualified" asterisk, must be first in the list

see http://lists.mysql.com/internals/34404
[18 Mar 2007 17:50] Valeriy Kravchuk
Duplicate of bug #26066.