diff options
author | unknown <petr@mysql.com> | 2006-03-29 06:28:57 +0400 |
---|---|---|
committer | unknown <petr@mysql.com> | 2006-03-29 06:28:57 +0400 |
commit | 5a6b8bc4c7896f8b1f06018d16f70d52e80bdb77 (patch) | |
tree | 5b20a87de3a35a93584ecf926b1aa1ffc94e8464 /mysql-test/t/csv.test | |
parent | e4397a0b8048e381b7d13a54fc78e921a0882764 (diff) | |
download | mariadb-git-5a6b8bc4c7896f8b1f06018d16f70d52e80bdb77.tar.gz |
Post-review fixes for WL#3154 "Enable REPAIR for CSV tables"
mysql-test/r/csv.result:
update result file
mysql-test/t/csv.test:
add more tests
storage/csv/ha_tina.cc:
post-review fixes & cleanup
storage/csv/ha_tina.h:
post-review fixes
Diffstat (limited to 'mysql-test/t/csv.test')
-rw-r--r-- | mysql-test/t/csv.test | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index 3d23a838762..b72d4cc92be 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1425,6 +1425,53 @@ REPAIR TABLE test_repair_table3; SELECT * FROM test_repair_table3; DROP TABLE test_repair_table3; +# Test with more sophisticated table + +CREATE TABLE test_repair_table4 ( + num int not null, + magic_no int(4) unsigned zerofill DEFAULT '0000' NOT NULL, + company_name char(30) DEFAULT '' NOT NULL, + founded char(4) DEFAULT '' NOT NULL +) ENGINE = CSV; + +--exec rm $MYSQLTEST_VARDIR/master-data/test/test_repair_table4.CSM +SELECT * FROM test_repair_table4; +SELECT * FROM test_repair_table4; +CHECK TABLE test_repair_table4; + +INSERT INTO test_repair_table4 VALUES (2,101,'SAP','1972'); +INSERT INTO test_repair_table4 VALUES (1,101,'Microsoft','1978'); +INSERT INTO test_repair_table4 VALUES (2,101,'MySQL','1995'); + +# list table content +SELECT * FROM test_repair_table4; +CHECK TABLE test_repair_table4; +REPAIR TABLE test_repair_table4; +# check that nothing changed +SELECT * FROM test_repair_table4; +# verify that check/repair did non corrupt the table itself +CHECK TABLE test_repair_table4; +REPAIR TABLE test_repair_table4; +SELECT * FROM test_repair_table4; +DROP TABLE test_repair_table4; + +# Run CHECK/REPAIR on the CSV file with a single row, which misses a column. + +CREATE TABLE test_repair_table5 ( + num int not null, + magic_no int(4) unsigned zerofill DEFAULT '0000' NOT NULL, + company_name char(30) DEFAULT '' NOT NULL, + founded char(4) DEFAULT '' NOT NULL +) ENGINE = CSV; + +# Corrupt a table -- put a file with wrong # of columns +--exec echo -n -e \"1\",\"101\",\"IBM\"\\n > $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV + +CHECK TABLE test_repair_table5; +REPAIR TABLE test_repair_table5; +SELECT * FROM test_repair_table5; +DROP TABLE test_repair_table5; + # # BUG#13406 - incorrect amount of "records deleted" |