~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/parser.cc

  • Committer: Olaf van der Spek
  • Date: 2011-08-04 08:13:04 UTC
  • mfrom: (2384 drizzle)
  • mto: This revision was merged to the branch mainline in revision 2385.
  • Revision ID: olafvdspek@gmail.com-20110804081304-rlejjpvoos17bjdf
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
221
221
  my_printf_error(ER_PARSE_ERROR_UNKNOWN, ER(ER_PARSE_ERROR_UNKNOWN), MYF(0), message);
222
222
}
223
223
 
224
 
bool check_reserved_words(LEX_STRING *name)
 
224
bool check_reserved_words(lex_string_t *name)
225
225
{
226
226
  if (!my_strcasecmp(system_charset_info, name->str, "GLOBAL") ||
227
227
      !my_strcasecmp(system_charset_info, name->str, "LOCAL") ||
301
301
  return true;
302
302
}
303
303
 
304
 
void buildEngineOption(LEX *lex, const char *key, const LEX_STRING &value)
 
304
void buildEngineOption(LEX *lex, const char *key, const lex_string_t &value)
305
305
{
306
306
  message::Engine::Option *opt= lex->table()->mutable_engine()->add_options();
307
307
  opt->set_name(key);
315
315
  opt->set_state(boost::lexical_cast<std::string>(value));
316
316
}
317
317
 
318
 
void buildSchemaOption(LEX *lex, const char *key, const LEX_STRING &value)
 
318
void buildSchemaOption(LEX *lex, const char *key, const lex_string_t &value)
319
319
{
320
320
  statement::CreateSchema *statement= (statement::CreateSchema *)lex->statement;
321
321
  message::Engine::Option *opt= statement->schema_message.mutable_engine()->add_options();
323
323
  opt->set_state(value.str, value.length);
324
324
}
325
325
 
326
 
void buildSchemaDefiner(LEX *lex, const LEX_STRING &value)
 
326
void buildSchemaDefiner(LEX *lex, const lex_string_t &value)
327
327
{
328
328
  statement::CreateSchema *statement= (statement::CreateSchema *)lex->statement;
329
329
  identifier::User user(value.str);
344
344
  opt->set_state(boost::lexical_cast<std::string>(value));
345
345
}
346
346
 
347
 
bool checkFieldIdent(LEX *lex, const LEX_STRING &schema_name, const LEX_STRING &table_name)
 
347
bool checkFieldIdent(LEX *lex, const lex_string_t &schema_name, const lex_string_t &table_name)
348
348
{
349
349
  TableList *table= reinterpret_cast<TableList*>(lex->current_select->table_list.first);
350
350
 
368
368
}
369
369
 
370
370
Item *buildIdent(LEX *lex,
371
 
                 const LEX_STRING &schema_name,
372
 
                 const LEX_STRING &table_name,
373
 
                 const LEX_STRING &field_name)
 
371
                 const lex_string_t &schema_name,
 
372
                 const lex_string_t &table_name,
 
373
                 const lex_string_t &field_name)
374
374
{
375
375
  Select_Lex *sel= lex->current_select;
376
376
 
388
388
  return item;
389
389
}
390
390
 
391
 
Item *buildTableWild(LEX *lex, const LEX_STRING &schema_name, const LEX_STRING &table_name)
 
391
Item *buildTableWild(LEX *lex, const lex_string_t &schema_name, const lex_string_t &table_name)
392
392
{
393
393
  Select_Lex *sel= lex->current_select;
394
394
  Item *item= new Item_field(lex->current_context(), schema_name.str, table_name.str, "*");
403
403
  lex->length= lex->dec=0;
404
404
  lex->type=0;
405
405
  statement->default_value= statement->on_update_value= 0;
406
 
  statement->comment= null_lex_str;
 
406
  statement->comment= null_lex_string();
407
407
  lex->charset= NULL;
408
408
  statement->column_format= COLUMN_FORMAT_TYPE_DEFAULT;
409
409
 
438
438
  return true;
439
439
}
440
440
 
441
 
void buildKey(LEX *lex, Key::Keytype type_par, const LEX_STRING &name_arg)
 
441
void buildKey(LEX *lex, Key::Keytype type_par, const lex_string_t &name_arg)
442
442
{
443
443
  statement::AlterTable *statement= (statement::AlterTable *)lex->statement;
444
444
  Key *key= new Key(type_par, name_arg, &statement->key_create_info, 0,
447
447
  lex->col_list.clear(); /* Alloced by memory::sql_alloc */
448
448
}
449
449
 
450
 
void buildForeignKey(LEX *lex, const LEX_STRING &name_arg, drizzled::Table_ident *table)
 
450
void buildForeignKey(LEX *lex, const lex_string_t &name_arg, drizzled::Table_ident *table)
451
451
{
452
452
  statement::AlterTable *statement= (statement::AlterTable *)lex->statement;
453
453
  Key *key= new Foreign_key(name_arg, lex->col_list,