diff options
author | unknown <monty@narttu.mysql.fi> | 2008-04-28 19:24:05 +0300 |
---|---|---|
committer | unknown <monty@narttu.mysql.fi> | 2008-04-28 19:24:05 +0300 |
commit | 50ceea65cf18a64db017f06d2be5197807927588 (patch) | |
tree | ff5ab0c71ce5a2792c4f169a880e0174f8e194ad /sql/item.h | |
parent | ed5fe6d3eb5d702e2fe27de3c65c550ea0dbf17f (diff) | |
parent | c481f6b3cf80f471321d2ef4e7c68fe9e6e5d0ca (diff) | |
download | mariadb-git-50ceea65cf18a64db017f06d2be5197807927588.tar.gz |
Merge mysql.com:/home/my/mysql-5.1
into mysql.com:/home/my/mysql-new
BitKeeper/etc/ignore:
auto-union
BUILD/SETUP.sh:
Auto merged
CMakeLists.txt:
Auto merged
client/get_password.c:
Auto merged
client/mysqldump.c:
Auto merged
client/mysqltest.c:
Auto merged
cmd-line-utils/readline/bind.c:
Auto merged
cmd-line-utils/readline/display.c:
Auto merged
cmd-line-utils/readline/histexpand.c:
Auto merged
cmd-line-utils/readline/history.c:
Auto merged
cmd-line-utils/readline/readline.c:
Auto merged
cmd-line-utils/readline/text.c:
Auto merged
dbug/user.r:
Auto merged
extra/yassl/src/handshake.cpp:
Auto merged
include/config-win.h:
Auto merged
include/m_string.h:
Auto merged
include/my_global.h:
Auto merged
include/my_pthread.h:
Auto merged
include/mysql/plugin.h:
Auto merged
include/mysql_com.h:
Auto merged
include/thr_alarm.h:
Auto merged
libmysql/CMakeLists.txt:
Auto merged
libmysql/Makefile.shared:
Auto merged
libmysql/dll.c:
Auto merged
libmysql/get_password.c:
Auto merged
libmysql/libmysql.c:
Auto merged
libmysqld/Makefile.am:
Auto merged
mysql-test/lib/mtr_cases.pl:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/alter_table.result:
Auto merged
mysql-test/r/change_user.result:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/merge.result:
Auto merged
mysql-test/r/mix2_myisam.result:
Auto merged
mysql-test/r/mysqldump.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/valgrind.supp:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/suite/rpl/r/rpl_events.result:
Auto merged
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/mysqldump.test:
Auto merged
mysql-test/t/query_cache.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
mysql-test/t/view.test:
Auto merged
mysys/mf_iocache.c:
Auto merged
mysys/mf_tempfile.c:
Auto merged
mysys/my_atomic.c:
Auto merged
mysys/my_bit.c:
Auto merged
mysys/my_bitmap.c:
Auto merged
mysys/my_compress.c:
Auto merged
mysys/my_create.c:
Auto merged
mysys/my_delete.c:
Auto merged
mysys/my_error.c:
Auto merged
mysys/my_init.c:
Auto merged
mysys/my_open.c:
Auto merged
mysys/my_realloc.c:
Auto merged
mysys/my_rename.c:
Auto merged
mysys/my_symlink.c:
Auto merged
mysys/my_sync.c:
Auto merged
mysys/my_thr_init.c:
Auto merged
mysys/thr_alarm.c:
Auto merged
mysys/thr_lock.c:
Auto merged
scripts/make_binary_distribution.sh:
Auto merged
server-tools/instance-manager/mysql_connection.cc:
Auto merged
sql/CMakeLists.txt:
Auto merged
sql/Makefile.am:
Auto merged
sql/events.cc:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/filesort.cc:
Auto merged
sql/gen_lex_hash.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/ha_partition.h:
Auto merged
sql/handler.h:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/net_serv.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/partition_info.cc:
Auto merged
sql/rpl_injector.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/slave.h:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_cache.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_plugin.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_repl.cc:
Auto merged
sql/sql_test.cc:
Auto merged
sql/sql_union.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
sql/unireg.cc:
Auto merged
sql/share/errmsg.txt:
Auto merged
storage/csv/ha_tina.cc:
Auto merged
storage/csv/ha_tina.h:
Auto merged
storage/myisam/CMakeLists.txt:
Auto merged
storage/myisam/ft_boolean_search.c:
Auto merged
storage/myisam/ft_eval.c:
Auto merged
storage/myisam/ft_nlq_search.c:
Auto merged
storage/myisam/ft_parser.c:
Auto merged
storage/myisam/ft_static.c:
Auto merged
storage/myisam/ft_stopwords.c:
Auto merged
storage/myisam/ft_test1.c:
Auto merged
storage/myisam/ft_update.c:
Auto merged
storage/myisam/ha_myisam.cc:
Auto merged
storage/myisam/mi_check.c:
Auto merged
storage/myisam/mi_create.c:
Auto merged
storage/myisam/mi_delete.c:
Auto merged
storage/myisam/mi_delete_all.c:
Auto merged
storage/myisam/mi_dynrec.c:
Auto merged
storage/myisam/mi_key.c:
Auto merged
storage/myisam/mi_packrec.c:
Auto merged
storage/myisam/mi_range.c:
Auto merged
storage/myisam/mi_search.c:
Auto merged
storage/myisam/mi_test1.c:
Auto merged
storage/myisam/mi_test2.c:
Auto merged
storage/myisam/mi_test3.c:
Auto merged
storage/myisam/mi_unique.c:
Auto merged
storage/myisam/mi_write.c:
Auto merged
storage/myisam/myisamchk.c:
Auto merged
storage/myisam/myisamdef.h:
Auto merged
storage/myisam/myisampack.c:
Auto merged
storage/myisam/sort.c:
Auto merged
storage/myisam/sp_test.c:
Auto merged
support-files/mysql.spec.sh:
Auto merged
tests/mysql_client_test.c:
Auto merged
configure.in:
Manual merge
dbug/dbug.c:
Restore to original state in Maria tree
The big diff comes from a wrong pull from 5.0 -> 5.1 after backporting dbug to 5.0 from 5.1
include/Makefile.am:
Manual merge
include/my_atomic.h:
Ignore changes
include/my_base.h:
Manual merge
include/my_dbug.h:
Use orginal my_dbug.h from maria tree
include/my_handler.h:
Manual merge
include/my_sys.h:
Manual merge
include/myisam.h:
Manual merge
mysql-test/lib/mtr_report.pl:
Manual merge
mysql-test/r/myisam.result:
Manual merge
mysql-test/suite/binlog/r/binlog_unsafe.result:
Manual merge
mysql-test/suite/binlog/t/binlog_unsafe.test:
Manual merge
mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
Manual merge
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
No changes
mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
Manual merge
mysql-test/t/change_user.test:
Manual merge
mysql-test/t/disabled.def:
Manual merge
mysql-test/t/merge.test:
No changes
mysql-test/t/myisam.test:
Manual merge
mysys/Makefile.am:
Manual merge
mysys/array.c:
Manual merge
mysys/mf_keycache.c:
Manual merge
mysys/my_getsystime.c:
Manual merge
mysys/my_handler.c:
Manual merge
mysys/my_pread.c:
Manual merge
mysys/safemalloc.c:
Manual merge
sql/ha_partition.cc:
Manual merge
sql/handler.cc:
Manual merge
sql/lex.h:
Manual merge
sql/mysql_priv.h:
Manual merge
sql/mysqld.cc:
Manual merge
sql/set_var.h:
Manual merge
sql/sql_class.cc:
Manual merge
sql/sql_insert.cc:
Manual merge
sql/sql_parse.cc:
Manual merge
sql/sql_select.cc:
Manual merge
sql/sql_show.cc:
Manual merge
sql/sql_table.cc:
Manual merge
storage/myisam/mi_checksum.c:
No changes
storage/myisam/mi_extra.c:
Manual merge
storage/myisam/mi_open.c:
Manual merge
storage/myisammrg/ha_myisammrg.cc:
Manual merge
strings/strmake.c:
No changes
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 226 |
1 files changed, 155 insertions, 71 deletions
diff --git a/sql/item.h b/sql/item.h index 4ac3b2959b3..f4d7da55496 100644 --- a/sql/item.h +++ b/sql/item.h @@ -113,7 +113,6 @@ public: } }; - /*************************************************************************/ /* A framework to easily handle different return types for hybrid items @@ -769,20 +768,24 @@ 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 *); + + /** + This method is used for to: + - to generate a view definition query (SELECT-statement); + - to generate a SQL-query for EXPLAIN EXTENDED; + - to generate a SQL-query to be shown in INFORMATION_SCHEMA; + - debug. + + For more information about view definition query, INFORMATION_SCHEMA + query and why they should be generated from the Item-tree, @see + mysql_register_view(). + */ + virtual inline void print(String *str, enum_query_type query_type) + { + str->append(full_name()); + } + + void print_item_w_name(String *, enum_query_type query_type); virtual void update_used_tables() {} virtual void split_sum_func(THD *thd, Item **ref_pointer_array, List<Item> &fields) {} @@ -1004,12 +1007,30 @@ public: virtual Field::geometry_type get_geometry_type() const { return Field::GEOM_GEOMETRY; }; String *check_well_formed_result(String *str, bool send_error= 0); + bool eq_by_collation(Item *item, bool binary_cmp, CHARSET_INFO *cs); }; class sp_head; +class Item_basic_constant :public Item +{ +public: + /* to prevent drop fixed flag (no need parent cleanup call) */ + void cleanup() + { + /* + Restore the original field name as it might not have been allocated + in the statement memory. If the name is auto generated, it must be + done again between subsequent executions of a prepared statement. + */ + if (orig_name) + name= orig_name; + } +}; + + /***************************************************************************** The class is a base class for representation of stored routine variables in the Item-hierarchy. There are the following kinds of SP-vars: @@ -1134,7 +1155,7 @@ public: const Item *this_item() const; Item **this_item_addr(THD *thd, Item **); - void print(String *str); + virtual void print(String *str, enum_query_type query_type); public: inline const LEX_STRING *my_name() const; @@ -1203,7 +1224,7 @@ public: Item_case_expr can not occur in views, so here it is only for debug purposes. */ - void print(String *str); + virtual void print(String *str, enum_query_type query_type); private: uint m_case_expr_id; @@ -1244,14 +1265,7 @@ class Item_name_const : public Item Item *name_item; bool valid_args; public: - Item_name_const(Item *name_arg, Item *val): - value_item(val), name_item(name_arg) - { - if (!(valid_args= name_item->basic_const_item() & - value_item->basic_const_item())) - my_error(ER_WRONG_ARGUMENTS, MYF(0), "NAME_CONST"); - Item::maybe_null= TRUE; - } + Item_name_const(Item *name_arg, Item *val); bool fix_fields(THD *, Item **); @@ -1261,7 +1275,7 @@ public: String *val_str(String *sp); my_decimal *val_decimal(my_decimal *); bool is_null(); - void print(String *str); + virtual void print(String *str, enum_query_type query_type); Item_result result_type() const { @@ -1292,7 +1306,7 @@ bool agg_item_charsets(DTCollation &c, const char *name, Item **items, uint nitems, uint flags, int item_sep); -class Item_num: public Item +class Item_num: public Item_basic_constant { public: Item_num() {} /* Remove gcc warning */ @@ -1343,7 +1357,7 @@ public: const char *full_name() const; void cleanup(); bool remove_dependence_processor(uchar * arg); - void print(String *str); + virtual void print(String *str, enum_query_type query_type); virtual bool change_context_processor(uchar *cntx) { context= (Name_resolution_context *)cntx; return FALSE; } friend bool insert_fields(THD *thd, Name_resolution_context *context, @@ -1473,7 +1487,7 @@ public: Item *safe_charset_converter(CHARSET_INFO *tocs); int fix_outer_field(THD *thd, Field **field, Item **reference); virtual Item *update_value_transformer(uchar *select_arg); - void print(String *str); + virtual void print(String *str, enum_query_type query_type); Field::geometry_type get_geometry_type() const { DBUG_ASSERT(field_type() == MYSQL_TYPE_GEOMETRY); @@ -1484,7 +1498,7 @@ public: friend class st_select_lex_unit; }; -class Item_null :public Item +class Item_null :public Item_basic_constant { public: Item_null(char *name_par=0) @@ -1506,12 +1520,15 @@ public: bool send(Protocol *protocol, String *str); enum Item_result result_type () const { return STRING_RESULT; } enum_field_types field_type() const { return MYSQL_TYPE_NULL; } - /* to prevent drop fixed flag (no need parent cleanup call) */ - void cleanup() {} bool basic_const_item() const { return 1; } Item *clone_item() { return new Item_null(name); } bool is_null() { return 1; } - void print(String *str) { str->append(STRING_WITH_LEN("NULL")); } + + virtual inline void print(String *str, enum_query_type query_type) + { + str->append(STRING_WITH_LEN("NULL")); + } + Item *safe_charset_converter(CHARSET_INFO *tocs); bool check_partition_func_processor(uchar *int_arg) {return FALSE;} }; @@ -1536,8 +1553,6 @@ class Item_param :public Item char cnvbuf[MAX_FIELD_WIDTH]; String cnvstr; Item *cnvitem; - bool strict_type; - enum Item_result required_result_type; public: enum enum_item_param_state @@ -1645,7 +1660,7 @@ public: */ virtual table_map used_tables() const { return state != NO_VALUE ? (table_map)0 : PARAM_TABLE_BIT; } - void print(String *str); + virtual void print(String *str, enum_query_type query_type); bool is_null() { DBUG_ASSERT(state != NO_VALUE); return state == NULL_VALUE; } bool basic_const_item() const; @@ -1667,11 +1682,8 @@ public: Otherwise return FALSE. */ bool eq(const Item *item, bool binary_cmp) const; - void set_strict_type(enum Item_result result_type_arg) - { - strict_type= TRUE; - required_result_type= result_type_arg; - } + /** Item is a argument to a limit clause. */ + bool limit_clause_param; }; @@ -1701,9 +1713,7 @@ public: int save_in_field(Field *field, bool no_conversions); bool basic_const_item() const { return 1; } Item *clone_item() { return new Item_int(name,value,max_length); } - // to prevent drop fixed flag (no need parent cleanup call) - void cleanup() {} - void print(String *str); + virtual void print(String *str, enum_query_type query_type); Item_num *neg() { value= -value; return this; } uint decimal_precision() const { return (uint)(max_length - test(value < 0)); } @@ -1723,7 +1733,7 @@ public: String *val_str(String*); Item *clone_item() { return new Item_uint(name, value, max_length); } int save_in_field(Field *field, bool no_conversions); - void print(String *str); + virtual void print(String *str, enum_query_type query_type); Item_num *neg (); uint decimal_precision() const { return max_length; } bool check_partition_func_processor(uchar *bool_arg) { return FALSE;} @@ -1757,9 +1767,7 @@ public: { return new Item_decimal(name, &decimal_value, decimals, max_length); } - // to prevent drop fixed flag (no need parent cleanup call) - void cleanup() {} - void print(String *str); + virtual void print(String *str, enum_query_type query_type); Item_num *neg() { my_decimal_neg(&decimal_value); @@ -1813,12 +1821,10 @@ public: String *val_str(String*); my_decimal *val_decimal(my_decimal *); bool basic_const_item() const { return 1; } - // to prevent drop fixed flag (no need parent cleanup call) - void cleanup() {} Item *clone_item() { return new Item_float(name, value, decimals, max_length); } Item_num *neg() { value= -value; return this; } - void print(String *str); + virtual void print(String *str, enum_query_type query_type); bool eq(const Item *, bool binary_cmp) const; }; @@ -1831,17 +1837,23 @@ public: uint length) :Item_float(NullS, val_arg, decimal_par, length), func_name(str) {} - void print(String *str) { str->append(func_name); } + + virtual inline void print(String *str, enum_query_type query_type) + { + str->append(func_name); + } + Item *safe_charset_converter(CHARSET_INFO *tocs); }; -class Item_string :public Item +class Item_string :public Item_basic_constant { public: Item_string(const char *str,uint length, CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE, uint repertoire= MY_REPERTOIRE_UNICODE30) + : m_cs_specified(FALSE) { str_value.set_or_copy_aligned(str, length, cs); collation.set(cs, dv, repertoire); @@ -1860,6 +1872,7 @@ public: } /* Just create an item and do not fill string representation */ Item_string(CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE) + : m_cs_specified(FALSE) { collation.set(cs, dv); max_length= 0; @@ -1870,6 +1883,7 @@ public: Item_string(const char *name_par, const char *str, uint length, CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE, uint repertoire= MY_REPERTOIRE_UNICODE30) + : m_cs_specified(FALSE) { str_value.set_or_copy_aligned(str, length, cs); collation.set(cs, dv, repertoire); @@ -1919,10 +1933,50 @@ public: str_value.append(str, length); max_length= str_value.numchars() * collation.collation->mbmaxlen; } - void print(String *str); - // to prevent drop fixed flag (no need parent cleanup call) - void cleanup() {} + virtual void print(String *str, enum_query_type query_type); bool check_partition_func_processor(uchar *int_arg) {return FALSE;} + + /** + Return TRUE if character-set-introducer was explicitly specified in the + original query for this item (text literal). + + This operation is to be called from Item_string::print(). The idea is + that when a query is generated (re-constructed) from the Item-tree, + character-set-introducers should appear only for those literals, where + they were explicitly specified by the user. Otherwise, that may lead to + loss collation information (character set introducers implies default + collation for the literal). + + Basically, that makes sense only for views and hopefully will be gone + one day when we start using original query as a view definition. + + @return This operation returns the value of m_cs_specified attribute. + @retval TRUE if character set introducer was explicitly specified in + the original query. + @retval FALSE otherwise. + */ + inline bool is_cs_specified() const + { + return m_cs_specified; + } + + /** + Set the value of m_cs_specified attribute. + + m_cs_specified attribute shows whether character-set-introducer was + explicitly specified in the original query for this text literal or + not. The attribute makes sense (is used) only for views. + + This operation is to be called from the parser during parsing an input + query. + */ + inline void set_cs_specified(bool cs_specified) + { + m_cs_specified= cs_specified; + } + +private: + bool m_cs_specified; }; @@ -1936,7 +1990,12 @@ public: :Item_string(NullS, str, length, cs, dv), func_name(name_par) {} Item *safe_charset_converter(CHARSET_INFO *tocs); - void print(String *str) { str->append(func_name); } + + virtual inline void print(String *str, enum_query_type query_type) + { + str->append(func_name); + } + bool check_partition_func_processor(uchar *int_arg) {return TRUE;} }; @@ -2005,10 +2064,10 @@ public: }; -class Item_hex_string: public Item +class Item_hex_string: public Item_basic_constant { public: - Item_hex_string(): Item() {} + Item_hex_string() {} Item_hex_string(const char *str,uint str_length); enum Type type() const { return VARBIN_ITEM; } double val_real() @@ -2024,9 +2083,7 @@ public: enum Item_result result_type () const { return STRING_RESULT; } enum Item_result cast_to_int_type() const { return INT_RESULT; } enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } - // to prevent drop fixed flag (no need parent cleanup call) - void cleanup() {} - void print(String *str); + virtual void print(String *str, enum_query_type query_type); bool eq(const Item *item, bool binary_cmp) const; virtual Item *safe_charset_converter(CHARSET_INFO *tocs); bool check_partition_func_processor(uchar *int_arg) {return FALSE;} @@ -2147,7 +2204,7 @@ public: } bool walk(Item_processor processor, bool walk_subquery, uchar *arg) { return (*ref)->walk(processor, walk_subquery, arg); } - void print(String *str); + virtual void print(String *str, enum_query_type query_type); bool result_as_longlong() { return (*ref)->result_as_longlong(); @@ -2156,6 +2213,35 @@ public: Item_field *filed_for_view_update() { return (*ref)->filed_for_view_update(); } virtual Ref_Type ref_type() { return REF; } + + // Row emulation: forwarding of ROW-related calls to ref + uint cols() + { + return ref && result_type() == ROW_RESULT ? (*ref)->cols() : 1; + } + Item* element_index(uint i) + { + return ref && result_type() == ROW_RESULT ? (*ref)->element_index(i) : this; + } + Item** addr(uint i) + { + return ref && result_type() == ROW_RESULT ? (*ref)->addr(i) : 0; + } + bool check_cols(uint c) + { + return ref && result_type() == ROW_RESULT ? (*ref)->check_cols(c) + : Item::check_cols(c); + } + bool null_inside() + { + return ref && result_type() == ROW_RESULT ? (*ref)->null_inside() : 0; + } + void bring_value() + { + if (ref && result_type() == ROW_RESULT) + (*ref)->bring_value(); + } + }; @@ -2294,7 +2380,7 @@ public: my_decimal *val_decimal(my_decimal *); bool val_bool(); bool get_date(MYSQL_TIME *ltime, uint fuzzydate); - void print(String *str); + virtual void print(String *str, enum_query_type query_type); /* we add RAND_TABLE_BIT to prevent moving this item from HAVING to WHERE */ @@ -2469,7 +2555,7 @@ public: enum Type type() const { return DEFAULT_VALUE_ITEM; } bool eq(const Item *item, bool binary_cmp) const; bool fix_fields(THD *, Item **); - void print(String *str); + virtual void print(String *str, enum_query_type query_type); int save_in_field(Field *field_arg, bool no_conversions); table_map used_tables() const { return (table_map)0L; } @@ -2502,7 +2588,7 @@ public: arg(a) {} bool eq(const Item *item, bool binary_cmp) const; bool fix_fields(THD *, Item **); - void print(String *str); + virtual void print(String *str, enum_query_type query_type); int save_in_field(Field *field_arg, bool no_conversions) { return Item_field::save_in_field(field_arg, no_conversions); @@ -2573,7 +2659,7 @@ public: enum Type type() const { return TRIGGER_FIELD_ITEM; } bool eq(const Item *item, bool binary_cmp) const; bool fix_fields(THD *, Item **); - void print(String *str); + virtual void print(String *str, enum_query_type query_type); table_map used_tables() const { return (table_map)0L; } Field *get_tmp_table_field() { return 0; } Item *copy_or_same(THD *thd) { return this; } @@ -2617,7 +2703,7 @@ private: }; -class Item_cache: public Item +class Item_cache: public Item_basic_constant { protected: Item *example; @@ -2664,9 +2750,7 @@ public: static Item_cache* get_cache(const Item *item); table_map used_tables() const { return used_table_map; } virtual void keep_array() {} - // to prevent drop fixed flag (no need parent cleanup call) - void cleanup() {} - void print(String *str); + virtual void print(String *str, enum_query_type query_type); bool eq_def(Field *field) { return cached_field ? cached_field->eq_def (field) : FALSE; |