16
16
#include <drizzled/server_includes.h>
17
17
#include <drizzled/error.h>
18
#include <drizzled/virtual_column_info.h>
19
18
#include <drizzled/session.h>
20
19
#include <drizzled/unireg.h>
174
173
assert(0); /* Tell us, since this shouldn't happend */
177
if(field_arg->vcol_info)
180
tmp_len= system_charset_info->cset->charpos(system_charset_info,
181
field_arg->vcol_info->expr_str.str,
182
field_arg->vcol_info->expr_str.str +
183
field_arg->vcol_info->expr_str.length,
184
VIRTUAL_COLUMN_EXPRESSION_MAXLEN);
186
if (tmp_len < field_arg->vcol_info->expr_str.length)
188
my_error(ER_WRONG_STRING_LENGTH, MYF(0),
189
field_arg->vcol_info->expr_str.str,"VIRTUAL COLUMN EXPRESSION",
190
(uint32_t) VIRTUAL_COLUMN_EXPRESSION_MAXLEN);
194
drizzled::message::Table::Field::VirtualFieldOptions *field_options;
196
field_options= attribute->mutable_virtual_options();
198
field_options->set_type(attribute->type());
199
attribute->set_type(drizzled::message::Table::Field::VIRTUAL);
201
string expr(field_arg->vcol_info->expr_str.str,
202
field_arg->vcol_info->expr_str.length);
204
field_options->set_expression(expr);
205
field_options->set_physically_stored(field_arg->is_stored);
209
177
field_constraints= attribute->mutable_constraints();
210
178
constraints->set_is_nullable(field_arg->def->null_value);