summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2005-06-17 17:27:47 +0300
committerunknown <bell@sanja.is.com.ua>2005-06-17 17:27:47 +0300
commit467ca505b5c5cb6f1512fc3425fd0f0b8620c099 (patch)
treea1524e75158ce5df834d60837e8609e95d3b7d3f /sql/item.h
parent04cc7cdef7dc0c6dbb60821f3d2ab7ff0497074c (diff)
downloadmariadb-git-467ca505b5c5cb6f1512fc3425fd0f0b8620c099.tar.gz
fixed printing of sum(distinct ) & avg(distinct ) & cast(... as decimal) (BUG#7015, BUG#11387)
mysql-test/r/view.result: using sum(distinct ), cast(... as decimal) & avg(distinct ) in views mysql-test/t/view.test: using sum(distinct ), cast(... as decimal) & avg(distinct ) in views sql/item.h: Add a comment for Item::print sql/item_func.cc: Use functype(), not func_name() for item equvalence detection sql/item_func.h: Missed function typoes added Add a comment for Item_func::func_name() style fix sql/item_strfunc.cc: Use functype(), not func_name() for item equvalence detection sql/item_strfunc.h: Add missing func_name and func_type sql/item_sum.cc: Item_sum func_name report beggining of function till first argument sql/item_sum.h: Item_sum func_name report beggining of function till first argument sql/item_timefunc.cc: Use functype(), not func_name() for item equvalence detection sql/item_timefunc.h: Add missing func_name and func_type sql/item_uniq.h: Add missing func_name
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h
index 820624afd2b..7ab03bae506 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -468,6 +468,18 @@ public:
*/
virtual bool const_during_execution() const
{ return (used_tables() & ~PARAM_TABLE_BIT) == 0; }
+ /*
+ This is an essential method for correct functioning of VIEWS.
+ To save a view in an .frm file we need its unequivocal
+ definition in SQL that takes into account sql_mode and
+ environmental settings. Currently such definition is restored
+ by traversing through the parsed tree of a view and
+ print()'ing SQL syntax of every node to a String buffer. This
+ method is used to print the SQL definition of an item. The
+ second use of this method is for EXPLAIN EXTENDED, to print
+ the SQL of a query after all optimizations of the parsed tree
+ have been done.
+ */
virtual void print(String *str_arg) { str_arg->append(full_name()); }
void print_item_w_name(String *);
virtual void update_used_tables() {}