1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
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.
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.
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
20
#ifndef DRIZZLED_ITEM_TYPE_HOLDER_H
21
#define DRIZZLED_ITEM_TYPE_HOLDER_H
23
typedef struct st_typelib TYPELIB;
30
Item_type_holder used to store type. name, length of Item for UNIONS &
33
Item_type_holder do not need cleanup() because its time of live limited by
34
single SP/PS execution.
36
class Item_type_holder: public Item
39
TYPELIB *enum_set_typelib;
40
enum_field_types fld_type;
43
Get full information from Item about enum/set fields to be able to create
46
@param item Item for information collection
48
void get_full_info(Item *item);
50
/* It is used to count decimal precision in join_types */
51
int prev_decimal_int_part;
53
Item_type_holder(Session *session, Item *item);
56
Return expression type of Item_type_holder.
59
Item_result (type of internal Drizzle expression result)
61
Item_result result_type() const;
63
enum_field_types field_type() const { return fld_type; };
64
enum Type type() const { return TYPE_HOLDER; }
67
my_decimal *val_decimal(my_decimal *val);
68
String *val_str(String* val);
71
Find field type which can carry current Item_type_holder type and
74
@param session thread handler
75
@param item given item to join its parameters with this item ones
78
true error - types are incompatible
82
bool join_types(Session *session, Item *item);
85
Make temporary table field according collected information about type
88
@param table temporary table for which we create fields
93
Field *make_field_by_type(Table *table);
96
Calculate lenth for merging result for given Item type.
98
@param item Item for length detection
103
static uint32_t display_length(Item *item);
106
Find real field type of item.
109
type of field which should be created to store item value
111
static enum_field_types get_real_type(Item *item);
115
#endif /* DRIZZLED_ITEM_TYPE_HOLDER_H */