We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please answer these questions before submitting your issue. Thanks!
$ cat a.csv 2019-02-01 00:00:00
load data local infile "/data1/a.csv" into table test_table1;
Table structure: MySQL [lianxi]> show create table test_table1 \G *************************** 1. row *************************** Table: test_table1 Create Table: CREATE TABLE test_table1 ( stime datetime DEFAULT NULL COMMENT '时间', id bigint(20) DEFAULT NULL COMMENT '编号', zone varchar(100) DEFAULT NULL COMMENT '地区', cnt bigint(20) DEFAULT NULL COMMENT '次数', updated timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, updated1 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', updated2 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY idx_id (id), KEY idx_zone (zone) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='测试表';
test_table1
stime
id
zone
cnt
updated
updated1
updated2
idx_id
idx_zone
MySQL [lianxi]> select * from test_table1 where stime='2019-02-01 00:00:00'; +---------------------+------+------+------+---------+---------------------+---------------------+ | stime | id | zone | cnt | updated | updated1 | updated2 | +---------------------+------+------+------+---------+---------------------+---------------------+ | 2019-02-01 00:00:00 | NULL | NULL | NULL | NULL | 2019-05-15 19:41:02 | 2019-05-15 19:41:02 | +---------------------+------+------+------+---------+---------------------+---------------------+
MySQL [test]> select * from test_table1 where stime='2019-02-01 00:00:00'; +---------------------+------+------+------+---------+---------------------+---------------------+ | stime | id | zone | cnt | updated | updated1 | updated2 | +---------------------+------+------+------+---------+---------------------+---------------------+ | 2019-02-01 00:00:00 | NULL | NULL | NULL | NULL | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | +---------------------+------+------+------+---------+---------------------+---------------------+
tidb-server -V
select tidb_version();
Release Version: v2.1.8 Git Commit Hash: 9a2d2da Git Branch: HEAD UTC Build Time: 2019-04-12 07:48:47 GoVersion: go version go1.11.2 linux/amd64 Race Enabled: false TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e Check Table Before Drop: false
The text was updated successfully, but these errors were encountered:
imtbkcat
Successfully merging a pull request may close this issue.
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
$ cat a.csv
2019-02-01 00:00:00
load data local infile "/data1/a.csv" into table test_table1;
Table structure:
MySQL [lianxi]> show create table test_table1 \G
*************************** 1. row ***************************
Table: test_table1
Create Table: CREATE TABLE
test_table1
(stime
datetime DEFAULT NULL COMMENT '时间',id
bigint(20) DEFAULT NULL COMMENT '编号',zone
varchar(100) DEFAULT NULL COMMENT '地区',cnt
bigint(20) DEFAULT NULL COMMENT '次数',updated
timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,updated1
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',updated2
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,KEY
idx_id
(id
),KEY
idx_zone
(zone
)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='测试表';
MySQL [lianxi]> select * from test_table1 where stime='2019-02-01 00:00:00';
+---------------------+------+------+------+---------+---------------------+---------------------+
| stime | id | zone | cnt | updated | updated1 | updated2 |
+---------------------+------+------+------+---------+---------------------+---------------------+
| 2019-02-01 00:00:00 | NULL | NULL | NULL | NULL | 2019-05-15 19:41:02 | 2019-05-15 19:41:02 |
+---------------------+------+------+------+---------+---------------------+---------------------+
MySQL [test]> select * from test_table1 where stime='2019-02-01 00:00:00';
+---------------------+------+------+------+---------+---------------------+---------------------+
| stime | id | zone | cnt | updated | updated1 | updated2 |
+---------------------+------+------+------+---------+---------------------+---------------------+
| 2019-02-01 00:00:00 | NULL | NULL | NULL | NULL | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |
+---------------------+------+------+------+---------+---------------------+---------------------+
tidb-server -V
or runselect tidb_version();
on TiDB)?Release Version: v2.1.8
Git Commit Hash: 9a2d2da
Git Branch: HEAD
UTC Build Time: 2019-04-12 07:48:47
GoVersion: go version go1.11.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered: