~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.h

  • Committer: Monty Taylor
  • Date: 2008-11-25 01:28:52 UTC
  • mto: This revision was merged to the branch mainline in revision 612.
  • Revision ID: mtaylor@bitters-20081125012852-v93e3xn33qpon6re
Fixed a few things for solaris builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
 
78
78
public:
79
79
 
80
 
  enum Type {FIELD_ITEM= 0, 
81
 
    FUNC_ITEM,
82
 
    SUM_FUNC_ITEM,
83
 
    STRING_ITEM,
84
 
    INT_ITEM,
85
 
    REAL_ITEM,
86
 
    NULL_ITEM,
87
 
    VARBIN_ITEM,
88
 
    COPY_STR_ITEM,
89
 
    FIELD_AVG_ITEM,
90
 
    DEFAULT_VALUE_ITEM,
91
 
    PROC_ITEM,
92
 
    COND_ITEM,
93
 
    REF_ITEM,
94
 
    FIELD_STD_ITEM,
95
 
    FIELD_VARIANCE_ITEM,
96
 
    INSERT_VALUE_ITEM,
97
 
    SUBSELECT_ITEM,
98
 
    ROW_ITEM, CACHE_ITEM,
99
 
    TYPE_HOLDER,
100
 
    PARAM_ITEM,
101
 
    DECIMAL_ITEM
102
 
  };
 
80
  enum Type {FIELD_ITEM= 0, FUNC_ITEM, SUM_FUNC_ITEM, STRING_ITEM,
 
81
             INT_ITEM, REAL_ITEM, NULL_ITEM, VARBIN_ITEM,
 
82
             COPY_STR_ITEM, FIELD_AVG_ITEM, DEFAULT_VALUE_ITEM,
 
83
             PROC_ITEM,COND_ITEM, REF_ITEM, FIELD_STD_ITEM,
 
84
             FIELD_VARIANCE_ITEM, INSERT_VALUE_ITEM,
 
85
             SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM, TYPE_HOLDER,
 
86
             PARAM_ITEM, DECIMAL_ITEM,
 
87
             VIEW_FIXER_ITEM};
103
88
 
104
89
  enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE };
105
90
 
1189
1174
    // it is constant => can be used without fix_fields (and frequently used)
1190
1175
    fixed= 1;
1191
1176
  }
 
1177
  /*
 
1178
    This is used in stored procedures to avoid memory leaks and
 
1179
    does a deep copy of its argument.
 
1180
  */
 
1181
  void set_str_with_copy(const char *str_arg, uint32_t length_arg)
 
1182
  {
 
1183
    str_value.copy(str_arg, length_arg, collation.collation);
 
1184
    max_length= str_value.numchars() * collation.collation->mbmaxlen;
 
1185
  }
1192
1186
  void set_repertoire_from_value()
1193
1187
  {
1194
1188
    collation.repertoire= my_string_repertoire(str_value.charset(),
1557
1551
};
1558
1552
 
1559
1553
/*
 
1554
  Class for view fields, the same as Item_direct_ref, but call fix_fields
 
1555
  of reference if it is not called yet
 
1556
*/
 
1557
class Item_direct_view_ref :public Item_direct_ref
 
1558
{
 
1559
public:
 
1560
  Item_direct_view_ref(Name_resolution_context *context_arg, Item **item,
 
1561
                  const char *table_name_arg,
 
1562
                  const char *field_name_arg)
 
1563
    :Item_direct_ref(context_arg, item, table_name_arg, field_name_arg) {}
 
1564
  /* Constructor need to process subselect with temporary tables (see Item) */
 
1565
  Item_direct_view_ref(Session *session, Item_direct_ref *item)
 
1566
    :Item_direct_ref(session, item) {}
 
1567
 
 
1568
  bool fix_fields(Session *, Item **);
 
1569
  bool eq(const Item *item, bool binary_cmp) const;
 
1570
  Item *get_tmp_table_item(Session *session)
 
1571
  {
 
1572
    Item *item= Item_ref::get_tmp_table_item(session);
 
1573
    item->name= name;
 
1574
    return item;
 
1575
  }
 
1576
  virtual Ref_Type ref_type() { return VIEW_REF; }
 
1577
};
 
1578
 
 
1579
 
 
1580
/*
1560
1581
  Class for outer fields.
1561
1582
  An object of this class is created when the select where the outer field was
1562
1583
  resolved is a grouping one. After it has been fixed the ref field will point