~drizzle-trunk/drizzle/development

584.4.5 by Monty Taylor
Split out cache_row and type_holder.
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_CACHE_ROW_H
21
#define DRIZZLED_ITEM_CACHE_ROW_H
22
23
#include <stdint.h>
24
25
class Item_cache;
26
class Item;
27
class Send_field;
28
29
class Item_cache_row: public Item_cache
30
{
31
  Item_cache  **values;
32
  uint32_t item_count;
33
  bool save_array;
34
public:
35
36
  Item_cache_row()
37
  :Item_cache(), values(0), item_count(2), save_array(0) {}
38
39
  /*
40
    'allocate' used only in row transformer, to preallocate space for row
41
    cache.
42
  */
43
  bool allocate(uint32_t num);
44
  /*
45
    'setup' is needed only by row => it not called by simple row subselect
46
    (only by IN subselect (in subselect optimizer))
47
  */
48
  bool setup(Item *item);
49
  void store(Item *item);
50
  void illegal_method_call(const char * method_name);
51
  void make_field(Send_field *field);
52
  double val_real();
53
  int64_t val_int();
54
  String *val_str(String *val);
55
  my_decimal *val_decimal(my_decimal *val);
56
57
  enum Item_result result_type() const;
58
59
  uint32_t cols();
60
  Item *element_index(uint32_t i);
61
  Item **addr(uint32_t i);
62
  bool check_cols(uint32_t c);
63
  bool null_inside();
64
  void bring_value();
65
  void keep_array();
66
  void cleanup();
67
68
};
69
70
#endif /* DRIZZLED_ITEM_CACHE_ROW_H */