303
void buildEngineOption(Session *session, const char *key, const LEX_STRING &value)
305
message::Engine::Option *opt= session->getLex()->table()->mutable_engine()->add_options();
307
opt->set_state(value.str, value.length);
310
void buildEngineOption(Session *session, const char *key, uint64_t value)
312
drizzled::message::Engine::Option *opt= session->getLex()->table()->mutable_engine()->add_options();
314
opt->set_state(boost::lexical_cast<std::string>(value));
317
void buildSchemaOption(Session *session, const char *key, const LEX_STRING &value)
319
statement::CreateSchema *statement= (statement::CreateSchema *)session->getLex()->statement;
320
message::Engine::Option *opt= statement->schema_message.mutable_engine()->add_options();
322
opt->set_state(value.str, value.length);
325
void buildSchemaOption(Session *session, const char *key, uint64_t value)
327
statement::CreateSchema *statement= (statement::CreateSchema *)session->getLex()->statement;
328
message::Engine::Option *opt= statement->schema_message.mutable_engine()->add_options();
330
opt->set_state(boost::lexical_cast<std::string>(value));
333
bool checkFieldIdent(Session *session, const LEX_STRING &schema_name, const LEX_STRING &table_name)
335
TableList *table= reinterpret_cast<TableList*>(session->getLex()->current_select->table_list.first);
303
void buildEngineOption(LEX *lex, const char *key, const LEX_STRING &value)
305
message::Engine::Option *opt= lex->table()->mutable_engine()->add_options();
307
opt->set_state(value.str, value.length);
310
void buildEngineOption(LEX *lex, const char *key, uint64_t value)
312
drizzled::message::Engine::Option *opt= lex->table()->mutable_engine()->add_options();
314
opt->set_state(boost::lexical_cast<std::string>(value));
317
void buildSchemaOption(LEX *lex, const char *key, const LEX_STRING &value)
319
statement::CreateSchema *statement= (statement::CreateSchema *)lex->statement;
320
message::Engine::Option *opt= statement->schema_message.mutable_engine()->add_options();
322
opt->set_state(value.str, value.length);
325
void buildSchemaOption(LEX *lex, const char *key, uint64_t value)
327
statement::CreateSchema *statement= (statement::CreateSchema *)lex->statement;
328
message::Engine::Option *opt= statement->schema_message.mutable_engine()->add_options();
330
opt->set_state(boost::lexical_cast<std::string>(value));
333
bool checkFieldIdent(LEX *lex, const LEX_STRING &schema_name, const LEX_STRING &table_name)
335
TableList *table= reinterpret_cast<TableList*>(lex->current_select->table_list.first);
337
337
if (schema_name.length)
356
Item *buildIdent(Session *session,
356
Item *buildIdent(LEX *lex,
357
357
const LEX_STRING &schema_name,
358
358
const LEX_STRING &table_name,
359
359
const LEX_STRING &field_name)
361
Select_Lex *sel= session->getLex()->current_select;
361
Select_Lex *sel= lex->current_select;
363
if (sel->no_table_names_allowed)
363
if (table_name.length and sel->no_table_names_allowed)
365
365
my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
366
MYF(0), table_name.str, session->where);
366
MYF(0), table_name.str, lex->session->where());
369
369
Item *item= (sel->parsing_place != IN_HAVING or
370
370
sel->get_in_sum_expr() > 0) ?
371
(Item*) new Item_field(session->getLex()->current_context(), schema_name.str, table_name.str, field_name.str) :
372
(Item*) new Item_ref(session->getLex()->current_context(), schema_name.str, table_name.str, field_name.str);
371
(Item*) new Item_field(lex->current_context(), schema_name.str, table_name.str, field_name.str) :
372
(Item*) new Item_ref(lex->current_context(), schema_name.str, table_name.str, field_name.str);
377
Item *buildTableWild(LEX *lex, const LEX_STRING &schema_name, const LEX_STRING &table_name)
379
Select_Lex *sel= lex->current_select;
380
Item *item= new Item_field(lex->current_context(), schema_name.str, table_name.str, "*");
386
void buildCreateFieldIdent(LEX *lex)
388
statement::CreateTable *statement= (statement::CreateTable *)lex->statement;
389
lex->length= lex->dec=0;
391
statement->default_value= statement->on_update_value= 0;
392
statement->comment= null_lex_str;
394
statement->column_format= COLUMN_FORMAT_TYPE_DEFAULT;
396
message::AlterTable &alter_proto= ((statement::CreateTable *)lex->statement)->alter_info.alter_proto;
397
lex->setField(alter_proto.add_added_field());
377
400
} // namespace parser