My Project
item_row.h
00001 #ifndef ITEM_ROW_INCLUDED
00002 #define ITEM_ROW_INCLUDED
00003 
00004 /* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; version 2 of the License.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software Foundation,
00017    51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
00018 
00019 class Item_row: public Item
00020 {
00021   Item **items;
00022   table_map used_tables_cache, not_null_tables_cache;
00023   uint arg_count;
00024   bool const_item_cache;
00025   bool with_null;
00026 public:
00027   Item_row(List<Item> &);
00028   Item_row(Item *head, List<Item> &tail);
00029   Item_row(Item_row *item):
00030     Item(),
00031     items(item->items),
00032     used_tables_cache(item->used_tables_cache),
00033     not_null_tables_cache(0),
00034     arg_count(item->arg_count),
00035     const_item_cache(item->const_item_cache),
00036     with_null(0)
00037   {}
00038 
00039   enum Type type() const { return ROW_ITEM; };
00040   void illegal_method_call(const char *);
00041   bool is_null() { return null_value; }
00042   void make_field(Send_field *)
00043   {
00044     illegal_method_call((const char*)"make_field");
00045   };
00046   double val_real()
00047   {
00048     illegal_method_call((const char*)"val");
00049     return 0;
00050   };
00051   longlong val_int()
00052   {
00053     illegal_method_call((const char*)"val_int");
00054     return 0;
00055   };
00056   String *val_str(String *)
00057   {
00058     illegal_method_call((const char*)"val_str");
00059     return 0;
00060   };
00061   my_decimal *val_decimal(my_decimal *)
00062   {
00063     illegal_method_call((const char*)"val_decimal");
00064     return 0;
00065   };
00066   bool get_date(MYSQL_TIME *ltime, uint fuzzydate)
00067   {
00068     illegal_method_call((const char *) "get_date");
00069     return true;
00070   }
00071   bool get_time(MYSQL_TIME *ltime)
00072   {
00073     illegal_method_call((const char *) "get_time");
00074     return true;
00075   }
00076 
00077   bool fix_fields(THD *thd, Item **ref);
00078   void fix_after_pullout(st_select_lex *parent_select,
00079                          st_select_lex *removed_select);
00080   void cleanup();
00081   void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
00082                       List<Item> &fields);
00083   table_map used_tables() const { return used_tables_cache; };
00084   bool const_item() const { return const_item_cache; };
00085   enum Item_result result_type() const { return ROW_RESULT; }
00086   void update_used_tables();
00087   table_map not_null_tables() const { return not_null_tables_cache; }
00088   virtual void print(String *str, enum_query_type query_type);
00089 
00090   bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
00091   Item *transform(Item_transformer transformer, uchar *arg);
00092 
00093   uint cols() { return arg_count; }
00094   Item* element_index(uint i) { return items[i]; }
00095   Item** addr(uint i) { return items + i; }
00096   bool check_cols(uint c);
00097   bool null_inside() { return with_null; };
00098   void bring_value();
00099 };
00100 
00101 #endif /* ITEM_ROW_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines