-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Parsing datetime
when insert is not compatible with MySQL
#9762
Comments
insert
with datetime
is not compatible with MySQLdatetime
when insert is not compatible with MySQL
For now, Line 1347 in 0b037aa
Maybe we should use Lines 1342 to 1343 in 0b037aa
|
Confirming this issue still exists in master: drop table if exists t1;
create table t1 (t datetime) ENGINE=InnoDB;
insert ignore into t1 values (20030100000000),(20030000000000);
select * from t1;
select tidb_version()\G
..
mysql> select * from t1;
+---------------------+
| t |
+---------------------+
| 2003-01-00 00:00:00 |
| 2003-00-00 00:00:00 |
+---------------------+
2 rows in set (0.00 sec)
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-762-g77aecd4b2
Edition: Community
Git Commit Hash: 77aecd4b27e79a97215eb4fdd68f68f2ddf67d21
Git Branch: master
UTC Build Time: 2020-07-13 01:43:31
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
|
Confirm that this bug had been fixed in master, not in v4.0.8. mysql> drop table if exists t1;
Query OK, 0 rows affected (0.01 sec)
mysql> create table t1 (t datetime) ENGINE=InnoDB;
Query OK, 0 rows affected (0.01 sec)
mysql> insert ignore into t1 values (20030100000000),(20030000000000);
Query OK, 2 rows affected, 2 warnings (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 2
mysql> select * from t1;
+---------------------+
| t |
+---------------------+
| 0000-00-00 00:00:00 |
| 0000-00-00 00:00:00 |
+---------------------+
2 rows in set (0.00 sec)
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-beta.2-1735-g8ec67d63b
Edition: Community
Git Commit Hash: 8ec67d63bbcaac5a4da540da1aaf88118c3ca15e
Git Branch: master
UTC Build Time: 2020-12-08 06:06:14
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec) |
Fixed by #20206 |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versionsv5.0.0-rc |
( component or sig(label) AffectedVersions ) fields are empty. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
In Mysql
In TiDB
tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: