summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorGleb Shchepa <gleb.shchepa@oracle.com>2013-01-31 09:13:42 +0400
committerGleb Shchepa <gleb.shchepa@oracle.com>2013-01-31 09:13:42 +0400
commit4743ba00bbe8e314230a98fba153271816459ba4 (patch)
tree988c67022a5a8af1b1136f0071a5bd19314a3a73 /sql/item.h
parentf57cba0ca0431edc9af7931d39067ed2c55572c2 (diff)
parent2993c299d7b65beec7d4fbeec8b981c6a4795694 (diff)
downloadmariadb-git-4743ba00bbe8e314230a98fba153271816459ba4.tar.gz
Bug #11827369: ASSERTION FAILED: !THD->LEX->CONTEXT_ANALYSIS_ONLY
Manual up-merge from 5.1 to 5.5.
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/sql/item.h b/sql/item.h
index 15900bdbbdd..e348af5202a 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1,7 +1,7 @@
#ifndef ITEM_INCLUDED
#define ITEM_INCLUDED
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
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
@@ -1249,6 +1249,11 @@ public:
Return TRUE if the item points to a column of an outer-joined table.
*/
virtual bool is_outer_field() const { DBUG_ASSERT(fixed); return FALSE; }
+
+ /**
+ Checks if this item or any of its decendents contains a subquery.
+ */
+ virtual bool has_subquery() const { return with_subselect; }
};
@@ -2528,6 +2533,10 @@ public:
Field *get_tmp_table_field()
{ return result_field ? result_field : (*ref)->get_tmp_table_field(); }
Item *get_tmp_table_item(THD *thd);
+ bool const_item() const
+ {
+ return (*ref)->const_item() && (used_tables() == 0);
+ }
table_map used_tables() const
{
return depended_from ? OUTER_REF_TABLE_BIT : (*ref)->used_tables();
@@ -2603,6 +2612,13 @@ public:
return (*ref)->is_outer_field();
}
+ /**
+ Checks if the item tree that ref points to contains a subquery.
+ */
+ virtual bool has_subquery() const
+ {
+ return (*ref)->has_subquery();
+ }
};