24 #include <drizzled/function/get_user_var.h>
25 #include <drizzled/item/null.h>
26 #include <drizzled/sql_parse.h>
27 #include <drizzled/session.h>
28 #include <drizzled/user_var_entry.h>
67 void Item_func_get_user_var::fix_length_and_dec()
70 decimals=NOT_FIXED_DEC;
71 max_length=MAX_BLOB_WIDTH;
73 var_entry= session.getVariable(
name,
false);
80 m_cached_result_type= var_entry->type;
81 unsigned_flag= var_entry->unsigned_flag;
82 max_length= var_entry->length;
84 collation.set(var_entry->collation);
85 switch(m_cached_result_type)
88 max_length= DBL_DIG + 8;
92 max_length= MAX_BIGINT_WIDTH;
96 max_length= MAX_BLOB_WIDTH;
100 max_length= DECIMAL_MAX_STR_LENGTH;
101 decimals= DECIMAL_MAX_SCALE;
111 collation.set(&my_charset_bin, DERIVATION_IMPLICIT);
113 m_cached_result_type= STRING_RESULT;
114 max_length= MAX_BLOB_WIDTH;
121 return (!var_entry || session.
getQueryId() != var_entry->update_query_id);
125 enum Item_result Item_func_get_user_var::result_type()
const
127 return m_cached_result_type;
133 str->append(STRING_WITH_LEN(
"(@"));
146 if (item->type() != FUNC_ITEM ||
147 ((
Item_func*) item)->functype() != functype())
150 return (
name.size() == other->
name.size() &&