Description:
The instructions given in http://dev.mysql.com/doc/refman/5.5/en/upgrading-from-previous-series.html do not appear to work correctly when tables are both aliased and outside the default database. I cannot find a way to write the following statement against the sakila database if I use aliases and do not have a default database:
delete sakila.actor from sakila.actor inner join sakila.film_actor on actor.actor_id = film_actor.actor_id where sakila.actor.actor_id < 0
Without database-qualifying the table to delete from, I get "No database selected." If I database-qualify it, I get "Unknown table."
How to repeat:
mysql> delete actor from sakila.actor as a inner join sakila.film_actor as fa on a.actor_id = fa.actor_id where a.actor_id < 0;
ERROR 1046 (3D000): No database selected
mysql> delete a from sakila.actor as a inner join sakila.film_actor as fa on a.actor_id = fa.actor_id where a.actor_id < 0;
ERROR 1046 (3D000): No database selected
mysql> delete sakila.actor from sakila.actor as a inner join sakila.film_actor as fa on a.actor_id = fa.actor_id where a.actor_id < 0;
ERROR 1109 (42S02): Unknown table 'actor' in MULTI DELETE
mysql> delete sakila.a from sakila.actor as a inner join sakila.film_actor as fa on a.actor_id = fa.actor_id where a.actor_id < 0;
ERROR 1109 (42S02): Unknown table 'a' in MULTI DELETE