~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/item_row.h

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
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
17
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 */
19
 
 
20
 
#ifndef DRIZZLED_ITEM_ROW_H
21
 
#define DRIZZLED_ITEM_ROW_H
22
 
 
23
 
#include "drizzled/item.h"
 
1
/* Copyright (C) 2000 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
24
15
 
25
16
class Item_row: public Item
26
17
{
27
18
  Item **items;
28
19
  table_map used_tables_cache;
29
 
  uint32_t arg_count;
 
20
  uint arg_count;
30
21
  bool const_item_cache;
31
22
  bool with_null;
32
23
public:
33
 
 
34
 
  using Item::split_sum_func;
35
 
 
36
24
  Item_row(List<Item> &);
37
25
  Item_row(Item_row *item):
38
26
    Item(),
46
34
  enum Type type() const { return ROW_ITEM; };
47
35
  void illegal_method_call(const char *);
48
36
  bool is_null() { return null_value; }
49
 
  void make_field(SendField *)
 
37
  void make_field(Send_field *)
50
38
  {
51
39
    illegal_method_call((const char*)"make_field");
52
40
  };
55
43
    illegal_method_call((const char*)"val");
56
44
    return 0;
57
45
  };
58
 
  int64_t val_int()
 
46
  longlong val_int()
59
47
  {
60
48
    illegal_method_call((const char*)"val_int");
61
49
    return 0;
70
58
    illegal_method_call((const char*)"val_decimal");
71
59
    return 0;
72
60
  };
73
 
  bool fix_fields(Session *session, Item **ref);
74
 
  void fix_after_pullout(Select_Lex *new_parent, Item **ref);
 
61
  bool fix_fields(THD *thd, Item **ref);
 
62
  void fix_after_pullout(st_select_lex *new_parent, Item **ref);
75
63
  void cleanup();
76
 
  void split_sum_func(Session *session, Item **ref_pointer_array, List<Item> &fields);
 
64
  void split_sum_func(THD *thd, Item **ref_pointer_array, List<Item> &fields);
77
65
  table_map used_tables() const { return used_tables_cache; };
78
66
  bool const_item() const { return const_item_cache; };
79
67
  enum Item_result result_type() const { return ROW_RESULT; }
80
68
  void update_used_tables();
81
69
  virtual void print(String *str, enum_query_type query_type);
82
70
 
83
 
  bool walk(Item_processor processor, bool walk_subquery, unsigned char *arg);
84
 
  Item *transform(Item_transformer transformer, unsigned char *arg);
 
71
  bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
 
72
  Item *transform(Item_transformer transformer, uchar *arg);
85
73
 
86
 
  uint32_t cols() { return arg_count; }
87
 
  Item* element_index(uint32_t i) { return items[i]; }
88
 
  Item** addr(uint32_t i) { return items + i; }
89
 
  bool check_cols(uint32_t c);
 
74
  uint cols() { return arg_count; }
 
75
  Item* element_index(uint i) { return items[i]; }
 
76
  Item** addr(uint i) { return items + i; }
 
77
  bool check_cols(uint c);
90
78
  bool null_inside() { return with_null; };
91
79
  void bring_value();
92
80
};
93
 
 
94
 
#endif /* DRIZZLED_ITEM_ROW_H */