title: Getting SQLEXCEPTION message in procedures MySQL 5.5.x
body: <p>How can I get error text in <strong>MySQL 5.5</strong> stored procedure when <code>SQLEXCEPTION</code> occurs?</p>
  
  <p>I need something along these lines to see what went wrong:</p>
  
  <pre><code>DECLARE EXIT HANDLER FOR SQLEXCEPTION    
  BEGIN
      GET DIAGNOSTICS CONDITION 1
      SELECT "Table @p5 (Msg State @p2): @p1"
  END;
  </code></pre>
  
  <p>Similar to <a href="https://stackoverflow.com/q/7873266/153923">Getting SQLEXCEPTION message in MySQL procedures</a>, but there the Version was 5.6.4 - so <strong>GET DIAGNOSTICS</strong> was available.</p>