Bug #106383 | ALTER column SET DEFAULT syntax does not work with CURRENT_TIMESTAMP | ||
---|---|---|---|
Submitted: | 4 Feb 2022 18:46 | Modified: | 11 Jan 2023 15:17 |
Reporter: | Shane Bishop | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 5.7 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[4 Feb 2022 18:46]
Shane Bishop
[6 Feb 2022 7:25]
MySQL Verification Team
Hello Shane, Thank you for the report and feedback. regards, Umesh
[5 Oct 2022 12:07]
MySQL Verification Team
actually the correct 8.0 syntax is: ALTER TABLE xy_ewwwio_images ALTER updated SET DEFAULT(CURRENT_TIMESTAMP); Doesn't seem to work on 5.7 though, so this is probably a documentation bug.
[5 Oct 2022 12:32]
MySQL Verification Team
Take a look at the 5.7 sql grammar: https://github.com/mysql/mysql-server/blob/mysql-5.7.39/sql/sql_yacc.yy#L8304 it can only do: ALTER opt_column field_ident SET DEFAULT signed_literal Whereas the 8.0 grammar: https://github.com/mysql/mysql-server/blob/mysql-8.0.30/sql/sql_yacc.yy#L7440 can do: DEFAULT_SYM now_or_signed_literal DEFAULT_SYM '(' expr ')' Thus converting this to a docs bug.
[11 Jan 2023 15:17]
Christine Cole
Posted by developer: Fixed in the MySQL 5.7.41 Reference Manual (not yet released). Thank you for the report.