Skip to content

Commit

Permalink
fix(mtr): load/export case run failed with incorrect terminerted #1329
Browse files Browse the repository at this point in the history
  • Loading branch information
hustjieke authored and mergify[bot] committed Mar 6, 2023
1 parent bd6f3cd commit 43fcede
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
42 changes: 42 additions & 0 deletions mysql-test/suite/tianmu/r/unsigned_support_issue1267.result
Original file line number Diff line number Diff line change
Expand Up @@ -394,4 +394,46 @@ i1 i2 i3 i4 i5 i6 i7
127 255 32767 65535 8388607 16777215 4294967295
-128 0 -32768 0 -8388608 0 0
DROP TABLE t1;
create table load_unsigned(
`ut` tinyint(3) unsigned DEFAULT NULL,
`us` smallint(5) unsigned DEFAULT NULL,
`um` mediumint(8) unsigned DEFAULT NULL,
`ui` int(10) unsigned DEFAULT NULL
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4;
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/suite/tianmu/std_data/load_export_unsigned.txt' INTO TABLE load_unsigned FIELDS TERMINATED BY ',';
Warnings:
Warning 1264 Out of range value for column 'ut' at row 5
Warning 1264 Out of range value for column 'us' at row 5
Warning 1264 Out of range value for column 'um' at row 5
Warning 1264 Out of range value for column 'ui' at row 5
Warning 1264 Out of range value for column 'ut' at row 6
Warning 1264 Out of range value for column 'us' at row 6
Warning 1264 Out of range value for column 'um' at row 6
Warning 1264 Out of range value for column 'ui' at row 6
Warning 1264 Out of range value for column 'ut' at row 7
Warning 1264 Out of range value for column 'us' at row 7
Warning 1264 Out of range value for column 'um' at row 7
Warning 1264 Out of range value for column 'ui' at row 7
select * from load_unsigned;
ut us um ui
0 0 0 0
127 32767 8388607 2147483647
128 32768 8388608 2147483648
255 65535 16777215 4294967295
0 0 0 0
0 0 0 0
255 65535 16777215 4294967295
select * into outfile "MYSQL_TEST_DIR/suite/tianmu/tmp/unsigned_outfile-test.txt" from load_unsigned;
truncate table load_unsigned;
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/suite/tianmu/tmp/unsigned_outfile-test.txt' INTO TABLE load_unsigned FIELDS TERMINATED BY ';';
select * from load_unsigned;
ut us um ui
0 0 0 0
127 32767 8388607 2147483647
128 32768 8388608 2147483648
255 65535 16777215 4294967295
0 0 0 0
0 0 0 0
255 65535 16777215 4294967295
drop table load_unsigned;
drop database unsigned_support;
10 changes: 5 additions & 5 deletions mysql-test/suite/tianmu/t/unsigned_support_issue1267.test
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ create table load_unsigned(
`ui` int(10) unsigned DEFAULT NULL
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4;

eval LOAD DATA LOCAL INFILE '$MYSQL_TEST_DIR/suite/tianmu/std_data/load_export_unsigned.txt' INTO TABLE load_unsigned;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval LOAD DATA LOCAL INFILE '$MYSQL_TEST_DIR/suite/tianmu/std_data/load_export_unsigned.txt' INTO TABLE load_unsigned FIELDS TERMINATED BY ',';
select * from load_unsigned;

disable_query_log;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval select * into outfile "$MYSQL_TEST_DIR/suite/tianmu/tmp/unsigned_outfile-test.txt" from load_unsigned;
disable_query_log;
truncate table load_unsigned;
eval LOAD DATA LOCAL INFILE '$MYSQL_TEST_DIR/suite/tianmu/std_data/unsigned_outfile-test.txt' INTO TABLE load_unsigned;
show warnings;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval LOAD DATA LOCAL INFILE '$MYSQL_TEST_DIR/suite/tianmu/tmp/unsigned_outfile-test.txt' INTO TABLE load_unsigned FIELDS TERMINATED BY ';';
select * from load_unsigned;
drop table load_unsigned;

Expand Down

0 comments on commit 43fcede

Please sign in to comment.