title: MySQL Trigger Check if Row Field Exists
body: <p>I created a trigger on a table as follows:</p>
  
  <pre><code>delimiter //
  CREATE TRIGGER tb_ins BEFORE UPDATE ON tb
  FOR EACH ROW
  BEGIN
      IF (NEW.size &lt;&gt; size) THEN
  
      END IF;
  END;//
  </code></pre>
  
  <p>The problem is, individually updating any field other than <code>size</code> gives me an error that no such field is found.</p>
  
  <p>For instance:</p>
  
  <pre><code>UPDATE tb SET color = 'red' WHERE id = 1;
  </code></pre>
  
  <p>Gives me an error that no field is found because the update does not contain a <code>size</code> field which the trigger requires.</p>
  
  <p>I need to know if there's a way to check if a specific <code>ROW</code> field exists in my trigger function. How can this be accomplished?</p>
  
  <p>I need something equivalent to:</p>
  
  <pre><code>IF EXISTS(ROW.size) THEN
  
  END IF;
  </code></pre>