Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot edit or export TIMESTAMP column with default CURRENT_TIMESTAMP in MySQL >= 8.0.13 #15315

Closed
domenk opened this issue Jun 9, 2019 · 3 comments
Labels
Bug A problem or regression with an existing feature
Projects

Comments

@domenk
Copy link
Contributor

domenk commented Jun 9, 2019

Describe the bug

phpMyAdmin behaves weirdly when trying to edit or export TIMESTAMP column with default value of CURRENT_TIMESTAMP. It simply ignores the column if you try to edit it or export it.

To Reproduce

  1. Create a table with TIMESTAMP column (default should be CURRENT_TIMESTAMP):
CREATE TABLE `timestamp_test` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY(`id`)
);
  1. Insert new row:
INSERT INTO `timestamp_test` (`id`) VALUES (NULL);

3a. Edit the row and change value of timestamp column. When saving, new value will be ignored.

3b. Export the table. CREATE TABLE will contain timestamp column, but exported rows won't – only id column will be exported.

Expected behavior

You should be able to edit and export TIMESTAMP column.

Server configuration

  • Operating system: Windows
  • Web server: Apache 2.4.39
  • Database version: MySQL 8.0.16
  • PHP version: 7.2.9 and 7.3.6
  • phpMyAdmin version: 4.9.0.1

Additional context

It looks like this issue appeared with MySQL 8.0.13. With MySQL 8.0.12 phpMyAdmin works as expected.

Culprit may be DEFAULT_GENERATED Extra property for columns with default value of CURRENT_TIMESTAMP that appeared in 8.0.13 but wasn't present in 8.0.12. Although changelog for 8.0.13 does not directly mention this change, it may be caused by the very last change in the changelog (bug #88619).

@williamdes williamdes added the Bug A problem or regression with an existing feature label Jun 9, 2019
@williamdes williamdes added this to Needs triage in issues via automation Jun 9, 2019
@williamdes
Copy link
Member

@domenk Thanks for reporting !

SHOW COLUMNS FROM timestamp_test
Field Type Null Key Default Extra  
id int(10) unsigned NO PRI NULL auto_increment
timestamp timestamp NO   CURRENT_TIMESTAMP DEFAULT_GENERATED

@williamdes williamdes moved this from Needs triage to ready to merge in issues Jun 9, 2019
williamdes added a commit that referenced this issue Jun 9, 2019
Signed-off-by: William Desportes <williamdes@wdes.fr>
@williamdes
Copy link
Member

Fixed by 64dc204

issues automation moved this from ready to merge to Closed Jun 19, 2019
@toitzi
Copy link

toitzi commented Apr 14, 2020

@williamdes Can we reopen this? The problem still exists for me on two different servers.
Direct dump with mysqldump works as expected, just dumping over phpmyadmin does not work

Server 1 configuration

Operating system: Ubuntu
Web server: Nginx/1.17.9
Database version: MySQL 8.0.19
PHP version: 7.4.3
phpMyAdmin version: 5.0.2

Server 2 configuration

Operating system: Debian
Web server: Apache/2.4.38
Database version: MySQL 8.0.19
PHP version: 7.3.14
phpMyAdmin version: 4.9.4

Table Definition

# Name Type Collation Attribute Null Default Extra
1 ID int UNSIGNED NO AUTO_INCREMEMT
2 xyv int UNSIGNED NO
3 xyz varchar(50) utf8_general_ci NO
4 timestamp timestamp on update CURRENT_TIMESTAMP NO CURRENT_TIMESTAMP DEFAULT_GENERATED ON UPDATE CURRENT_TIMESTAMP

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature
Projects
issues
  
Closed
Development

No branches or pull requests

3 participants