~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/transaction_services.h

  • Committer: David Shrewsbury
  • Date: 2011-01-13 18:43:55 UTC
  • mto: (2081.1.2 drizzle)
  • mto: This revision was merged to the branch mainline in revision 2082.
  • Revision ID: shrewsbury.dave@gmail.com-20110113184355-wsmu0grg7tkxwdsc
Push ALTER SCHEMA through replication stream as proper GPB message instead of RAW_SQL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
#include "drizzled/atomics.h"
29
29
#include "drizzled/message/transaction.pb.h"
 
30
#include "drizzled/identifier/table.h"
 
31
#include "drizzled/message/schema.h"
30
32
 
31
33
namespace drizzled
32
34
{
291
293
   * @param[in] schema message::Schema message describing new schema
292
294
   */
293
295
  void createSchema(Session *in_session, const message::Schema &schema);
 
296
 
294
297
  /**
295
298
   * Creates a DropSchema Statement GPB message and adds it
296
299
   * to the Session's active Transaction GPB message for pushing
299
302
   * @param[in] in_session Pointer to the Session which issued the statement
300
303
   * @param[in] schema_name message::Schema message describing new schema
301
304
   */
302
 
  void dropSchema(Session *in_session, const std::string &schema_name);
 
305
  void dropSchema(Session *in_session, SchemaIdentifier::const_reference identifier);
 
306
 
 
307
  /**
 
308
   * Creates an AlterSchema Statement GPB message and adds it
 
309
   * to the Session's active Transaction GPB message for pushing
 
310
   * out to the replicator streams.
 
311
   *
 
312
   * @param[in] in_session Pointer to the Session which issued the statement
 
313
   * @param[in] old_schema Original schema definition
 
314
   * @param[in] new_schema New schema definition
 
315
   */
 
316
  void alterSchema(Session *in_session,
 
317
                   const message::schema::shared_ptr &old_schema,
 
318
                   const message::Schema &new_schema);
 
319
 
303
320
  /**
304
321
   * Creates a CreateTable Statement GPB message and adds it
305
322
   * to the Session's active Transaction GPB message for pushing
315
332
   * out to the replicator streams.
316
333
   *
317
334
   * @param[in] in_session Pointer to the Session which issued the statement
318
 
   * @param[in] schema_name The schema of the table being dropped
319
 
   * @param[in] table_name The table name of the table being dropped
 
335
   * @param[in] table Identifier for the table being dropped
320
336
   * @param[in] if_exists Did the user specify an IF EXISTS clause?
321
337
   */
322
338
  void dropTable(Session *in_session,
323
 
                     const std::string &schema_name,
324
 
                     const std::string &table_name,
325
 
                     bool if_exists);
 
339
                 const TableIdentifier &table,
 
340
                 bool if_exists);
326
341
  /**
327
342
   * Creates a TruncateTable Statement GPB message and adds it
328
343
   * to the Session's active Transaction GPB message for pushing
496
511
  int sendEvent(Session *session, const message::Event &event);
497
512
 
498
513
  /**
499
 
   * Helper method which checks the UpdateHeader to determine 
500
 
   * if it needs to be finalized.  
501
 
   *
502
 
   * @param[in] statement Statement message container to check 
503
 
   * @param[in] in_table Pointer to the Table being updated
504
 
   * @param[in] old_record Pointer to the old data in the record
505
 
   * @param[in] new_record Pointer to the new data in the record
 
514
   * Makes a given Transaction message segmented.
 
515
   *
 
516
   * The given Transaction message will have its segment information set
 
517
   * appropriately and a new Transaction message, containing the same
 
518
   * transaction ID as the supplied Transaction, and is created.
 
519
   *
 
520
   * @param in_session Session pointer
 
521
   * @param transaction Pointer to the Transaction message to segment.
 
522
   *
 
523
   * @returns Returns a pointer to a new Transaction message ready for use.
506
524
   */
507
 
  bool useExistingUpdateHeader(message::Statement &statement,
508
 
                               Table *in_table,
509
 
                               const unsigned char *old_record,
510
 
                               const unsigned char *new_record);
 
525
  message::Transaction *segmentTransactionMessage(Session *in_session,
 
526
                                                  message::Transaction *transaction);
511
527
 
512
528
  plugin::XaStorageEngine *xa_storage_engine;
513
529
};