mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +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:
@ -4945,8 +4945,6 @@ SELECT * FROM bug13894;
|
||||
val
|
||||
6
|
||||
6
|
||||
5
|
||||
11
|
||||
DROP TABLE bug13894;
|
||||
DROP TABLE IF EXISTS bug14672;
|
||||
CREATE TABLE bug14672 (c1 integer) engine = CSV;
|
||||
@ -5291,4 +5289,20 @@ check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
drop table t1;
|
||||
create table t1(a int) engine=csv;
|
||||
insert into t1 values (0), (1), (2);
|
||||
delete from t1 limit 2;
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
select * from t1;
|
||||
a
|
||||
2
|
||||
delete from t1;
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
select * from t1;
|
||||
a
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user