1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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
This commit is contained in:
unknown
2006-03-29 06:28:57 +04:00
parent ecba6dc67b
commit 2a67aecd1a
4 changed files with 155 additions and 27 deletions

View File

@@ -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"