You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
load data local infile 'data.csv' into table t fields terminated by ',' (id, @c) set c=upper(@c);
What did you expect to see?
This should load the data from the file into the table, setting the value of column c to the uppercased value of the 2nd column in the CSV file, as occurs in MariaDB:
MariaDB [test]> load data local infile 'data.csv' into table t fields terminated by ',' (id, @c) set c=upper(@c);
Query OK, 1 row affected (0.002 sec)
Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
MariaDB [test]> select * from t;
+----+------+
| id | c |
+----+------+
| 1 | C |
+----+------+
1 row in set (0.001 sec)
What did you see instead?
TiDB [test]> load data local infile 'data.csv' into table t fields terminated by ',' (id, @c) set c=upper(@c);
Query OK, 1 row affected (0.01 sec)
Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
TiDB [test]> select * from t;
+----+------+
| id | c |
+----+------+
| 1 | NULL |
+----+------+
1 row in set (0.00 sec)
What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
tidb_version(): Release Version: v3.0.3
Git Commit Hash: 836982c617fbaa42d74616eb9ba9ed4cae46c46b
Git Branch: HEAD
UTC Build Time: 2019-08-29 04:59:41
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered:
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
data.csv:
table:
statement:
This should load the data from the file into the table, setting the value of column
c
to the uppercased value of the 2nd column in the CSV file, as occurs in MariaDB:tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: