Bug #82225 | MySQL Workbench does not support NOW(6) in triggers | ||
---|---|---|---|
Submitted: | 14 Jul 2016 6:13 | Modified: | 17 Aug 2016 10:45 |
Reporter: | Kuba Gasiorowski | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Workbench: Modeling | Severity: | S3 (Non-critical) |
Version: | 6.3.7 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | MICROSECOND, NOW, timestamp, trigger |
[14 Jul 2016 6:13]
Kuba Gasiorowski
[14 Jul 2016 7:56]
MySQL Verification Team
Hello Kuba, Thank you for the report. Verifying the issue for the syntax error seen for NOW(6) which isn't seen in SQL Editor. Btw, the reason trigger is missing from the script is because it it invalid i.e if you try to modify NEW value in after trigger then it would surely complain. On 5.7.13 I see mysql> delimiter // mysql> CREATE DEFINER = CURRENT_USER TRIGGER account_update AFTER UPDATE ON account FOR EACH ROW -> BEGIN -> SET NEW.mod_timestamp = NOW(6); -> END// ERROR 1362 (HY000): Updating of NEW row is not allowed in after trigger mysql> delimiter ; Thanks, Umesh
[14 Jul 2016 7:57]
MySQL Verification Team
Screenshot..
Attachment: 82225_model.png (image/png, text), 34.52 KiB.
[14 Jul 2016 7:57]
MySQL Verification Team
Screenshot..
Attachment: 82225_sqleditor.png (image/png, text), 42.15 KiB.
[3 Aug 2016 9:39]
Mike Lischke
The additional time precision has been added in server 5.6.4. Did you set the version in your model to that value (or higher)? MySQL Workbench strictly checks language features against the server it connects (or, in the absence of a server, the model version).
[17 Aug 2016 10:45]
Kuba Gasiorowski
Setting the model DB version to 5.6.29 fixed the issue, indeed. Case may be closed.
[19 Aug 2016 7:54]
Mike Lischke
Great, thanks for letting us know it works for you now.