mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
BUG#28971 - ALTER TABLE followed by UPDATE for a CSV table
make server crash UPDATE against CSV table may cause server crash or update a table with wrong values. CSV can write only a whole row at once. That means it must read all columns, that it is not going to update, and write them along with updated columns. But only limited set of columns was read, those that were needed for the UPDATE query. With this fix all columns are read in case we're performing an UPDATE. mysql-test/r/csv.result: A test case for BUG#28971. mysql-test/t/csv.test: A test case for BUG#28971. Flush tables is here just to make crash more probable. If we remove it, fields will have old values from previous query and server won't crash. storage/csv/ha_tina.cc: CSV engine is not capable to update single column, because it can only write a row at once. Thus we must read all columns if a table is opened for update.
This commit is contained in:
@ -5240,3 +5240,11 @@ CREATE TABLE `bug21328` (
|
||||
insert into bug21328 values (1,NULL,NULL);
|
||||
alter table bug21328 engine=myisam;
|
||||
drop table bug21328;
|
||||
create table t1(a blob, b int) engine=csv;
|
||||
insert into t1 values('a', 1);
|
||||
flush tables;
|
||||
update t1 set b=2;
|
||||
select * from t1;
|
||||
a b
|
||||
a 2
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user