~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/transaction_services.h

doStartTableScan() result not checked.

Add __attribute__((warn_unused_result)) to Cursor::startTableScan()
and by extension init_read_records

then go and fix the places where we weren't checking for errors.

This patch helped by Monty Widenius' patch to MariaDB. Greatly increased
confidence that we either handle the errors correctly or are at least
on par with bugs :)

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"
32
30
 
33
31
namespace drizzled
34
32
{
293
291
   * @param[in] schema message::Schema message describing new schema
294
292
   */
295
293
  void createSchema(Session *in_session, const message::Schema &schema);
296
 
 
297
294
  /**
298
295
   * Creates a DropSchema Statement GPB message and adds it
299
296
   * to the Session's active Transaction GPB message for pushing
302
299
   * @param[in] in_session Pointer to the Session which issued the statement
303
300
   * @param[in] schema_name message::Schema message describing new schema
304
301
   */
305
 
  void dropSchema(Session *in_session, identifier::Schema::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
 
 
 
302
  void dropSchema(Session *in_session, const std::string &schema_name);
320
303
  /**
321
304
   * Creates a CreateTable Statement GPB message and adds it
322
305
   * to the Session's active Transaction GPB message for pushing
332
315
   * out to the replicator streams.
333
316
   *
334
317
   * @param[in] in_session Pointer to the Session which issued the statement
335
 
   * @param[in] table Identifier for the table being dropped
336
 
   * @param[in] if_exists Did the user specify an IF EXISTS clause?
 
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
337
320
   */
338
321
  void dropTable(Session *in_session,
339
 
                 const identifier::Table &table,
340
 
                 bool if_exists);
 
322
                     const std::string &schema_name,
 
323
                     const std::string &table_name);
341
324
  /**
342
325
   * Creates a TruncateTable Statement GPB message and adds it
343
326
   * to the Session's active Transaction GPB message for pushing
511
494
  int sendEvent(Session *session, const message::Event &event);
512
495
 
513
496
  /**
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.
 
497
   * Helper method which checks the UpdateHeader to determine 
 
498
   * if it needs to be finalized.  
 
499
   *
 
500
   * @param[in] statement Statement message container to check 
 
501
   * @param[in] in_table Pointer to the Table being updated
 
502
   * @param[in] old_record Pointer to the old data in the record
 
503
   * @param[in] new_record Pointer to the new data in the record
524
504
   */
525
 
  message::Transaction *segmentTransactionMessage(Session *in_session,
526
 
                                                  message::Transaction *transaction);
 
505
  bool useExistingUpdateHeader(message::Statement &statement,
 
506
                               Table *in_table,
 
507
                               const unsigned char *old_record,
 
508
                               const unsigned char *new_record);
527
509
 
528
510
  plugin::XaStorageEngine *xa_storage_engine;
529
511
};