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

Data truncated error with current_timestamp().000000 and mariaDB 10.2 #13968

Closed
anaaviles opened this Issue Feb 5, 2018 · 3 comments

Comments

Projects
None yet
5 participants
@anaaviles
Copy link

anaaviles commented Feb 5, 2018

Steps to reproduce

  1. Create a table with a field type TIMESTAMP ON DEFAULT CURRENT_TIMESTAMP
CREATE TABLE t (id int NOT NULL UNIQUE AUTO_INCREMENT, 
                              name VARCHAR(30), 
                               ts TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
  1. Go to Insert tab on phpmyadmin interface
  2. Check default value for TIMESTAMP field is current_timestamp().000000
  3. Click GO

Expected behaviour

Insert the row with the current date and time

Actual behaviour

Inserts the row with 0000-00-00 00:00:00 on the timestamp field, and shows a warning message in red:

Warning: #1265 Data truncated for column 'ts' at row 1

Server configuration

Operating system: Debian jessie

Web server: Apache 2.4

Database: mariaDB 10.2

PHP version: php7.1

phpMyAdmin version: 4.7.7

Client configuration

Browser: Firefox 57.0.4

Operating system: Ubuntu xenial

@anaaviles anaaviles changed the title current_timestamp().000000 with mariaDB 10.2 Data truncated error with current_timestamp().000000 and mariaDB 10.2 Feb 5, 2018

@larrylampco

This comment has been minimized.

Copy link

larrylampco commented Feb 19, 2018

I am experiencing this issue as well.
MariaDB version: 10.2.12
phpMyAdmin version: 5.6.30

@ibennetch

This comment has been minimized.

Copy link
Member

ibennetch commented Mar 1, 2018

This has the same symptoms as #13999; the function shown when using MariaDB is incorrect but it's correct with MySQL.

@ibennetch ibennetch added the bug label Mar 1, 2018

@mattiaskagstrom

This comment has been minimized.

Copy link

mattiaskagstrom commented Apr 10, 2018

Same issue here, the workaround is to manually clear the insert field, and set the function to "NOW".

I believe the line that's causing the problem is on line 2822 in libraries/classes/InsertEdit.php

https://github.com/phpmyadmin/phpmyadmin/blob/c73e72e7ca39304bbcd54399cb59c6fc92199d67/libraries/classes/InsertEdit.php

mattiaskagstrom added a commit to mattiaskagstrom/phpmyadmin that referenced this issue Apr 10, 2018

mattiaskagstrom added a commit to mattiaskagstrom/phpmyadmin that referenced this issue Apr 10, 2018

Fixes bug phpmyadmin#13968
Signed-off-by: Mattias Kågström <matkag@kth.se>

@mauriciofauth mauriciofauth self-assigned this May 8, 2018

@mauriciofauth mauriciofauth added this to the 4.8.1 milestone May 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.