time
TIMESTAMP NOT NULL DEFAULT 'CURRENT_TIMESTAMP' COMMENT '',
save timestamp default value error
What exactly is broken? I could just successfully add a datetime column to a table on MariaDB 10.3, with expressions in both default and in on update:
ALTER TABLE `test`
ADD COLUMN `Column 2` DATETIME NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP() AFTER `id`;
Note that query was generated by the table editor.
I'm on 12.5.0.6680 (MySQL 8.0.15) and the query i get is: "...DEFAULT CURRENT_TIMESTAMP() ON UPDATE (CURRENT_TIMESTAMP) AFTER..." doing it through the UI, which gives a 1064 error.
I assumed the bracket is misplaced in relation to the variable after "ON UPDATE" (i recall something similar happening in the past) but if it's not, i'll try to play more and find out why i get an invalid query.
This still isn't fixed in the latest version. This is the invalid query i get when copying a table:
CREATE TABLE
webshop.
test_table_copy(
test_columnTIMESTAMP NULL DEFAULT 'CURRENT_TIMESTAMP' ON UPDATE (CURRENT_TIMESTAMP)) COLLATE 'utf8mb4_0900_ai_ci' ENGINE=InnoDB ROW_FORMAT=Dynamic;
MySQL 8.0.15
Please login to leave a reply, or register at first.