From 558aeb0f0bfd83726ffe84f5739c0317df48980c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 11:55:06 +0500 Subject: 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(). --- mysql-test/t/csv.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t/csv.test') 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 -- cgit v1.2.1