summaryrefslogtreecommitdiff
path: root/mysql-test/t/csv.test
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-07-05 11:55:06 +0500
committerunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-07-05 11:55:06 +0500
commit10738fa6882c48fa5eb5305a71c2ffb2799da9a4 (patch)
tree3f66f5e61fc025c642ab1bd7a6ce7d6e83813072 /mysql-test/t/csv.test
parent0b4373916f7c974c3dc361620c44383a6eb555fc (diff)
downloadmariadb-git-10738fa6882c48fa5eb5305a71c2ffb2799da9a4.tar.gz
Fix for bug #29411: deleting from a csv table leads to the table corruption
Problem: we don't adjust share->rows_recorded and local_saved_data_file_length deleting rows from a CSV table, so following table check may fail. Fix: properly adjust those values. mysql-test/r/csv.result: Fix for bug #29411: deleting from a csv table leads to the table corruption - test result. mysql-test/t/csv.test: Fix for bug #29411: deleting from a csv table leads to the table corruption - test case. storage/csv/ha_tina.cc: Fix for bug #29411: deleting from a csv table leads to the table corruption - decrement share->rows_recorded in the ha_tina::delete_row(). - set share->rows_recorded and local_saved_data_file_length to 0 in the ha_tina::delete_all_rows(). - adjust local_saved_data_file_length after cleaning up in the ha_tina::rnd_end().
Diffstat (limited to 'mysql-test/t/csv.test')
-rw-r--r--mysql-test/t/csv.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index 6d24b38ee10..26051da24aa 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1698,4 +1698,17 @@ select * from t1;
check table t1;
drop table t1;
+#
+# Bug #29411: deleting from a csv table leads to the table corruption
+#
+create table t1(a int) engine=csv;
+insert into t1 values (0), (1), (2);
+delete from t1 limit 2;
+check table t1;
+select * from t1;
+delete from t1;
+check table t1;
+select * from t1;
+drop table t1;
+
--echo End of 5.1 tests