~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/parser.cc

  • Committer: Mark Atwood
  • Date: 2011-08-11 03:05:03 UTC
  • mfrom: (2385.1.12 refactor4)
  • Revision ID: me@mark.atwood.name-20110811030503-rp9xjihc5x3y0x4q
mergeĀ lp:~olafvdspek/drizzle/refactor4

Show diffs side-by-side

added added

removed removed

Lines of Context:
415
415
{
416
416
  statement::AlterTable *statement= (statement::AlterTable *)lex->statement;
417
417
 
418
 
  lex->last_field->after=const_cast<char*> (position);
 
418
  lex->last_field->after= position;
419
419
  statement->alter_info.flags.set(ALTER_COLUMN_ORDER);
420
420
}
421
421
 
441
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
 
  Key *key= new Key(type_par, name_arg, &statement->key_create_info, 0,
445
 
                    lex->col_list);
 
444
  Key *key= new Key(type_par, name_arg, &statement->key_create_info, 0, lex->col_list);
446
445
  statement->alter_info.key_list.push_back(key);
447
446
  lex->col_list.clear(); /* Alloced by memory::sql_alloc */
448
447
}
458
457
                            statement->fk_match_option);
459
458
 
460
459
  statement->alter_info.key_list.push_back(key);
461
 
  key= new Key(Key::MULTIPLE, name_arg,
462
 
               &default_key_create_info, 1,
463
 
               lex->col_list);
 
460
  key= new Key(Key::MULTIPLE, name_arg, &default_key_create_info, 1, lex->col_list);
464
461
  statement->alter_info.key_list.push_back(key);
465
462
  lex->col_list.clear(); /* Alloced by memory::sql_alloc */
466
463
  /* Only used for ALTER TABLE. Ignored otherwise. */
469
466
 
470
467
drizzled::enum_field_types buildIntegerColumn(LEX *lex, drizzled::enum_field_types final_type, const bool is_unsigned)
471
468
472
 
  lex->length=(char*) 0; /* use default length */
 
469
  lex->length= NULL; /* use default length */
473
470
 
474
471
  if (is_unsigned)
475
472
  {
518
515
 
519
516
drizzled::enum_field_types buildVarcharColumn(LEX *lex, const char *length)
520
517
{
521
 
  lex->length= const_cast<char *>(length);
 
518
  lex->length= length;
522
519
 
523
520
  if (lex->field())
524
521
  {
544
541
 
545
542
drizzled::enum_field_types buildVarbinaryColumn(LEX *lex, const char *length)
546
543
{
547
 
  lex->length= const_cast<char *>(length);
 
544
  lex->length= length;
548
545
  lex->charset= &my_charset_bin;
549
546
 
550
547
  if (lex->field())
616
613
 
617
614
  if (length)
618
615
  {
619
 
    lex->length= const_cast<char *>(length);
 
616
    lex->length= length;
620
617
    return DRIZZLE_TYPE_MICROTIME;
621
618
  }
622
619