Menu

Warning when assign now() + 0 to timestamp

Help
2006-12-05
2013-03-08
  • Stephen Gornick

    Stephen Gornick - 2006-12-05

    In utMySQL_pkg_TestSuite() the
       DECLARE iTimeStamp TIMESTAMP DEFAULT NOW() + 0;
    causes a
    Warning (Code 1265): Data truncated for column 'iTimeStamp' at row 1

    This is because now() + 0 returns decimals.
    http://forums.mysql.com/read.php?10,125443,125443#msg-125443

    A suggestion might be to use
      DECLARE iTimeStamp TIMESTAMP DEFAULT CAST((NOW() + 0) AS UNSIGNED);

    Or just ignore the warning ...

     
    • Warren Willmey

      Warren Willmey - 2006-12-08

      Hi Stephen,

      Thanks for all your input.
      Can you post the version of you MySQL because I'm not able to generate this warning.

       
    • Warren Willmey

      Warren Willmey - 2006-12-17

      Fixed for V 1.0.1

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.