mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Better bug fix for #14400 "Query joins wrong rows from table which is subject of "concurrent insert""
The previous bug fix didn't work when using partial keys. Don't use GNUC min/max operations are they are depricated. Fixed valgrind warning BitKeeper/etc/ignore: Added */.libs/* include/my_global.h: Don't use GNUC min/max operations are they are depricated myisam/mi_rkey.c: Better bug fix for #14400 "Query joins wrong rows from table which is subject of "concurrent insert"" The previous bug fix didn't work when using partial keys. myisam/mi_test_all.res: Updated results to match mi_test_all.sh myisam/mi_test_all.sh: Removed confusing warning mysql-test/r/myisam.result: Added test case for #14400 mysql-test/t/myisam.test: Added test case for #14400 sql/sql_select.cc: Fixed valgrind warning (in field_string::val_int())
This commit is contained in:
@ -7222,6 +7222,8 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields)
|
||||
param->copy_funcs.empty();
|
||||
while ((pos=li++))
|
||||
{
|
||||
Field *field;
|
||||
char *tmp;
|
||||
if (pos->type() == Item::FIELD_ITEM)
|
||||
{
|
||||
Item_field *item=(Item_field*) pos;
|
||||
@ -7245,13 +7247,21 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields)
|
||||
}
|
||||
|
||||
/* set up save buffer and change result_field to point at saved value */
|
||||
Field *field= item->field;
|
||||
field= item->field;
|
||||
item->result_field=field->new_field(&thd->mem_root,field->table);
|
||||
char *tmp=(char*) sql_alloc(field->pack_length()+1);
|
||||
/*
|
||||
We need to allocate one extra byte for null handling and
|
||||
another extra byte to not get warnings from purify in
|
||||
Field_string::val_int
|
||||
*/
|
||||
tmp= (char*) sql_alloc(field->pack_length()+2);
|
||||
if (!tmp)
|
||||
goto err;
|
||||
copy->set(tmp, item->result_field);
|
||||
item->result_field->move_field(copy->to_ptr,copy->to_null_ptr,1);
|
||||
#ifdef HAVE_purify
|
||||
copy->to_ptr[copy->from_length]= 0;
|
||||
#endif
|
||||
copy++;
|
||||
}
|
||||
else if ((pos->type() == Item::FUNC_ITEM ||
|
||||
|
Reference in New Issue
Block a user