~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/user_var_entry.h

  • Committer: Olaf van der Spek
  • Date: 2011-10-26 09:58:25 UTC
  • mto: This revision was merged to the branch mainline in revision 2456.
  • Revision ID: olafvdspek@gmail.com-20111026095825-kknxn203s8bku10g
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
class user_var_entry
29
29
{
30
30
 public:
31
 
  user_var_entry(const char *arg, query_id_t id) :
32
 
    value(0),
 
31
  user_var_entry(const char*, query_id_t id) :
 
32
    value(NULL),
33
33
    length(0),
34
34
    size(0),
35
35
    update_query_id(0),
38
38
    unsigned_flag(false),
39
39
    collation(NULL, DERIVATION_IMPLICIT)
40
40
  { 
41
 
    name.assign(strdup(arg), strlen(arg));
42
41
  }
43
42
 
44
43
  ~user_var_entry()
45
44
  {
46
 
    free(const_cast<char*>(name.data()));
47
45
    free(value);
48
46
  }
49
47
 
50
 
  lex_string_t name;
51
 
  char *value;
 
48
  char* value;
52
49
  ulong length;
53
50
  size_t size;
54
51
  query_id_t update_query_id;
55
52
  query_id_t used_query_id;
56
53
  Item_result type;
57
54
  bool unsigned_flag;
 
55
  DTCollation collation;
58
56
 
59
 
  double val_real(bool *null_value);
 
57
  double val_real(bool *null_value) const;
60
58
  int64_t val_int(bool *null_value) const;
61
 
  String *val_str(bool *null_value, String *str, uint32_t decimals);
62
 
  type::Decimal *val_decimal(bool *null_value, type::Decimal *result);
63
 
  DTCollation collation;
 
59
  String *val_str(bool *null_value, String*, uint32_t decimals) const;
 
60
  type::Decimal *val_decimal(bool *null_value, type::Decimal *result) const;
64
61
 
65
62
  void update_hash(bool set_null, data_ref, Item_result type, const charset_info_st* cs, Derivation dv, bool unsigned_arg);
66
63
};