MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
item_row.h
1 #ifndef ITEM_ROW_INCLUDED
2 #define ITEM_ROW_INCLUDED
3 
4 /* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; version 2 of the License.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software Foundation,
17  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
18 
19 class Item_row: public Item
20 {
21  Item **items;
22  table_map used_tables_cache, not_null_tables_cache;
23  uint arg_count;
24  bool const_item_cache;
25  bool with_null;
26 public:
28  Item_row(Item_row *item):
29  Item(),
30  items(item->items),
31  used_tables_cache(item->used_tables_cache),
32  not_null_tables_cache(0),
33  arg_count(item->arg_count),
34  const_item_cache(item->const_item_cache),
35  with_null(0)
36  {}
37 
38  enum Type type() const { return ROW_ITEM; };
39  void illegal_method_call(const char *);
40  bool is_null() { return null_value; }
41  void make_field(Send_field *)
42  {
43  illegal_method_call((const char*)"make_field");
44  };
45  double val_real()
46  {
47  illegal_method_call((const char*)"val");
48  return 0;
49  };
50  longlong val_int()
51  {
52  illegal_method_call((const char*)"val_int");
53  return 0;
54  };
55  String *val_str(String *)
56  {
57  illegal_method_call((const char*)"val_str");
58  return 0;
59  };
60  my_decimal *val_decimal(my_decimal *)
61  {
62  illegal_method_call((const char*)"val_decimal");
63  return 0;
64  };
65  bool get_date(MYSQL_TIME *ltime, uint fuzzydate)
66  {
67  illegal_method_call((const char *) "get_date");
68  return true;
69  }
70  bool get_time(MYSQL_TIME *ltime)
71  {
72  illegal_method_call((const char *) "get_time");
73  return true;
74  }
75 
76  bool fix_fields(THD *thd, Item **ref);
77  void fix_after_pullout(st_select_lex *parent_select,
78  st_select_lex *removed_select);
79  void cleanup();
80  void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
81  List<Item> &fields);
82  table_map used_tables() const { return used_tables_cache; };
83  bool const_item() const { return const_item_cache; };
84  enum Item_result result_type() const { return ROW_RESULT; }
85  void update_used_tables();
86  table_map not_null_tables() const { return not_null_tables_cache; }
87  virtual void print(String *str, enum_query_type query_type);
88 
89  bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
90  Item *transform(Item_transformer transformer, uchar *arg);
91 
92  uint cols() { return arg_count; }
93  Item* element_index(uint i) { return items[i]; }
94  Item** addr(uint i) { return items + i; }
95  bool check_cols(uint c);
96  bool null_inside() { return with_null; };
97  void bring_value();
98 };
99 
100 #endif /* ITEM_ROW_INCLUDED */