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

Fix 11 "fetch from view returns wrong data"

Wrong method for creating temporary field was choosen, which results in
sending int field with int header but lonlong data.

Test case is added to mysql_client_test.c because client library is required
to test the bug.
This commit is contained in:
evgen@moonbone.local
2005-06-15 01:57:40 +04:00
parent a99599bc1a
commit bff2fd8d7b
3 changed files with 63 additions and 2 deletions

View File

@ -7957,6 +7957,19 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
modify_item ? (Item_field*) item : NULL,
convert_blob_length);
}
case Item::REF_ITEM:
if ( ((Item_ref*)item)->real_item()->type() == Item::FIELD_ITEM)
{
Item_field *field= (Item_field*) *((Item_ref*)item)->ref;
Field *new_field= create_tmp_field_from_field(thd,
(*from_field= field->field),
item->name, table,
NULL,
convert_blob_length);
if (modify_item)
item->set_result_field(new_field);
return new_field;
}
case Item::FUNC_ITEM:
case Item::COND_ITEM:
case Item::FIELD_AVG_ITEM:
@ -7968,7 +7981,6 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
case Item::REAL_ITEM:
case Item::DECIMAL_ITEM:
case Item::STRING_ITEM:
case Item::REF_ITEM:
case Item::NULL_ITEM:
case Item::VARBIN_ITEM:
return create_tmp_field_from_item(thd, item, table, copy_func, modify_item,