1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
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.
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.
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
20
#include <drizzled/server_includes.h>
22
#include <drizzled/functions/str/conv.h>
24
String *Item_str_conv::val_str(String *str)
28
if (!(res=args[0]->val_str(str)))
30
null_value=1; /* purecov: inspected */
31
return 0; /* purecov: inspected */
37
res= copy_if_not_alloced(str,res,res->length());
38
len= converter(collation.collation, (char*) res->ptr(), res->length(),
39
(char*) res->ptr(), res->length());
40
assert(len <= res->length());
45
uint32_t len= res->length() * multiply;
47
tmp_value.set_charset(collation.collation);
48
len= converter(collation.collation, (char*) res->ptr(), res->length(),
49
(char*) tmp_value.ptr(), len);
50
tmp_value.length(len);
56
void Item_func_lcase::fix_length_and_dec()
58
collation.set(args[0]->collation);
59
multiply= collation.collation->casedn_multiply;
60
converter= collation.collation->cset->casedn;
61
max_length= args[0]->max_length * multiply;
64
void Item_func_ucase::fix_length_and_dec()
66
collation.set(args[0]->collation);
67
multiply= collation.collation->caseup_multiply;
68
converter= collation.collation->cset->caseup;
69
max_length= args[0]->max_length * multiply;