~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/set_user_var.h

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
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
22
22
 
23
23
#include <drizzled/function/func.h>
24
24
 
 
25
namespace drizzled
 
26
{
 
27
 
25
28
/* Handling of user definable variables */
26
29
 
27
30
class user_var_entry;
32
35
  user_var_entry *entry;
33
36
  char buffer[MAX_FIELD_WIDTH];
34
37
  String value;
35
 
  my_decimal decimal_buff;
 
38
  type::Decimal decimal_buff;
36
39
  bool null_item;
37
40
  union
38
41
  {
39
42
    int64_t vint;
40
43
    double vreal;
41
44
    String *vstr;
42
 
    my_decimal *vdec;
 
45
    type::Decimal *vdec;
43
46
  } save_result;
44
47
 
45
48
public:
51
54
  double val_real();
52
55
  int64_t val_int();
53
56
  String *val_str(String *str);
54
 
  my_decimal *val_decimal(my_decimal *);
 
57
  type::Decimal *val_decimal(type::Decimal *);
55
58
  double val_result();
56
59
  int64_t val_int_result();
57
60
  String *str_result(String *str);
58
 
  my_decimal *val_decimal_result(my_decimal *);
 
61
  type::Decimal *val_decimal_result(type::Decimal *);
59
62
  bool update_hash(void *ptr, uint32_t length, enum Item_result type,
60
63
                   const CHARSET_INFO * const cs, Derivation dv, bool unsigned_arg);
61
 
  bool send(drizzled::plugin::Protocol *protocol, String *str_arg);
 
64
  bool send(plugin::Client *client, String *str_arg);
62
65
  void make_field(SendField *tmp_field);
63
66
  bool check(bool use_result_field);
64
67
  bool update();
66
69
  bool fix_fields(Session *session, Item **ref);
67
70
  void fix_length_and_dec();
68
71
  virtual void print(String *str, enum_query_type query_type);
69
 
  void print_as_stmt(String *str, enum_query_type query_type);
 
72
 
70
73
  const char *func_name() const { return "set_user_var"; }
71
74
  int save_in_field(Field *field, bool no_conversions,
72
75
                    bool can_use_result_field);
78
81
  bool register_field_in_read_map(unsigned char *arg);
79
82
};
80
83
 
 
84
} /* namespace drizzled */
 
85
 
81
86
#endif /* DRIZZLED_FUNCTION_SET_USER_VAR_H */