~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.h

  • Committer: Brian Aker
  • Date: 2010-08-09 18:04:12 UTC
  • mfrom: (1689.3.7 staging)
  • Revision ID: brian@gaz-20100809180412-olurwh51ojllev6p
Merge in heap conversion, and case insensitive patch, and remove need for
M_HASH in session.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
#include <drizzled/plugin/authorization.h>
55
55
 
56
56
#include <boost/unordered_map.hpp>
 
57
#include <boost/thread/mutex.hpp>
57
58
 
58
59
#define MIN_HANDSHAKE_SIZE      6
59
60
 
381
382
  plugin::Client *client; /**< Pointer to client object */
382
383
  plugin::Scheduler *scheduler; /**< Pointer to scheduler object */
383
384
  void *scheduler_arg; /**< Pointer to the optional scheduler argument */
384
 
  HASH user_vars; /**< Hash of user variables defined during the session's lifetime */
 
385
private:
 
386
  typedef boost::unordered_map< std::string, user_var_entry *, util::insensitive_hash, util::insensitive_equal_to> UserVars;
 
387
  typedef std::pair< UserVars::iterator, UserVars::iterator > UserVarsRange;
 
388
  UserVars user_vars; /**< Hash of user variables defined during the session's lifetime */
 
389
 
 
390
public:
385
391
  struct system_variables variables; /**< Mutable local variables local to the session */
386
392
  struct system_status_var status_var; /**< Session-local status counters */
387
393
  THR_LOCK_INFO lock_info; /**< Locking information for this session */
388
394
  THR_LOCK_OWNER main_lock_id; /**< To use for conventional queries */
389
395
  THR_LOCK_OWNER *lock_id; /**< If not main_lock_id, points to the lock_id of a cursor. */
390
 
  pthread_mutex_t LOCK_delete; /**< Locked before session is deleted */
 
396
private:
 
397
  boost::mutex LOCK_delete; /**< Locked before session is deleted */
 
398
public:
 
399
 
 
400
  void lockForDelete()
 
401
  {
 
402
    LOCK_delete.lock();
 
403
  }
 
404
 
 
405
  void unlockForDelete()
 
406
  {
 
407
    LOCK_delete.unlock();
 
408
  }
391
409
 
392
410
  /**
393
411
   * A peek into the query string for the session. This is a best effort
1411
1429
  Table *table_cache_insert_placeholder(const char *db_name, const char *table_name);
1412
1430
  bool lock_table_name_if_not_cached(TableIdentifier &identifier, Table **table);
1413
1431
 
1414
 
  typedef boost::unordered_map<std::string, message::Table> TableMessageCache;
 
1432
  typedef boost::unordered_map<std::string, message::Table, util::insensitive_hash, util::insensitive_equal_to> TableMessageCache;
1415
1433
  TableMessageCache table_message_cache;
1416
1434
 
1417
1435
  bool storeTableMessage(const TableIdentifier &identifier, message::Table &table_message);