[go: nahoru, domu]

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
Closed
Assignees
Labels
Bug A problem or regression with an existing feature
Milestone

Comments

@anaaviles
Copy link

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
Copy link

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

@ibennetch
Copy link
Member

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 A problem or regression with an existing feature label Mar 1, 2018
@mattiaskagstrom
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
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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2020
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
None yet
Development

No branches or pull requests

5 participants