83
86
which is represented as
84
87
Item_in_subselect(left, subselect)
86
Select_Lex* subselect= expr3->invalidate_and_restore_select_lex();
87
Item* result= new (session->mem_root) Item_in_subselect(left, subselect);
88
return equal ? result : negate_expression(session, result);
89
subselect= expr3->invalidate_and_restore_select_lex();
90
result= new (session->mem_root) Item_in_subselect(left, subselect);
93
result = negate_expression(session, result);
92
? (Item*) new (session->mem_root) Item_func_eq(left, expr)
93
: (Item*) new (session->mem_root) Item_func_ne(left, expr);
100
result= new (session->mem_root) Item_func_eq(left, expr);
102
result= new (session->mem_root) Item_func_ne(left, expr);
210
221
my_printf_error(ER_PARSE_ERROR_UNKNOWN, ER(ER_PARSE_ERROR_UNKNOWN), MYF(0), message);
213
bool check_reserved_words(str_ref name)
224
bool check_reserved_words(lex_string_t *name)
215
return not system_charset_info->strcasecmp(name.data(), "GLOBAL")
216
|| not system_charset_info->strcasecmp(name.data(), "LOCAL")
217
|| not system_charset_info->strcasecmp(name.data(), "SESSION");
226
if (!my_strcasecmp(system_charset_info, name->data(), "GLOBAL") ||
227
!my_strcasecmp(system_charset_info, name->data(), "LOCAL") ||
228
!my_strcasecmp(system_charset_info, name->data(), "SESSION"))
304
318
void buildSchemaOption(LEX *lex, const char *key, str_ref value)
306
statement::CreateSchema *statement= static_cast<statement::CreateSchema*>(lex->statement);
320
statement::CreateSchema *statement= (statement::CreateSchema *)lex->statement;
307
321
message::Engine::Option *opt= statement->schema_message.mutable_engine()->add_options();
308
322
opt->set_name(key);
309
323
opt->set_state(value.data(), value.size());
326
void buildSchemaDefiner(LEX *lex, const lex_string_t &value)
328
statement::CreateSchema *statement= (statement::CreateSchema *)lex->statement;
329
identifier::User user(value.data());
330
message::set_definer(statement->schema_message, user);
312
333
void buildSchemaDefiner(LEX *lex, const identifier::User &user)
314
statement::CreateSchema *statement= static_cast<statement::CreateSchema*>(lex->statement);
335
statement::CreateSchema *statement= (statement::CreateSchema *)lex->statement;
315
336
message::set_definer(statement->schema_message, user);
318
339
void buildSchemaOption(LEX *lex, const char *key, uint64_t value)
320
statement::CreateSchema *statement= static_cast<statement::CreateSchema*>(lex->statement);
341
statement::CreateSchema *statement= (statement::CreateSchema *)lex->statement;
321
342
message::Engine::Option *opt= statement->schema_message.mutable_engine()->add_options();
322
343
opt->set_name(key);
323
344
opt->set_state(boost::lexical_cast<std::string>(value));
326
bool checkFieldIdent(LEX *lex, str_ref schema_name, str_ref table_name)
347
bool checkFieldIdent(LEX *lex, const lex_string_t &schema_name, const lex_string_t &table_name)
328
349
TableList *table= reinterpret_cast<TableList*>(lex->current_select->table_list.first);
330
if (schema_name.size() && table_alias_charset->strcasecmp(schema_name.data(), table->getSchemaName()))
351
if (schema_name.size())
332
my_error(ER_WRONG_DB_NAME, MYF(0), schema_name.data());
353
if (my_strcasecmp(table_alias_charset, schema_name.data(), table->getSchemaName()))
355
my_error(ER_WRONG_DB_NAME, MYF(0), schema_name.data());
336
if (table_alias_charset->strcasecmp(table_name.data(), table->getTableName()))
360
if (my_strcasecmp(table_alias_charset, table_name.data(),
361
table->getTableName()))
338
363
my_error(ER_WRONG_TABLE_NAME, MYF(0), table_name.data());
345
Item *buildIdent(LEX *lex, str_ref schema_name, str_ref table_name, str_ref field_name)
370
Item *buildIdent(LEX *lex, const lex_string_t &schema_name, const lex_string_t &table_name, const lex_string_t &field_name)
347
372
Select_Lex *sel= lex->current_select;
356
381
: (Item*) new Item_ref(lex->current_context(), schema_name.data(), table_name.data(), field_name.data());
359
Item *buildTableWild(LEX *lex, str_ref schema_name, str_ref table_name)
384
Item *buildTableWild(LEX *lex, const lex_string_t &schema_name, const lex_string_t &table_name)
361
386
Select_Lex *sel= lex->current_select;
362
387
Item *item= new Item_field(lex->current_context(), schema_name.data(), table_name.data(), "*");
408
void buildKey(LEX *lex, Key::Keytype type_par, str_ref name_arg)
433
void buildKey(LEX *lex, Key::Keytype type_par, const lex_string_t &name_arg)
410
435
statement::AlterTable *statement= (statement::AlterTable *)lex->statement;
411
436
Key *key= new Key(type_par, name_arg, &statement->key_create_info, 0, lex->col_list);
413
438
lex->col_list.clear(); /* Alloced by memory::sql_alloc */
416
void buildForeignKey(LEX *lex, str_ref name_arg, drizzled::Table_ident *table)
441
void buildForeignKey(LEX *lex, const lex_string_t &name_arg, drizzled::Table_ident *table)
418
443
statement::AlterTable *statement= (statement::AlterTable *)lex->statement;
419
statement->alter_info.key_list.push_back(new Foreign_key(name_arg, lex->col_list, table, lex->ref_list,
420
statement->fk_delete_opt, statement->fk_update_opt, statement->fk_match_option));
444
Key *key= new Foreign_key(name_arg, lex->col_list,
447
statement->fk_delete_opt,
448
statement->fk_update_opt,
449
statement->fk_match_option);
422
statement->alter_info.key_list.push_back(new Key(Key::MULTIPLE, name_arg, &default_key_create_info, 1, lex->col_list));
451
statement->alter_info.key_list.push_back(key);
452
key= new Key(Key::MULTIPLE, name_arg, &default_key_create_info, 1, lex->col_list);
453
statement->alter_info.key_list.push_back(key);
423
454
lex->col_list.clear(); /* Alloced by memory::sql_alloc */
424
455
/* Only used for ALTER TABLE. Ignored otherwise. */
425
456
statement->alter_info.flags.set(ALTER_FOREIGN_KEY);
630
661
void buildReplicationOption(LEX *lex, bool arg)
632
statement::CreateSchema *statement= static_cast<statement::CreateSchema*>(lex->statement);
663
statement::CreateSchema *statement= (statement::CreateSchema *)lex->statement;
633
664
message::set_is_replicated(statement->schema_message, arg);