mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
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().
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user