summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2011-04-01 15:07:10 +0200
committerunknown <knielsen@knielsen-hq.org>2011-04-01 15:07:10 +0200
commitc677fea7d01ef1fab3357496b309a3e3b3c00dfe (patch)
treeb6000be3447e5a41440cffee8b8d927d37a1dcde /sql/item_subselect.cc
parent09bd2894973fbdbacec9bfc31a3635165b120200 (diff)
parent9aa44bb4b3e0fc69306626b961c7d9309e6ab114 (diff)
downloadmariadb-git-c677fea7d01ef1fab3357496b309a3e3b3c00dfe.tar.gz
Merge MariaDB 5.2.5 release into MariaDB-5.2-rpl.
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc22
1 files changed, 5 insertions, 17 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 6d3a4c66649..02f708cdf91 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -124,20 +124,6 @@ void Item_subselect::cleanup()
}
-/*
- 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");
@@ -295,6 +281,7 @@ bool Item_subselect::exec()
if (thd->is_error() || thd->killed)
return 1;
+ DBUG_ASSERT(!thd->lex->context_analysis_only);
/*
Simulate a failure in sub-query execution. Used to test e.g.
out of memory or query being killed conditions.
@@ -331,7 +318,7 @@ table_map Item_subselect::used_tables() const
bool Item_subselect::const_item() const
{
- return const_item_cache;
+ return thd->lex->context_analysis_only ? FALSE : const_item_cache;
}
Item *Item_subselect::get_tmp_table_item(THD *thd_arg)
@@ -1663,7 +1650,8 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref)
{
bool result = 0;
- if (thd_arg->lex->view_prepare_mode && left_expr && !left_expr->fixed)
+ if ((thd_arg->lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_VIEW) &&
+ left_expr && !left_expr->fixed)
result = left_expr->fix_fields(thd_arg, &left_expr);
return result || Item_subselect::fix_fields(thd_arg, ref);