diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-06-01 21:52:20 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-06-01 21:52:20 +0200 |
commit | ffc8f62b08982cc1f2fabf8b4b38bd124c115a97 (patch) | |
tree | da42637b1ae9402a7436b715f9c0db57cdddc87a /sql/item_subselect.cc | |
parent | 6b157f6be3cb056a93eb925df3880098c871b32a (diff) | |
parent | 0fc39acb8125fae95062e7b680b022b075a308c3 (diff) | |
download | mariadb-git-ffc8f62b08982cc1f2fabf8b4b38bd124c115a97.tar.gz |
merge 5.1->5.2
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index b550d6e8e8e..000d4591a27 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -123,6 +123,21 @@ void Item_subselect::cleanup() DBUG_VOID_RETURN; } + +/* + We cannot use generic Item::safe_charset_converter() because + Subselect transformation does not happen in view_prepare_mode + and thus we can not evaluate val_...() for const items. +*/ + +Item *Item_subselect::safe_charset_converter(CHARSET_INFO *tocs) +{ + Item_func_conv_charset *conv= + new Item_func_conv_charset(this, tocs, thd->lex->view_prepare_mode ? 0 : 1); + return conv->safe ? conv : NULL; +} + + void Item_singlerow_subselect::cleanup() { DBUG_ENTER("Item_singlerow_subselect::cleanup"); @@ -273,9 +288,13 @@ bool Item_subselect::exec() { int res; - if (thd->is_error()) - /* Do not execute subselect in case of a fatal error */ + /* + Do not execute subselect in case of a fatal error + or if the query has been killed. + */ + if (thd->is_error() || thd->killed) return 1; + /* Simulate a failure in sub-query execution. Used to test e.g. out of memory or query being killed conditions. |