~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/user_var_entry.h

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

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