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

dump of on update missing fraction #11349

Closed
elvizlai opened this issue Jul 22, 2019 · 2 comments · Fixed by #11480
Closed

dump of on update missing fraction #11349

elvizlai opened this issue Jul 22, 2019 · 2 comments · Fixed by #11480
Assignees
Labels
type/bug The issue is confirmed as a bug.

Comments

@elvizlai
Copy link
Contributor

elvizlai commented Jul 22, 2019

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
    create table xyz using:
CREATE TABLE `xyz` (
  `id` varchar(36) NOT NULL,
  `create_at` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `update_at` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
  PRIMARY KEY (`id`)
);

then using mysql dump to extract structure.

  1. What did you expect to see(result from circleci/mysql:5.7)?
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for xyz
-- ----------------------------
DROP TABLE IF EXISTS `xyz`;
CREATE TABLE `xyz` (
  `id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
  `create_at` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `update_at` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

SET FOREIGN_KEY_CHECKS = 1;
  1. What did you see instead(result from TiDB)?
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for xyz
-- ----------------------------
DROP TABLE IF EXISTS `xyz`;
CREATE TABLE `xyz` (
  `id` varchar(36) NOT NULL,
  `create_at` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `update_at` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

SET FOREIGN_KEY_CHECKS = 1;

The ON UPDATE CURRENT_TIMESTAMP missing fraction

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    3.0.1

  2. Addon

explicit-defaults-for-timestamp has set ON

@elvizlai elvizlai added the type/bug The issue is confirmed as a bug. label Jul 22, 2019
@elvizlai elvizlai changed the title dump of ·on update dump of on update missing fraction Jul 22, 2019
@winkyao
Copy link
Contributor

winkyao commented Jul 22, 2019

@elvizlai Thanks for your report, @bb7133 will try to fix this issue.

@bb7133
Copy link
Member

bb7133 commented Jul 22, 2019

This issue is related to #11070, however, the ON_UPDATE CURRENT_TIMESTAMP parted is not fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants