drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
make_set.h
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#pragma once
21
22#include <drizzled/function/str/strfunc.h>
23
24namespace drizzled
25{
26
27class Item_func_make_set :public Item_str_func
28{
29 Session &session;
30 Item *item;
31 String tmp_str;
32
33public:
34 using Item::split_sum_func;
35 Item_func_make_set(Session &session_arg, Item *a, List<Item> &list) :
36 Item_str_func(list),
37 session(session_arg),
38 item(a) {}
39 String *val_str(String *str);
40 bool fix_fields(Session *session_arg, Item **ref)
41 {
42 assert(fixed == 0);
43 return ((!item->fixed && item->fix_fields(session_arg, &item)) ||
44 item->check_cols(1) ||
45 Item_func::fix_fields(session_arg, ref));
46 }
47 void split_sum_func(Session *session_arg, Item **ref_pointer_array, List<Item> &fields);
48 void fix_length_and_dec();
49 void update_used_tables();
50 const char *func_name() const { return "make_set"; }
51
52 bool walk(Item_processor processor, bool walk_subquery, unsigned char *arg)
53 {
54 return item->walk(processor, walk_subquery, arg) ||
55 Item_str_func::walk(processor, walk_subquery, arg);
56 }
57 Item *transform(Item_transformer transformer, unsigned char *arg);
58 virtual void print(String *str);
59};
60
61} /* namespace drizzled */
62
virtual void print(String *str)
Definition make_set.cc:121
String * val_str(String *str)
Definition make_set.cc:60
void split_sum_func(Session *session_arg, Item **ref_pointer_array, List< Item > &fields)
Definition make_set.cc:36
Item * transform(Item_transformer transformer, unsigned char *arg)
Definition make_set.cc:111
bool fixed
Definition item.h:122
TODO: Rename this file - func.h is stupid.