title: What is the proper way to test for null values in a trigger?
body: <p>I have a trigger set to fire on update. I'm working on an older version of mysql before it supported raising errors hence my call to a non-existent "raise_error" function that ends the trigger. I'm trying to prevent a field from being updated if a field is not null. My trigger looks like this:</p>
  
  <pre><code>IF (new.Value &lt;&gt; old.Value AND old.Value IS NOT NULL) THEN
          CALL raise_error;
  END IF;
  </code></pre>
  
  <p>This does not work since the following completes successfully:</p>
  
  <pre><code>UPDATE Table SET Value = NULL WHERE Value IS NOT NULL
  </code></pre>
  
  <p>What's wrong?</p>