~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/parser.cc

  • Committer: Lee Bieber
  • Date: 2011-02-11 20:30:05 UTC
  • mfrom: (2157.1.3 build)
  • Revision ID: kalebral@gmail.com-20110211203005-757o1y2yf78dxzqr
Merge Stewart - 716848: drizzleimport displays wrong program_name
Merge Stewart - update README file
Merge Andrew and Joe - Exposes the InnoDB SYS_REPLICATION_LOG to data_dictionary so that it is fast and fixes many issues we have been having

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include "config.h"
22
22
 
23
23
#include <drizzled/parser.h>
24
24
 
248
248
  push an error into the error stack and DRIZZLE_YYABORT
249
249
  to abort from the parser.
250
250
*/
251
 
void errorOn(drizzled::Session *session, const char *s)
 
251
void errorOn(const char *s)
252
252
{
 
253
  Session *session= current_session;
 
254
 
253
255
  /* "parse error" changed into "syntax error" between bison 1.75 and 1.875 */
254
256
  if (strcmp(s,"parse error") == 0 || strcmp(s,"syntax error") == 0)
255
257
  {
428
430
  Key *key= new Key(type_par, name_arg, &statement->key_create_info, 0,
429
431
                    lex->col_list);
430
432
  statement->alter_info.key_list.push_back(key);
431
 
  lex->col_list.clear(); /* Alloced by memory::sql_alloc */
 
433
  lex->col_list.empty(); /* Alloced by memory::sql_alloc */
432
434
}
433
435
 
434
436
void buildForeignKey(LEX *lex, const lex_string_t &name_arg, drizzled::Table_ident *table)
446
448
               &default_key_create_info, 1,
447
449
               lex->col_list);
448
450
  statement->alter_info.key_list.push_back(key);
449
 
  lex->col_list.clear(); /* Alloced by memory::sql_alloc */
 
451
  lex->col_list.empty(); /* Alloced by memory::sql_alloc */
450
452
  /* Only used for ALTER TABLE. Ignored otherwise. */
451
453
  statement->alter_info.flags.set(ALTER_FOREIGN_KEY);
452
454
}
645
647
  }
646
648
}
647
649
 
648
 
void buildReplicationOption(LEX *lex, bool arg)
649
 
{
650
 
  statement::CreateSchema *statement= (statement::CreateSchema *)lex->statement;
651
 
  message::ReplicationOptions *options= statement->schema_message.mutable_replication_options();
652
 
  options->set_dont_replicate(arg);
653
 
}
654
 
 
655
 
void buildAddAlterDropIndex(LEX *lex, const char *name, bool is_foreign_key)
656
 
{
657
 
  statement::AlterTable *statement= (statement::AlterTable *)lex->statement;
658
 
 
659
 
  statement->alter_info.flags.set(ALTER_DROP_INDEX);
660
 
  if (is_foreign_key)
661
 
  {
662
 
    statement->alter_info.flags.set(ALTER_FOREIGN_KEY);
663
 
    statement->alter_info.drop_list.push_back(new AlterDrop(AlterDrop::FOREIGN_KEY, name));
664
 
  }
665
 
  else
666
 
  {
667
 
    statement->alter_info.drop_list.push_back(new AlterDrop(AlterDrop::KEY, name));
668
 
  }
669
 
}
670
 
 
671
650
} // namespace parser
672
651
} // namespace drizzled