~thomir-deactivatedaccount/drizzle/drizzle-fix-bug653747

« back to all changes in this revision

Viewing changes to drizzled/session.h

  • Committer: Brian Aker
  • Date: 2010-10-10 02:07:52 UTC
  • mfrom: (1827.2.3 staging)
  • Revision ID: brian@tangent.org-20101010020752-ktv73isay5dxtvp3
Merge in switch on table_share_instance inheritance.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
 
59
59
#include <boost/unordered_map.hpp>
60
60
#include <boost/thread/mutex.hpp>
61
 
#include <boost/thread/shared_mutex.hpp>
62
61
#include <boost/thread/condition_variable.hpp>
63
62
 
64
63
#define MIN_HANDSHAKE_SIZE      6
316
315
 * all member variables that are not critical to non-internal operations of the
317
316
 * session object.
318
317
 */
319
 
typedef int64_t session_id_t;
320
 
 
321
318
class Session : public Open_tables_state
322
319
{
323
320
public:
688
685
    create_sort_index(); may differ from examined_row_count.
689
686
  */
690
687
  uint32_t row_count;
691
 
  session_id_t thread_id;
 
688
  uint64_t thread_id;
692
689
  uint32_t tmp_table;
693
690
  uint32_t global_read_lock;
694
691
  uint32_t server_status;
830
827
  }
831
828
 
832
829
  /** Accessor method returning the session's ID. */
833
 
  inline session_id_t getSessionId()  const
 
830
  inline uint64_t getSessionId()  const
834
831
  {
835
832
    return thread_id;
836
833
  }
1011
1008
    enter_cond(); this mutex is then released by exit_cond().
1012
1009
    Usage must be: lock mutex; enter_cond(); your code; exit_cond().
1013
1010
  */
1014
 
  const char* enter_cond(boost::condition_variable_any &cond, boost::mutex &mutex, const char* msg);
 
1011
  const char* enter_cond(boost::condition_variable &cond, boost::mutex &mutex, const char* msg);
1015
1012
  void exit_cond(const char* old_msg);
1016
1013
 
1017
1014
  inline time_t query_start() { return start_time; }
1540
1537
  bool reopen_name_locked_table(TableList* table_list, bool link_in);
1541
1538
  bool close_cached_tables(TableList *tables, bool wait_for_refresh, bool wait_for_placeholders);
1542
1539
 
1543
 
  void wait_for_condition(boost::mutex &mutex, boost::condition_variable_any &cond);
 
1540
  void wait_for_condition(boost::mutex &mutex, boost::condition_variable &cond);
1544
1541
  int setup_conds(TableList *leaves, COND **conds);
1545
1542
  int lock_tables(TableList *tables, uint32_t count, bool *need_reopen);
1546
1543
 
1578
1575
 
1579
1576
  void get_xid(DRIZZLE_XID *xid); // Innodb only
1580
1577
 
1581
 
  table::Instance *getInstanceTable();
 
1578
  TableShareInstance *getTemporaryShare(TableIdentifier::Type type_arg);
1582
1579
 
1583
1580
private:
1584
1581
  bool resetUsage()
1606
1603
  // This lives throughout the life of Session
1607
1604
  bool use_usage;
1608
1605
  PropertyMap life_properties;
1609
 
  std::vector<table::Instance *> temporary_shares;
 
1606
  std::vector<TableShareInstance *> temporary_shares;
1610
1607
  struct rusage usage;
1611
1608
};
1612
1609