diff options
author | unknown <msvensson@shellback.> | 2006-04-11 12:12:48 +0200 |
---|---|---|
committer | unknown <msvensson@shellback.> | 2006-04-11 12:12:48 +0200 |
commit | 79a2debe460d7e22e9a7f5a4b549e8fe72b982e5 (patch) | |
tree | 3025fcbb9060c95f5987f7c84e265eba192ec47f /mysql-test/t/csv.test | |
parent | e10f0d9b98e8a5107b2021d20aabc8bfb1ff1188 (diff) | |
download | mariadb-git-79a2debe460d7e22e9a7f5a4b549e8fe72b982e5.tar.gz |
Close share->data_file in before renaming in ha_tina::repair
Open and seek to end of data_file after rename
Fix comment for when file does not need repair.
Set share->mapped_file to NULL always when it's been unmapped
Add test to see that file can be used after repair
mysql-test/r/csv.result:
Add more test to see that the table can be used after repair
mysql-test/t/csv.test:
Add more test to see that the table can be used after repair
storage/csv/ha_tina.cc:
Close share->data_file in before renaming in ha_tina::repair
Open and seek to end after rename
Fix comment for when file does not need repair.
Set share->mapped_file to NULL always when it's been unmapped
Diffstat (limited to 'mysql-test/t/csv.test')
-rw-r--r-- | mysql-test/t/csv.test | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index 63c76e79fc7..9ba99167ab9 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1477,8 +1477,29 @@ CREATE TABLE test_repair_table5 ( CHECK TABLE test_repair_table5; REPAIR TABLE test_repair_table5; SELECT * FROM test_repair_table5; -DROP TABLE test_repair_table5; +INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT", 1876); +SELECT * FROM test_repair_table5; +# Corrupt a table -- put a row with wrong # of columns at end of file +--exec perl -e 'print "\"1\",\"101\",\"IBM\"\n";' >> $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV + +FLUSH TABLES; +CHECK TABLE test_repair_table5; +REPAIR TABLE test_repair_table5; +# The correct record inserted should still be in the file +SELECT * FROM test_repair_table5; +INSERT INTO test_repair_table5 VALUES (1, 102, "CORRECT2", 1876); +SELECT * FROM test_repair_table5; + +# Corrupt table again -- put a row with wrong # of columns at end of file +--exec perl -e 'print "\"1\",\"101\",\"IBM\"\n";' >> $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV + +FLUSH TABLES; +CHECK TABLE test_repair_table5; +REPAIR TABLE test_repair_table5; +# The two correct records inserted should still be in the file +SELECT * FROM test_repair_table5; +DROP TABLE test_repair_table5; # # BUG#13406 - incorrect amount of "records deleted" |