forked from stoneatom/stonedb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tianmu): support in-completed column data during load data. (sto…
- Loading branch information
lujiashun
committed
Feb 4, 2023
1 parent
5dce241
commit bf09580
Showing
7 changed files
with
94 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
DROP DATABASE IF EXISTS issue1209_test; | ||
CREATE DATABASE issue1209_test; | ||
USE issue1209_test; | ||
# | ||
# load data exceeding 65553 rows with duplicate key | ||
# | ||
CREATE TABLE `t1` ( | ||
`id` int(11) DEFAULT NULL, | ||
`a` char(20) DEFAULT NULL | ||
) ENGINE=tianmu DEFAULT CHARSET=utf8mb4; | ||
LOAD DATA LOCAL infile 'MYSQL_TEST_DIR/suite/tianmu/std_data/issue1209-1.txt' into table t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY ';'; | ||
Warnings: | ||
Warning 1366 Incorrect integer value: ' | ||
' for column 'id' at row 4 | ||
select * from t1; | ||
id a | ||
1 chai | ||
2 测试 | ||
3 chayicha | ||
0 NULL | ||
truncate table t1; | ||
LOAD DATA LOCAL infile 'MYSQL_TEST_DIR/suite/tianmu/std_data/issue1209-2.txt' into table t1 FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY ';'; | ||
Warnings: | ||
Warning 1265 Data truncated for column 'id' at row 5 | ||
Warning 1265 Data truncated for column 'id' at row 5 | ||
select * from t1; | ||
id a | ||
1 chai | ||
2 测试 | ||
3 chayicha | ||
NULL NULL | ||
5 "; | ||
|
||
DROP DATABASE issue1209_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1,chai;2,测试;3,chayicha; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"1","chai";"2","测试";"3","chayicha";;"5";"4","; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--source include/have_tianmu.inc | ||
|
||
--disable_warnings | ||
DROP DATABASE IF EXISTS issue1209_test; | ||
--enable_warnings | ||
|
||
CREATE DATABASE issue1209_test; | ||
|
||
USE issue1209_test; | ||
|
||
--echo # | ||
--echo # load data exceeding 65553 rows with duplicate key | ||
--echo # | ||
|
||
CREATE TABLE `t1` ( | ||
`id` int(11) DEFAULT NULL, | ||
`a` char(20) DEFAULT NULL | ||
) ENGINE=tianmu DEFAULT CHARSET=utf8mb4; | ||
|
||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR | ||
eval LOAD DATA LOCAL infile '$MYSQL_TEST_DIR/suite/tianmu/std_data/issue1209-1.txt' into table t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY ';'; | ||
select * from t1; | ||
|
||
truncate table t1; | ||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR | ||
eval LOAD DATA LOCAL infile '$MYSQL_TEST_DIR/suite/tianmu/std_data/issue1209-2.txt' into table t1 FIELDS TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY ';'; | ||
select * from t1; | ||
|
||
|
||
DROP DATABASE issue1209_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters