1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#16218 - Crash on insert delayed

Bug#17294 - INSERT DELAYED puting an \n before data
Bug#16611 - INSERT DELAYED corrupts data
Bug#13707 - Server crash with INSERT DELAYED on MyISAM table
Combined as Bug#16218.

INSERT DELAYED crashed in 5.0 on a table with a varchar that 
could be NULL and was created pre-5.0 (Bugs 16218 and 13707).
INSERT DELAYED corrupted data in 5.0 on a table with varchar 
fields that was created pre-5.0 (Bugs 17294 and 16611).

In case of INSERT DELAYED the open table is copied from the
delayed insert thread to be able to create a record for the 
queue. When copying the fields, a method was used that did 
convert old varchar to new varchar fields and did not set up 
some pointers into the record buffer of the table.

The field conversion was guilty for the misinterpretation of 
the record contents by the delayed insert thread. The wrong
pointer setup was guilty for the crashes.

For Bug 13707 (Server crash with INSERT DELAYED on MyISAM table)
I fixed the above mentioned method to set up one of the pointers.
For Bug 16218 I set up the other pointers too.

But when looking at the corruptions I got aware that converting
the field type was totally wrong for INSERT DELAYED. The copied
table is used to create a record that is to be sent to the
delayed insert thread. Of course it can interpret the record
correctly only if all field types are the same in both table
objects.

So I revoked the fix for Bug 13707 and changed the new_field() 
method so that it can suppress conversions.

No test case as this is a migration problem. One needs to
create a table with 4.x and use it with 5.x. I added two
test scripts to the bug report.
This commit is contained in:
ingo@mysql.com
2006-06-26 20:57:18 +02:00
parent 1eee0053db
commit 8728fbbc6c
6 changed files with 91 additions and 37 deletions

View File

@ -736,7 +736,8 @@ bool Table_triggers_list::prepare_record1_accessors(TABLE *table)
QQ: it is supposed that it is ok to use this function for field
cloning...
*/
if (!(*old_fld= (*fld)->new_field(&table->mem_root, table)))
if (!(*old_fld= (*fld)->new_field(&table->mem_root, table,
table == (*fld)->table)))
return 1;
(*old_fld)->move_field((my_ptrdiff_t)(table->record[1] -
table->record[0]));