~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/replication_services.cc

  • Committer: Jay Pipes
  • Date: 2010-02-26 00:05:00 UTC
  • mto: (1309.2.14 build)
  • mto: This revision was merged to the branch mainline in revision 1319.
  • Revision ID: jpipes@serialcoder-20100226000500-lvzj0toafytqam55
Adds DROP TABLE to the list of non RAW_SQL statements in replication stream

Show diffs side-by-side

added added

removed removed

Lines of Context:
783
783
  cleanupTransaction(transaction, in_session);
784
784
}
785
785
 
 
786
void ReplicationServices::dropTable(Session *in_session,
 
787
                                    const string &schema_name,
 
788
                                    const string &table_name,
 
789
                                    bool if_exists)
 
790
{
 
791
  if (! is_active)
 
792
    return;
 
793
  
 
794
  message::Transaction *transaction= getActiveTransaction(in_session);
 
795
  message::Statement *statement= transaction->add_statement();
 
796
 
 
797
  initStatement(*statement, message::Statement::DROP_TABLE, in_session);
 
798
 
 
799
  /* 
 
800
   * Construct the specialized DropTableStatement message and attach
 
801
   * it to the generic Statement message
 
802
   */
 
803
  message::DropTableStatement *drop_table_statement= statement->mutable_drop_table_statement();
 
804
 
 
805
  drop_table_statement->set_if_exists_clause(if_exists);
 
806
 
 
807
  message::TableMetadata *table_metadata= drop_table_statement->mutable_table_metadata();
 
808
 
 
809
  table_metadata->set_schema_name(schema_name);
 
810
  table_metadata->set_table_name(table_name);
 
811
 
 
812
  finalizeStatement(*statement, in_session);
 
813
 
 
814
  finalizeTransaction(*transaction, in_session);
 
815
  
 
816
  push(*transaction);
 
817
 
 
818
  cleanupTransaction(transaction, in_session);
 
819
}
 
820
 
786
821
void ReplicationServices::truncateTable(Session *in_session, Table *in_table)
787
822
{
788
823
  if (! is_active)