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

Incompatible behaviour for insert ignore processing incorrect time value #24271

Open
cfzjywxk opened this issue Apr 25, 2021 · 0 comments
Open
Labels
severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug. type/compatibility

Comments

@cfzjywxk
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `tbl_0` (
  `col_0` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `col_1` bigint(20) unsigned NOT NULL,
  `col_2` char(231) CHARACTER SET utf8 NOT NULL DEFAULT 'DMj',
  `col_3` bit(1) NOT NULL,
  `col_4` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`col_1`,`col_0`,`col_4`,`col_2`,`col_3`),
  UNIQUE KEY `idx_1` (`col_3`,`col_4`),
  KEY `idx_2` (`col_1`,`col_0`)
)

insert  ignore into tbl_0 set col_1 = 107571123720455541 on duplicate key update col_3 = 0;

select * from tbl_0;

2. What did you expect to see? (Required)

select * from tbl_0;
+---------------------+--------------------+-------+--------------+-------+
| col_0               | col_1              | col_2 | col_3        | col_4 |
+---------------------+--------------------+-------+--------------+-------+
| 2021-04-25 18:11:38 | 107571123720455541 | DMj   | 0x00         |     0 |
+---------------------+--------------------+-------+--------------+-------+
1 row in set (0.00 sec)

The result of col_0 contains a correct time value.

3. What did you see instead (Required)

mysql> select * from tbl_0;
+---------------------+--------------------+-------+--------------+-------+
| col_0               | col_1              | col_2 | col_3        | col_4 |
+---------------------+--------------------+-------+--------------+-------+
| 0000-00-00 00:00:00 | 107571123720455541 | DMj   | 0x00         |     0 |
+---------------------+--------------------+-------+--------------+-------+

The result of col_0 contains a invalid time value.

4. What is your TiDB version? (Required)

master branch with 4ac76b4 commit hash

Seems the meaning of ON UPDATE CURRENT_TIMESTAMP is not compatible.

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

No branches or pull requests

1 participant