26 #include <drizzled/plugin.h>
27 #include <drizzled/plugin/plugin.h>
28 #include <drizzled/identifier.h>
29 #include <drizzled/message/table.pb.h>
30 #include <drizzled/charset.h>
31 #include <drizzled/field.h>
32 #include <drizzled/catalog/local.h>
43 #define TABLE_FUNCTION_BLOB_SIZE 2049
47 static const char *local_string_append(
const char *arg1,
const char *arg2)
49 static char buffer[1024];
50 char *buffer_ptr= buffer;
51 strcpy(buffer_ptr, arg1);
52 buffer_ptr+= strlen(arg1);
55 strcpy(buffer_ptr, arg2);
64 std::string local_path;
65 std::string original_table_label;
72 TableFunction(
const char *schema_arg,
const char *table_arg) :
73 Plugin(local_string_append(schema_arg, table_arg) ,
"TableFunction"),
74 identifier(drizzled::catalog::local_identifier(),
75 schema_arg, table_arg),
76 original_table_label(table_arg)
85 static void getNames(
const std::string &arg,
86 std::set<std::string> &set_of_names);
99 Field **columns_iterator;
121 bool sub_populate(uint32_t field_size);
123 virtual bool populate()
128 void push(uint64_t arg);
129 void push(int64_t arg);
130 void push(
const char *arg, uint32_t length= 0);
135 bool isWild(
const std::string &predicate);
143 const std::string &getTableLabel()
145 return original_table_label;
148 const std::string &getIdentifierTableName()
150 return identifier.getTableName();
153 const std::string &getSchemaHome()
155 return identifier.getSchemaName();
158 const std::string &getPath()
160 return identifier.getPath();
163 virtual Generator *generator(Field **arg);
165 void add_field(
const char *label,
166 message::Table::Field::FieldType type,
169 void add_field(
const char *label,
170 uint32_t field_length= MAXIMUM_IDENTIFIER_LENGTH);
172 void add_field(
const char *label,
173 TableFunction::ColumnType type,
174 bool is_default_null=
true);
176 void add_field(
const char *label,
177 TableFunction::ColumnType type,
178 uint32_t field_length,
179 bool is_default_null=
false);
181 virtual bool visible()
const {
return true; }
TODO: Rename this file - func.h is stupid.
Visibility Control Macros.
Represents a statement to be executed.