~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/get_user_var.cc

  • Committer: Monty Taylor
  • Date: 2009-04-14 19:16:51 UTC
  • mto: (997.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 994.
  • Revision ID: mordred@inaugust.com-20090414191651-ltbww6hpqks8k7qk
Clarified instructions in README.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
22
 
#include <float.h>
23
 
 
 
20
#include <drizzled/server_includes.h>
 
21
#include CSTDINT_H
24
22
#include <drizzled/function/get_user_var.h>
 
23
#include <drizzled/function/get_variable.h>
25
24
#include <drizzled/item/null.h>
26
25
#include <drizzled/sql_parse.h>
27
26
#include <drizzled/session.h>
28
27
 
29
 
namespace drizzled
30
 
{
31
 
 
32
 
String *Item_func_get_user_var::val_str(String *str)
 
28
String *
 
29
Item_func_get_user_var::val_str(String *str)
33
30
{
34
31
  assert(fixed == 1);
35
32
  if (!var_entry)
70
67
  decimals=NOT_FIXED_DEC;
71
68
  max_length=MAX_BLOB_WIDTH;
72
69
 
73
 
  var_entry= session->getVariable(name, false);
 
70
  var_entry= get_variable(&session->user_vars, name, 0);
74
71
 
75
72
  /*
76
73
    If the variable didn't exist it has been created as a STRING-type.
84
81
    max_length= var_entry->length;
85
82
 
86
83
    collation.set(var_entry->collation);
87
 
    switch(m_cached_result_type) 
88
 
    {
 
84
    switch(m_cached_result_type) {
89
85
    case REAL_RESULT:
90
86
      max_length= DBL_DIG + 8;
91
87
      break;
118
114
 
119
115
bool Item_func_get_user_var::const_item() const
120
116
{
121
 
  return (!var_entry || current_session->getQueryId() != var_entry->update_query_id);
 
117
  return (!var_entry || current_session->query_id != var_entry->update_query_id);
122
118
}
123
119
 
124
120
 
151
147
  return (name.length == other->name.length &&
152
148
          !memcmp(name.str, other->name.str, name.length));
153
149
}
154
 
 
155
 
} /* namespace drizzled */