~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
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
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
2154.2.17 by Brian Aker
Additional removal of session
24
#include <drizzled/dtcollation.h>
25
#include <drizzled/query_id.h>
851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
26
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
27
namespace drizzled
28
{
29
2154.2.17 by Brian Aker
Additional removal of session
30
namespace type { class Decimal; }
31
851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
32
// this is needed for user_vars hash
33
class user_var_entry
34
{
35
 public:
1089.1.5 by Brian Aker
Cleanup of user_var
36
  user_var_entry(const char *arg, query_id_t id) :
37
    value(0),
38
    length(0),
39
    size(0),
40
    update_query_id(0),
41
    used_query_id(id),
42
    type(STRING_RESULT),
43
    unsigned_flag(false),
44
    collation(NULL, DERIVATION_IMPLICIT)
45
  { 
46
    name.str= strdup(arg);
47
    name.length= strlen(arg);
1891.2.1 by Monty Taylor
Fixed things to make things compile with clang
48
  }
1089.1.5 by Brian Aker
Cleanup of user_var
49
50
  ~user_var_entry()
51
  {
52
    if (name.str) 
53
      free(name.str);
54
55
    if (value) 
56
      free(value);
57
  }
851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
58
  LEX_STRING name;
59
  char *value;
60
  ulong length;
1089.1.5 by Brian Aker
Cleanup of user_var
61
  size_t size;
62
  query_id_t update_query_id;
63
  query_id_t used_query_id;
851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
64
  Item_result type;
65
  bool unsigned_flag;
66
67
  double val_real(bool *null_value);
68
  int64_t val_int(bool *null_value) const;
69
  String *val_str(bool *null_value, String *str, uint32_t decimals);
2030.1.4 by Brian Aker
Change my_decimal to Decimal
70
  type::Decimal *val_decimal(bool *null_value, type::Decimal *result);
851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
71
  DTCollation collation;
1089.1.5 by Brian Aker
Cleanup of user_var
72
73
  bool update_hash(bool set_null, void *ptr, uint32_t length,
74
                   Item_result type, const CHARSET_INFO * const cs, Derivation dv,
75
                   bool unsigned_arg);
851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
76
};
77
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
78
} /* namespace drizzled */
79
851 by Brian Aker
Class rewrite of Session (aka get all of the junk out)
80
#endif /* DRIZZLED_USER_VAR_ENTRY_H */