Drizzled Public API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
user_var_as_out_param.cc
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, Inc.
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
#include <config.h>
21
22
#include <cassert>
23
24
#include <drizzled/function/user_var_as_out_param.h>
25
#include <drizzled/user_var_entry.h>
26
#include <drizzled/session.h>
27
28
namespace
drizzled {
29
30
bool
Item_user_var_as_out_param::fix_fields(Session *session, Item **ref)
31
{
32
assert(
fixed
== 0);
33
if
(Item::fix_fields(session, ref) ||
34
!(entry= session->getVariable(name,
true
)))
35
return
true
;
36
entry->type= STRING_RESULT;
37
/*
38
Let us set the same collation which is used for loading
39
of fields in LOAD DATA INFILE.
40
(Since Item_user_var_as_out_param is used only there).
41
*/
42
entry->collation.set(default_charset_info);
43
entry->update_query_id= session->getQueryId();
44
return
false
;
45
}
46
47
void
Item_user_var_as_out_param::set_null_value(
const
charset_info_st* cs)
48
{
49
entry->
update_hash
(
true
,
data_ref
(), STRING_RESULT, cs, DERIVATION_IMPLICIT, 0
/* unsigned_arg */
);
50
}
51
52
53
void
Item_user_var_as_out_param::set_value(
str_ref
str,
const
charset_info_st* cs)
54
{
55
entry->
update_hash
(
false
, str, STRING_RESULT, cs, DERIVATION_IMPLICIT, 0
/* unsigned_arg */
);
56
}
57
58
double
Item_user_var_as_out_param::val_real
()
59
{
60
assert(0);
61
return
0.0;
62
}
63
64
65
int64_t
Item_user_var_as_out_param::val_int
()
66
{
67
assert(0);
68
return
0;
69
}
70
71
72
String
*
Item_user_var_as_out_param::val_str
(
String
*)
73
{
74
assert(0);
75
return
0;
76
}
77
78
type::Decimal
*
Item_user_var_as_out_param::val_decimal
(
type::Decimal
*)
79
{
80
assert(0);
81
return
0;
82
}
83
84
void
Item_user_var_as_out_param::print
(
String
*str)
85
{
86
str->append(
'@'
);
87
str->append(name);
88
}
89
90
}
/* namespace drizzled */
drizzled::Item::fixed
bool fixed
Definition:
item.h:120
drizzled::type::Decimal
Definition:
decimal.h:183
drizzled::Item_user_var_as_out_param::val_decimal
type::Decimal * val_decimal(type::Decimal *decimal_buffer)
Definition:
user_var_as_out_param.cc:78
drizzled::Item_user_var_as_out_param::val_real
double val_real()
Definition:
user_var_as_out_param.cc:58
drizzled::user_var_entry::update_hash
void update_hash(bool set_null, data_ref, Item_result type, const charset_info_st *cs, Derivation dv, bool unsigned_arg)
Definition:
user_var_entry.cc:190
data_ref_basic
Definition:
data_ref.h:26
drizzled::Item_user_var_as_out_param::val_int
int64_t val_int()
Definition:
user_var_as_out_param.cc:65
drizzled::Item_user_var_as_out_param::val_str
String * val_str(String *)
Definition:
user_var_as_out_param.cc:72
drizzled::String
Definition:
sql_string.h:57
drizzled::Item_user_var_as_out_param::print
virtual void print(String *)
Definition:
user_var_as_out_param.cc:84
drizzled
function
user_var_as_out_param.cc
Generated on Fri May 23 2014 13:09:07 for drizzle by
1.8.7