~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.h

  • Committer: Brian Aker
  • Date: 2010-02-04 15:58:21 UTC
  • mfrom: (1280.1.9 build)
  • Revision ID: brian@gaz-20100204155821-bi4txluiivy043sb
Rollup of Brian, Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#include <drizzled/select_result_interceptor.h>
34
34
#include <drizzled/xid.h>
35
35
#include "drizzled/query_id.h"
 
36
#include "drizzled/named_savepoint.h"
36
37
 
37
38
#include <netdb.h>
38
39
#include <map>
39
40
#include <string>
40
41
#include <bitset>
 
42
#include <deque>
41
43
 
42
44
#define MIN_HANDSHAKE_SIZE      6
43
45
 
176
178
  size_t range_alloc_block_size;
177
179
  uint32_t query_alloc_block_size;
178
180
  uint32_t query_prealloc_size;
179
 
  uint32_t trans_alloc_block_size;
180
 
  uint32_t trans_prealloc_size;
181
181
  uint64_t group_concat_max_len;
182
182
  uint64_t pseudo_thread_id;
183
183
 
278
278
 
279
279
void mark_transaction_to_rollback(Session *session, bool all);
280
280
 
281
 
struct st_savepoint
282
 
{
283
 
  struct st_savepoint *prev;
284
 
  char *name;
285
 
  size_t length;
286
 
  Ha_trx_info *ha_list;
287
 
};
288
 
 
289
281
extern pthread_mutex_t LOCK_xid_cache;
290
282
extern HASH xid_cache;
291
283
 
538
530
  Ha_trx_info *getEngineInfo(const drizzled::plugin::StorageEngine *engine,
539
531
                             size_t index= 0);
540
532
 
541
 
 
542
 
  /* container for replication data */
543
 
  void *replication_data;
544
 
 
545
533
  struct st_transactions {
546
 
    SAVEPOINT *savepoints;
 
534
    std::deque<drizzled::NamedSavepoint> savepoints;
547
535
    Session_TRANS all;                  // Trans since BEGIN WORK
548
536
    Session_TRANS stmt;                 // Trans for current statement
549
 
    bool on;                            // see ha_enable_transaction()
550
537
    XID_STATE xid_state;
551
538
 
552
539
    /*
554
541
       List contain only transactional tables, that not invalidated in query
555
542
       cache (instead of full list of changed in transaction tables).
556
543
    */
557
 
    CHANGED_TableList* changed_tables;
558
 
    drizzled::memory::Root mem_root; // Transaction-life memory allocation pool
559
544
    void cleanup()
560
545
    {
561
 
      changed_tables= 0;
562
 
      savepoints= 0;
563
 
      free_root(&mem_root,MYF(drizzled::memory::KEEP_PREALLOC));
 
546
      savepoints.clear();
564
547
    }
565
 
    st_transactions()
 
548
    st_transactions() :
 
549
      savepoints(),
 
550
      all(),
 
551
      stmt(),
 
552
      xid_state()
566
553
    {
567
 
      memset(this, 0, sizeof(*this));
568
 
      xid_state.xid.null();
569
 
      drizzled::memory::init_sql_alloc(&mem_root, drizzled::memory::ROOT_MIN_BLOCK_SIZE, 0);
570
554
    }
571
555
  } transaction;
572
556
  Field *dup_field;
1040
1024
  {
1041
1025
    return !lex->only_view_structure();
1042
1026
  }
1043
 
  inline void* trans_alloc(unsigned int size)
1044
 
  {
1045
 
    return alloc_root(&transaction.mem_root,size);
1046
 
  }
1047
1027
 
1048
1028
  LEX_STRING *make_lex_string(LEX_STRING *lex_str,
1049
1029
                              const char* str, uint32_t length,
1050
1030
                              bool allocate_lex_string);
1051
1031
 
1052
 
  void add_changed_table(Table *table);
1053
 
  void add_changed_table(const char *key, long key_length);
1054
 
  CHANGED_TableList * changed_table_dup(const char *key, long key_length);
1055
1032
  int send_explain_fields(select_result *result);
1056
1033
  /**
1057
1034
    Clear the current error, if any.