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
For the last part of https://dev.mysql.com/doc/refman/8.0/en/load-data.html, load data support column/variable list and SET clause is useful if we want to load only some of a table's columns or import BINARY, VARBINARY and BIT data into TiDB.
create a table with a binary column.
CREATE TABLE `ld` (`v` binary(1) DEFAULT NULL );
prepare a data file in /home/data/test.txt with content
1
load data into binary column using
LOAD DATA LOCAL INFILE '/home/robi/data' INTO TABLE ld FIELDS TERMINATED BY ',' (@var1) set v = unhex(@var1);
and do a select
select * from ld;
What did you expect to see?
mysql> LOAD DATA LOCAL INFILE '/home/robi/data' INTO TABLE ld FIELDS TERMINATED BY ',' (@var1) set v = unhex(@var1);
Query OK, 1 row affected (0.01 sec)
Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
mysql> select * from ld;
+------+
| v |
+------+
| � |
+------+
1 row in set (0.00 sec)
What did you see instead?
mysql> LOAD DATA LOCAL INFILE '/home/robi/data' INTO TABLE ld FIELDS TERMINATED BY ',' (@var1) set v = unhex(@var1);
ERROR 1105 (HY000): line 1 column 86 near ") set v = unhex(@var1)" (total length 108)
What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
2.0.6
The text was updated successfully, but these errors were encountered:
For the last part of https://dev.mysql.com/doc/refman/8.0/en/load-data.html, load data support column/variable list and SET clause is useful if we want to load only some of a table's columns or import BINARY, VARBINARY and BIT data into TiDB.
/home/data/test.txt
with contentand do a select
tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: