Bug #28782 | Alias with union all & order by & subquery crashes session | ||
---|---|---|---|
Submitted: | 30 May 2007 17:44 | Modified: | 31 May 2007 0:49 |
Reporter: | Igor Monakhov | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: General | Severity: | S2 (Serious) |
Version: | 5.0.37-max-log | OS: | Linux (MySQL-Max-5.0.37-0.glibc23.i386.rpm) |
Assigned to: | CPU Architecture: | Any |
[30 May 2007 17:44]
Igor Monakhov
[30 May 2007 18:18]
Valeriy Kravchuk
Thank you for a problem report. Sorry, but I was not able to repeat the crash with latest 5.0.44-BK on Linux: openxs@suse:~/dbs/5.0> bin/mysql -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.44-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> drop table if exists x; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> create table x (id int, val1 int, val2 int); Query OK, 0 rows affected (0.01 sec) mysql> insert into x values (0,1,2),(1,2,3); Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> select * from (select id, val1 from x union all select id, val2 from x -> order by val1) base; +------+------+ | id | val1 | +------+------+ | 0 | 1 | | 1 | 2 | | 0 | 2 | | 1 | 3 | +------+------+ 4 rows in set (0.03 sec) mysql> select * from (select id, val1 CRASH_ALIAS from x union all select id, -> val2 from x order by CRASH_ALIAS) base; +------+-------------+ | id | CRASH_ALIAS | +------+-------------+ | 0 | 1 | | 1 | 2 | | 0 | 2 | | 1 | 3 | +------+-------------+ 4 rows in set (0.01 sec)
[31 May 2007 0:49]
Igor Monakhov
You've read unwell: select * from (select id, val1 from x union all select id, val2 from x order by val1) base; -- ok select * from (select id, val1 CRASH_ALIAS from x union all select id, val2 from x order by CRASH_ALIAS) base; -- ok select * from (select id, val1 CRASH_ALIAS from x union all select id, val2 from x order by val1) base; -- CRASH!
[31 May 2007 5:21]
Valeriy Kravchuk
Still no crash - just proper error message: openxs@suse:~/dbs/5.0> bin/mysql -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.44-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> select * from (select id, val1 CRASH_ALIAS from x union all select id, v al2 from x order by CRASH_ALIAS) base; +------+-------------+ | id | CRASH_ALIAS | +------+-------------+ | 0 | 1 | | 1 | 2 | | 0 | 2 | | 1 | 3 | +------+-------------+ 4 rows in set (0.01 sec) mysql> select * from (select id, val1 CRASH_ALIAS from x union all select id, v al2 from x order by val1) base; ERROR 1054 (42S22): Unknown column 'val1' in 'order clause'