~drizzle-trunk/drizzle/development

851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
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
21
#ifndef DRIZZLED_USER_VAR_ENTRY_H
22
#define DRIZZLED_USER_VAR_ENTRY_H
23
24
25
// this is needed for user_vars hash
26
class user_var_entry
27
{
28
 public:
1089.1.5 by Brian Aker
Cleanup of user_var
29
  user_var_entry(const char *arg, query_id_t id) :
30
    value(0),
31
    length(0),
32
    size(0),
33
    update_query_id(0),
34
    used_query_id(id),
35
    type(STRING_RESULT),
36
    unsigned_flag(false),
37
    collation(NULL, DERIVATION_IMPLICIT)
38
  { 
39
    name.str= strdup(arg);
40
    name.length= strlen(arg);
41
  };
42
43
  ~user_var_entry()
44
  {
45
    if (name.str) 
46
      free(name.str);
47
48
    if (value) 
49
      free(value);
50
  }
851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
51
  LEX_STRING name;
52
  char *value;
53
  ulong length;
1089.1.5 by Brian Aker
Cleanup of user_var
54
  size_t size;
55
  query_id_t update_query_id;
56
  query_id_t used_query_id;
851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
57
  Item_result type;
58
  bool unsigned_flag;
59
60
  double val_real(bool *null_value);
61
  int64_t val_int(bool *null_value) const;
62
  String *val_str(bool *null_value, String *str, uint32_t decimals);
63
  my_decimal *val_decimal(bool *null_value, my_decimal *result);
64
  DTCollation collation;
1089.1.5 by Brian Aker
Cleanup of user_var
65
66
  bool update_hash(bool set_null, void *ptr, uint32_t length,
67
                   Item_result type, const CHARSET_INFO * const cs, Derivation dv,
68
                   bool unsigned_arg);
851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
69
};
70
71
#endif /* DRIZZLED_USER_VAR_ENTRY_H */