title: The value inserted on table is always "null"; the both values passed to timediff() is a timedate(6)
body: <p>I think it should get a value of format datetime(). What is the error?</p>
  
  <pre><code>CREATE 
  DEFINER=`root`@`localhost` 
  TRIGGER `check` 
  BEFORE INSERT 
  ON `whatstore` 
  FOR EACH ROW 
  BEGIN
      declare last_insert_time datetime(6);
      declare new_insert_time datetime(6);
      set @last_insert_time=(select insert_time 
                             from whatstore 
                             order by id desc limit 1);    
      select timediff(new.insert_time,@last_inserted_time) into @new_insert_time;
      case when @new_insert_time &gt; 1 
           then insert into `delete`.table3(time_diff)  
                values (@new_inserted_time);
           else insert into `delete`.table3(time_diff)  
                values(@new_inserted_time);
      end case;
  END
  </code></pre>