Bug #46379 Use of table alias in DELETE fails in 5.1; succeeds in 5.0
| Submitted: | 24 Jul 2009 20:53 | Modified: | 24 Jul 2009 22:27 |
|---|---|---|---|
| Reporter: | Greg Ferrar | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server: Parser | Severity: | S2 (Serious) |
| Version: | 5.1.36 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | alias, delete, error, syntax | ||
[24 Jul 2009 20:53]
Greg Ferrar
[24 Jul 2009 21:59]
MySQL Verification Team
miguel@lara:~/dbs/5.1$ bin/mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.1.38-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use test Database changed mysql> create table main_table (date_time datetime); Query OK, 0 rows affected (0.01 sec) mysql> delete from main_table x using main_table x where (x.date_time < '2009-06-30 14:45:38'); 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 'x using main_table x where (x.date_time < '2009-06-30 14:45:38')' at line 1 mysql> exit Bye miguel@lara:~/dbs/5.1$ bin/mysqladmin -uroot shutdown miguel@lara:~/dbs/5.1$ cd .. miguel@lara:~/dbs$ cd 5.0 miguel@lara:~/dbs/5.0$ bin/mysql -uroot test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.85-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create table main_table (date_time datetime); Query OK, 0 rows affected (0.01 sec) mysql> delete from main_table x using main_table x where (x.date_time < '2009-06-30 14:45:38'); Query OK, 0 rows affected (0.01 sec) mysql>
[24 Jul 2009 22:27]
MySQL Verification Team
Thank you for the bug report. Please read the last 2 comments of bug: http://bugs.mysql.com/bug.php?id=30234 for explanation of this behavior on 5.0 and 5.1+. Thanks in advance.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.052 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.