Commit 1100afe3 authored by Alexander Nozdrin's avatar Alexander Nozdrin

Auto-merge from mysql-trunk-merge.

parents 7cd628cf 7a7147c5
...@@ -5312,7 +5312,7 @@ int Item::save_in_field(Field *field, bool no_conversions) ...@@ -5312,7 +5312,7 @@ int Item::save_in_field(Field *field, bool no_conversions)
field->set_notnull(); field->set_notnull();
error=field->store(nr, unsigned_flag); error=field->store(nr, unsigned_flag);
} }
return error; return error ? error : (field->table->in_use->is_error() ? 2 : 0);
} }
......
...@@ -719,6 +719,12 @@ public: ...@@ -719,6 +719,12 @@ public:
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, my_bitmap_map *old_map= dbug_tmp_use_all_columns(table,
table->write_set); table->write_set);
int res= item->save_in_field(to_field, 1); int res= item->save_in_field(to_field, 1);
/*
Item::save_in_field() may call Item::val_xxx(). And if this is a subquery
we need to check for errors executing it and react accordingly
*/
if (!res && table->in_use->is_error())
res= 2;
dbug_tmp_restore_column_map(table->write_set, old_map); dbug_tmp_restore_column_map(table->write_set, old_map);
null_key= to_field->is_null() || item->null_value; null_key= to_field->is_null() || item->null_value;
return (err != 0 || res > 2 ? STORE_KEY_FATAL : (store_key_result) res); return (err != 0 || res > 2 ? STORE_KEY_FATAL : (store_key_result) res);
...@@ -752,6 +758,12 @@ protected: ...@@ -752,6 +758,12 @@ protected:
if (!err) if (!err)
err= res; err= res;
} }
/*
Item::save_in_field() may call Item::val_xxx(). And if this is a subquery
we need to check for errors executing it and react accordingly
*/
if (!err && to_field->table->in_use->is_error())
err= 2;
} }
null_key= to_field->is_null() || item->null_value; null_key= to_field->is_null() || item->null_value;
return (err > 2 ? STORE_KEY_FATAL : (store_key_result) err); return (err > 2 ? STORE_KEY_FATAL : (store_key_result) err);
......
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