title: Trigger Unknown column 'OLD' in 'field list'
body: <p>I'm trying to create trigger on table <code>UsefulResources</code>.</p>
  
  <p>The trigger code looks like this:</p>
  
  <pre><code>create trigger TBD_UsefulResources before delete
  on UsefulResources for each row
  begin
      Update SystemCycle set CurrentCycle=CurrentCycle+1;
  
      INSERT INTO DeletedPhysically (TableName, PKName, PKValue, DelAtRowCycle, RowCycle, Created)
      VALUES ("UsefulResources", "Ufr_GUID", OLD.Ufr_GUID, (Select CurrentCycle From `SystemCycle` where Syc_ID=1), (Select CurrentCycle From `SystemCycle` where Syc_ID=1), now());
  end;
  </code></pre>
  
  <p>However I'm getting the following error if I want to execute it via mysql client:</p>
  
  <pre><code>mysql&gt; create trigger TBD_UsefulResources before delete
      -&gt; on UsefulResources for each row
      -&gt; begin
      -&gt;     Update SystemCycle set CurrentCycle=CurrentCycle+1;
  ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4
  mysql&gt;
  mysql&gt;     INSERT INTO DeletedPhysically (TableName, PKName, PKValue, DelAtRowCycle, RowCycle, Created)
      -&gt;     VALUES ("UsefulResources", "Ufr_GUID", OLD.Ufr_GUID, (Select CurrentCycle From `SystemCycle` where Syc_ID=1), (Select CurrentCycle From `SystemCycle` where Syc_ID=1), now());
  ERROR 1054 (42S22): Unknown column 'OLD.Ufr_GUID' in 'field list'
  mysql&gt; end;
  ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'end' at line 1
  mysql&gt;
  </code></pre>
  
  <p>When I execute that create trigger trough my client which is not checking sql syntax before execution it works fine on the server. </p>
  
  <p>Any idea?</p>