title: DELETE with alias reference impossible without selecting a db since MySQL 5.5.3?
body: <p>I used to do complex multi-table DELETEs like this:</p>
  
  <pre><code>DELETE db1.t1 FROM db1.table1 AS t1, db1.table2 AS t2...
  </code></pre>
  
  <p>now after upgrading to MySQL 5.5.5 that doesn't work anymore because according to documentation since 5.5.3 alias names are not allowed to be qualified with db name in a DELETE statement.
  so I should do this:</p>
  
  <pre><code>DELETE t1 FROM db1.table1 AS t1, db1.table2 AS t2...
  </code></pre>
  
  <p>which doesn't work either due to <a href="http://bugs.mysql.com/bug.php?id=61376" rel="noreferrer">bug #61376</a> and gives ERROR 1046 (3D000): No database selected.</p>
  
  <p>I don't <em>USE</em> a database because my code should be integrateable in unknown environments and selecting a db might break existing code.</p>
  
  <p>Should I assume that DELETE statement with alias reference is impossible without selecting a database since MySQL 5.5.3 and I should start looking for a dirty hack or do you know a clean solution to this?</p>
  
  <hr>
  
  <p>update:</p>
  
  <p>Adding a <code>USE db1</code> before this query when there is no db selected (Bill Karwin's suggestion):</p>
  
  <pre><code>DELETE t1 FROM db1.table1 AS t1, db1.table2 AS t2...
  </code></pre>
  
  <p>makes it work in 5.5.5, but both in 4.1 and 5.1 it gives this error:</p>
  
  <pre><code>ERROR 1109 (42S02): Unknown table 't1' in MULTI DELETE
  </code></pre>
  
  <p>I think for now I'm going to give up using aliases altogether and instead use full db.table name everywhere which makes the queries big and unreadable but I can't think of any better solution.</p>