title: mysql test IF variable IS NULL (or empty)
body: <p>we are selecting a row in mysql/mariadb and storing chosen columns in variables. After this, using <code>IF</code> we would like to test one of the variables and see if it has been set or is null, if it is then we assign it a value and continue on. </p>
  
  <p>Using <code>IS NULL</code> does not seem to work on a non expression.</p>
  
  <pre><code>select id,history,active,jsonorder
  INTO @id,@history,@active,@jsonorder
  from myTable where uid = myUid
  delimiter |
  IF @jsonorder IS NULL THEN
    @myNewVal="zzz";
  ELSE
    @myNewVal="yyy";
  END IF|
  insert into otherTable (colA) VALUES (@myNewVar);
  </code></pre>
  
  <p>What is the correct way to test if the <code>select</code> has provided a value into a variable such as <code>@jsonorder</code>?</p>