title: Rails+InnoDB: How to get complete SQL query from transaction ID
body: <p>I'm trying to debug a deadlock happening on the server.
  Running the below command on the rails console provides me with the transaction ID of the two transactions that are causing the deadlock</p>
  <pre><code> ActiveRecord::Base.connection.execute(&quot;SHOW ENGINE INNODB STATUS&quot;).each{|row| puts row}
  </code></pre>
  <p>It also provides me the query that is being executed by the transaction but the query is lengthy and hence is getting truncated.
  Is there a way I can get the complete SQL query from the transaction ID?</p>