~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/user_var_entry.h

  • Committer: Stewart Smith
  • Date: 2010-02-22 07:44:37 UTC
  • mfrom: (1283.17.4)
  • mto: (1283.19.1)
  • mto: This revision was merged to the branch mainline in revision 1449.
  • Revision ID: stewart@flamingspork.com-20100222074437-1a9x1n030tbtv1qv
Merged embeddded-innodb-store-table-proto into embedded-innodb-write-row.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
18
18
 */
19
19
 
20
20
 
21
 
#pragma once
22
 
 
23
 
#include <drizzled/dtcollation.h>
24
 
#include <drizzled/item_result.h>
25
 
 
26
 
namespace drizzled {
27
 
 
 
21
#ifndef DRIZZLED_USER_VAR_ENTRY_H
 
22
#define DRIZZLED_USER_VAR_ENTRY_H
 
23
 
 
24
#include "drizzled/query_id.h"
 
25
 
 
26
namespace drizzled
 
27
{
 
28
 
 
29
// this is needed for user_vars hash
28
30
class user_var_entry
29
31
{
30
32
 public:
40
42
  { 
41
43
    name.str= strdup(arg);
42
44
    name.length= strlen(arg);
43
 
  }
 
45
  };
44
46
 
45
47
  ~user_var_entry()
46
48
  {
47
 
    free(name.str);
48
 
    free(value);
 
49
    if (name.str) 
 
50
      free(name.str);
 
51
 
 
52
    if (value) 
 
53
      free(value);
49
54
  }
50
 
 
51
 
  lex_string_t name;
 
55
  LEX_STRING name;
52
56
  char *value;
53
57
  ulong length;
54
58
  size_t size;
60
64
  double val_real(bool *null_value);
61
65
  int64_t val_int(bool *null_value) const;
62
66
  String *val_str(bool *null_value, String *str, uint32_t decimals);
63
 
  type::Decimal *val_decimal(bool *null_value, type::Decimal *result);
 
67
  my_decimal *val_decimal(bool *null_value, my_decimal *result);
64
68
  DTCollation collation;
65
69
 
66
 
  void update_hash(bool set_null, void *ptr, uint32_t length,
67
 
                   Item_result type, const charset_info_st * const cs, Derivation dv,
 
70
  bool update_hash(bool set_null, void *ptr, uint32_t length,
 
71
                   Item_result type, const CHARSET_INFO * const cs, Derivation dv,
68
72
                   bool unsigned_arg);
69
73
};
70
74
 
71
75
} /* namespace drizzled */
72
76
 
 
77
#endif /* DRIZZLED_USER_VAR_ENTRY_H */