Bug in UNION statement with alias "*"

Bug in UNION statement with alias "*"

am 11.09.2003 00:16:44 von Giuseppe Maxia

Hi.
Please find below the description of this uncommon bug.

Best regards

Giuseppe Maxia


>Description:
When issuing a UNION query with a column having an alias starting
with a '*' (star/asterisk) character, the database returns an
error:
ERROR 1051: Unknown table ''

>How-To-Repeat:

select version() as `*` UNION select user() as `anything`;
Notice that the '*' is properly quoted with inverse quotes.
The simple statement
SELECT version() AS `*`;
works fine. The error only shows up with UNION.

The problem came out when I was using a program that converted
column values into column headers for a cross-tabulation. One
of the values was '*' and it caused the error.

>Fix:
Using a different alias. ;-)
Notice that the bug does not show up in version 4.1

>Originator: Giuseppe Maxia
>Organization: StarData
>MySQL support: I am a MySQL Support Partner
>Synopsis: bug in UNION with alias
>Severity: serious
>Priority: low
>Category: mysql
>Class: sw-bug
>Release: mysql-4.0.13 (Official MySQL RPM) (also tested on mysql-4.0.15)
>Server: /usr/bin/mysqladmin Ver 8.40 Distrib 4.0.13, for pc-linux on i686

Server version 4.0.13-log (also tested on mysql-4.0.15)
Protocol version 10





--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: Bug in UNION statement with alias "*"

am 11.09.2003 16:35:55 von indrek siitan

Hi,

>> Description:
> When issuing a UNION query with a column having an alias starting
> with a '*' (star/asterisk) character, the database returns an
> error:
> ERROR 1051: Unknown table ''
>=20
>> How-To-Repeat:
>=20
> select version() as `*` UNION select user() as `anything`;
> Notice that the '*' is properly quoted with inverse quotes.
> The simple statement
> SELECT version() AS `*`;
> works fine. The error only shows up with UNION.

Thanks for a fine bug report. This has been filed as bug #1249. You can
follow its progress at: http://bugs.mysql.com/bug.php?id=3D1249


Rgds,
Indrek

--=20
| Indrek Siitan, MySQL AB, Support Engineer & Bugmaster
| Uuem=F5isa, Haapsalu, Estonia
+-=20
| Are you MySQL Certified? http://www.mysql.com/certification/
--


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=3Dgcdmb-bugs@m.gmane.org