title: MySQL query fails in Python
body: <p>The following query works on MySQL Query Analyzer and PHP but fails in Python:</p>
  
  <pre><code>update home_recipient 
      set 
          process = 'PROCESS_ID', processed_on = current_timestamp
      where 
          sent_on is null or  
          timestampdiff(minute, processed_on, current_timestamp) &gt; 60
      order by id limit 45
  </code></pre>
  
  <p>The error displayed is "You can't specify target table 'home_recipient' for update in FROM clause"</p>
  
  <p>I'm using Python 2.7 and MySQL_python-1.2.3-py2.7.egg</p>
  
  <p>The error seems to be generated by Python's driver because que query works everywhere else.</p>
  
  <p>Is there a way to tell MySQL_python to stop interpreting the query and pass it "as is" to MySQL?</p>
  
  <p>EDIT: This is the code that executes the query.</p>
  
  <pre><code>sql = """update home_recipient set process = 'PROCESS_ID', processed_on = current_timestamp
      where sent_on is null or timestampdiff(minute, processed_on, current_timestamp) &gt; 60
      order by id limit 45"""
  cursor = connection.cursor()
  cursor.execute(sql)
  </code></pre>
  
  <p>OK. This is getting ridiculous. Even removing everything else from the update shows the same error:</p>
  
  <pre><code>sql = """update home_recipient set process = 'PROCESS_ID', processed_on = current_timestamp"""
  cursor = connection.cursor()
  cursor.execute(sql)
  </code></pre>
  
  <p>Any help?</p>
  
  <p>Thanks</p>