summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2010-01-15 16:09:20 +0200
committerGeorgi Kodinov <joro@sun.com>2010-01-15 16:09:20 +0200
commit7a7147c5b4cca1bfd1bfbecd4883d3968526b162 (patch)
tree54f21643537d7cb5e55cbd0f10488a1ac33c12f1 /sql/item.cc
parent0305aea88a220ff9080432a65d50cb30493f3109 (diff)
downloadmariadb-git-7a7147c5b4cca1bfd1bfbecd4883d3968526b162.tar.gz
Bug #46175: NULL read_view and consistent read assertion
The optimizer must not continue executing the current query if e.g. the storage engine reports an error. This is somewhat hard to implement with Item::val_xxx() because they do not have means to return error code. This is why we need to check the thread's error state after a call to one of the Item::val_xxx() methods. Fixed store_key_item::copy_inner() to return an error state if an error happened during the call to Item::save_in_field() because it calls Item::val_xxx(). Also added similar checks to related places.
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc
index b35a6ae3d6e..68c10c32b50 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -5141,7 +5141,7 @@ int Item::save_in_field(Field *field, bool no_conversions)
field->set_notnull();
error=field->store(nr, unsigned_flag);
}
- return error;
+ return error ? error : (field->table->in_use->is_error() ? 2 : 0);
}