~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.h

  • Committer: Monty Taylor
  • Date: 2009-12-25 02:36:12 UTC
  • mfrom: (1253 build)
  • mto: (1253.2.3 out-of-tree)
  • mto: This revision was merged to the branch mainline in revision 1258.
  • Revision ID: mordred@inaugust.com-20091225023612-7hekryz87dtus3ph
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include "drizzled/plugin.h"
27
27
#include <drizzled/sql_locale.h>
28
28
#include <drizzled/ha_trx_info.h>
29
 
#include <mysys/my_alloc.h>
30
 
#include <mysys/my_tree.h>
31
29
#include <drizzled/cursor.h>
32
30
#include <drizzled/current_session.h>
33
31
#include <drizzled/sql_error.h>
62
60
class CopyField;
63
61
class Table_ident;
64
62
 
 
63
struct st_my_thread_var;
 
64
 
65
65
extern char internal_table_name[2];
66
66
extern char empty_c_string[1];
67
67
extern const char **errmesg;
179
179
  uint32_t trans_alloc_block_size;
180
180
  uint32_t trans_prealloc_size;
181
181
  uint64_t group_concat_max_len;
182
 
  /* TODO: change this to my_thread_id - but have to fix set_var first */
183
182
  uint64_t pseudo_thread_id;
184
183
 
185
184
  drizzled::plugin::StorageEngine *storage_engine;
677
676
  */
678
677
  uint32_t row_count;
679
678
  pthread_t real_id; /**< For debugging */
680
 
  my_thread_id thread_id;
 
679
  uint64_t thread_id;
681
680
  uint32_t tmp_table;
682
681
  uint32_t global_read_lock;
683
682
  uint32_t server_status;
981
980
    enter_cond(); this mutex is then released by exit_cond().
982
981
    Usage must be: lock mutex; enter_cond(); your code; exit_cond().
983
982
  */
984
 
  inline const char* enter_cond(pthread_cond_t *cond, pthread_mutex_t* mutex, const char* msg)
985
 
  {
986
 
    const char* old_msg = get_proc_info();
987
 
    safe_mutex_assert_owner(mutex);
988
 
    mysys_var->current_mutex = mutex;
989
 
    mysys_var->current_cond = cond;
990
 
    this->set_proc_info(msg);
991
 
    return old_msg;
992
 
  }
993
 
  inline void exit_cond(const char* old_msg)
994
 
  {
995
 
    /*
996
 
      Putting the mutex unlock in exit_cond() ensures that
997
 
      mysys_var->current_mutex is always unlocked _before_ mysys_var->mutex is
998
 
      locked (if that would not be the case, you'll get a deadlock if someone
999
 
      does a Session::awake() on you).
1000
 
    */
1001
 
    pthread_mutex_unlock(mysys_var->current_mutex);
1002
 
    pthread_mutex_lock(&mysys_var->mutex);
1003
 
    mysys_var->current_mutex = 0;
1004
 
    mysys_var->current_cond = 0;
1005
 
    this->set_proc_info(old_msg);
1006
 
    pthread_mutex_unlock(&mysys_var->mutex);
1007
 
  }
 
983
  const char* enter_cond(pthread_cond_t *cond, pthread_mutex_t* mutex, const char* msg);
 
984
  void exit_cond(const char* old_msg);
 
985
 
1008
986
  inline time_t query_start() { return start_time; }
1009
987
  inline void set_time()
1010
988
  {
1495
1473
#include <drizzled/select_dump.h>
1496
1474
#include <drizzled/select_insert.h>
1497
1475
#include <drizzled/select_create.h>
1498
 
#include <plugin/myisam/myisam.h>
1499
1476
#include <drizzled/tmp_table_param.h>
1500
1477
#include <drizzled/select_union.h>
1501
1478
#include <drizzled/select_subselect.h>