Bug #17206 Update through VIEW is not working

post review fixes
Bug fix added missing setting of rw_set for table handler when update occurs via a view.   The missing setting of the rw_set resulted in fields not being updated for ndb tables
parent edd1417b
...@@ -3869,6 +3869,11 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list, ...@@ -3869,6 +3869,11 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
#endif #endif
if (thd->set_query_id) if (thd->set_query_id)
{ {
/*
* get rw_set correct for this field so that the handler
* knows that this field is involved in the query and gets
* retrieved/updated
*/
Field *field_to_set= NULL; Field *field_to_set= NULL;
if (fld == view_ref_found) if (fld == view_ref_found)
{ {
...@@ -3879,8 +3884,9 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list, ...@@ -3879,8 +3884,9 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
else else
field_to_set= fld; field_to_set= fld;
if (field_to_set) if (field_to_set)
field_to_set->table->file->ha_set_bit_in_rw_set(field_to_set->fieldnr, field_to_set->table->file->
(bool)(thd->set_query_id-1)); ha_set_bit_in_rw_set(field_to_set->fieldnr,
(bool)(thd->set_query_id-1));
} }
} }
DBUG_RETURN(fld); DBUG_RETURN(fld);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment