summaryrefslogtreecommitdiff
path: root/mysql-test/t/csv.test
diff options
context:
space:
mode:
authorpetr@mysql.com <>2006-03-13 19:36:34 +0300
committerpetr@mysql.com <>2006-03-13 19:36:34 +0300
commit307b724bbc1d034d684857e3aa3b5957e7f38a70 (patch)
tree16df6bda76911bdd1dae072cff2c449de65a4318 /mysql-test/t/csv.test
parent64461db10f601eac927ba4ea4129d846ec1623f8 (diff)
downloadmariadb-git-307b724bbc1d034d684857e3aa3b5957e7f38a70.tar.gz
WL#3154 "Enable REPAIR for CSV tables".
This is the first commit. Cleanups are likely to follow after the merge.
Diffstat (limited to 'mysql-test/t/csv.test')
-rw-r--r--mysql-test/t/csv.test39
1 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index 916a2132deb..3d23a838762 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1388,6 +1388,45 @@ UNLOCK TABLES;
DROP TABLE test_concurrent_insert;
#
+# Test REPAIR/CHECK TABLE (5.1)
+#
+
+# Check that repair on the newly created table works fine
+
+CREATE TABLE test_repair_table ( val integer ) ENGINE = CSV;
+
+CHECK TABLE test_repair_table;
+REPAIR TABLE test_repair_table;
+
+DROP TABLE test_repair_table;
+
+#
+# Check autorepair. Here we also check that we can work w/o metafile
+# restore the meta-file
+#
+
+CREATE TABLE test_repair_table2 ( val integer ) ENGINE = CSV;
+--exec rm $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM
+# should give a warning and perform autorepair
+SELECT * from test_repair_table2;
+# this should work ok, as the table is already repaired
+SELECT * from test_repair_table2;
+# check that the metafile appeared again. chop the path to it
+--exec ls $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM | perl -pi -e "s/.*\///"
+CHECK TABLE test_repair_table2;
+DROP TABLE test_repair_table2;
+
+
+# Corrupt csv file and see if we can repair it
+CREATE TABLE test_repair_table3 ( val integer ) ENGINE = CSV;
+--exec echo -n -e \"1\"\\n\"4\"\\n\"3 > $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV
+CHECK TABLE test_repair_table3;
+REPAIR TABLE test_repair_table3;
+SELECT * FROM test_repair_table3;
+DROP TABLE test_repair_table3;
+
+
+#
# BUG#13406 - incorrect amount of "records deleted"
#