~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.h

  • Committer: Andrew Hutchings
  • Date: 2010-11-09 13:38:01 UTC
  • mto: (1919.1.2 trunk)
  • mto: This revision was merged to the branch mainline in revision 1920.
  • Revision ID: andrew@linuxjedi.co.uk-20101109133801-byjzsao76346395x
Add FLUSH GLOBAL STATUS; command
Clears the global status variables for the server

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include "drizzled/transaction_context.h"
37
37
#include "drizzled/util/storable.h"
38
38
#include "drizzled/my_hash.h"
39
 
#include "drizzled/pthread_globals.h"
 
39
 
40
40
#include <netdb.h>
41
 
#include <sys/time.h>
42
 
#include <sys/resource.h>
43
 
 
44
 
#include <algorithm>
 
41
#include <map>
 
42
#include <string>
45
43
#include <bitset>
46
44
#include <deque>
47
 
#include <map>
48
 
#include <string>
49
45
 
 
46
#include "drizzled/internal/getrusage.h"
50
47
#include "drizzled/security_context.h"
51
48
#include "drizzled/open_tables_state.h"
52
49
#include "drizzled/internal_error_handler.h"
54
51
#include "drizzled/plugin/authorization.h"
55
52
 
56
53
#include <boost/unordered_map.hpp>
57
 
 
58
 
#include <boost/thread/thread.hpp>
59
54
#include <boost/thread/mutex.hpp>
60
55
#include <boost/thread/shared_mutex.hpp>
61
56
#include <boost/thread/condition_variable.hpp>
62
 
#include <boost/make_shared.hpp>
63
 
 
64
57
 
65
58
#define MIN_HANDSHAKE_SIZE      6
66
59
 
213
206
  uint64_t preload_buff_size;
214
207
  uint32_t read_buff_size;
215
208
  uint32_t read_rnd_buff_size;
216
 
  bool replicate_query;
217
209
  size_t sortbuff_size;
218
210
  uint32_t thread_handling;
219
211
  uint32_t tx_isolation;
317
309
public:
318
310
  // Plugin storage in Session.
319
311
  typedef boost::unordered_map<std::string, util::Storable *, util::insensitive_hash, util::insensitive_equal_to> PropertyMap;
320
 
  typedef Session* Ptr;
321
 
  typedef boost::shared_ptr<Session> shared_ptr;
322
312
 
323
313
  /*
324
314
    MARK_COLUMNS_NONE:  Means mark_used_colums is not set and no indicator to
403
393
    return lex;
404
394
  }
405
395
  /** query associated with this statement */
406
 
  typedef boost::shared_ptr<const std::string> QueryString;
407
 
private:
408
 
  boost::shared_ptr<std::string> query;
409
 
 
410
 
  // Never allow for a modification of this outside of the class. c_str()
411
 
  // requires under some setup non const, you must copy the QueryString in
412
 
  // order to use it.
413
 
public:
414
 
  QueryString getQueryString() const
415
 
  {
416
 
    return query;
417
 
  }
418
 
 
419
 
  void resetQueryString()
420
 
  {
421
 
    query.reset();
422
 
    _state.reset();
423
 
  }
424
 
 
425
 
  /*
426
 
    We need to copy the lock on the string in order to make sure we have a stable string.
427
 
    Once this is done we can use it to build a const char* which can be handed off for
428
 
    a method to use (Innodb is currently the only engine using this).
429
 
  */
430
 
  const char *getQueryStringCopy(size_t &length)
431
 
  {
432
 
    QueryString tmp_string(getQueryString());
433
 
 
434
 
    assert(tmp_string);
435
 
    if (not tmp_string)
436
 
    {
437
 
      length= 0;
438
 
      return 0;
439
 
    }
440
 
 
441
 
    length= tmp_string->length();
442
 
    char *to_return= strmake(tmp_string->c_str(), tmp_string->length());
443
 
    return to_return;
444
 
  }
445
 
 
446
 
  class State {
447
 
    std::vector <char> _query;
448
 
 
449
 
  public:
450
 
    typedef boost::shared_ptr<State> const_shared_ptr;
451
 
 
452
 
    State(const char *in_packet, size_t in_packet_length)
453
 
    {
454
 
      if (in_packet_length)
455
 
      {
456
 
        size_t minimum= std::min(in_packet_length, static_cast<size_t>(PROCESS_LIST_WIDTH));
457
 
        _query.resize(minimum + 1);
458
 
        memcpy(&_query[0], in_packet, minimum);
459
 
      }
460
 
      else
461
 
      {
462
 
        _query.resize(0);
463
 
      }
464
 
    }
465
 
 
466
 
    const char *query() const
467
 
    {
468
 
      if (_query.size())
469
 
        return &_query[0];
470
 
 
471
 
      return "";
472
 
    }
473
 
 
474
 
    const char *query(size_t &size) const
475
 
    {
476
 
      if (_query.size())
477
 
      {
478
 
        size= _query.size() -1;
479
 
        return &_query[0];
480
 
      }
481
 
 
482
 
      size= 0;
483
 
      return "";
484
 
    }
485
 
  protected:
486
 
    friend class Session;
487
 
    typedef boost::shared_ptr<State> shared_ptr;
488
 
  };
489
 
private:
490
 
  State::shared_ptr  _state; 
491
 
public:
492
 
 
493
 
  State::const_shared_ptr state()
494
 
  {
495
 
    return _state;
496
 
  }
 
396
  std::string query;
497
397
 
498
398
  /**
499
399
    Name of the current (default) database.
507
407
    the Session of that thread); that thread is (and must remain, for now) the
508
408
    only responsible for freeing this member.
509
409
  */
510
 
private:
511
 
  util::string::shared_ptr _schema;
512
 
public:
513
 
 
514
 
  util::string::const_shared_ptr schema() const
515
 
  {
516
 
    if (_schema)
517
 
      return _schema;
518
 
 
519
 
    return util::string::const_shared_ptr(new std::string(""));
520
 
  }
 
410
  std::string db;
521
411
  std::string catalog;
522
412
  /* current cache key */
523
413
  std::string query_cache_key;
531
421
 
532
422
  memory::Root warn_root; /**< Allocation area for warnings and errors */
533
423
  plugin::Client *client; /**< Pointer to client object */
534
 
 
535
 
  void setClient(plugin::Client *client_arg);
536
 
 
537
 
  plugin::Client *getClient()
538
 
  {
539
 
    return client;
540
 
  }
541
 
 
542
424
  plugin::Scheduler *scheduler; /**< Pointer to scheduler object */
543
425
  void *scheduler_arg; /**< Pointer to the optional scheduler argument */
544
 
 
 
426
private:
545
427
  typedef boost::unordered_map< std::string, user_var_entry *, util::insensitive_hash, util::insensitive_equal_to> UserVars;
546
 
private:
547
428
  typedef std::pair< UserVars::iterator, UserVars::iterator > UserVarsRange;
548
429
  UserVars user_vars; /**< Hash of user variables defined during the session's lifetime */
549
430
 
550
431
public:
551
 
 
552
 
  const UserVars &getUserVariables() const
553
 
  {
554
 
    return user_vars;
555
 
  }
556
 
 
557
432
  drizzle_system_variables variables; /**< Mutable local variables local to the session */
558
433
  struct system_status_var status_var; /**< Session-local status counters */
559
434
  THR_LOCK_INFO lock_info; /**< Locking information for this session */
560
435
  THR_LOCK_OWNER main_lock_id; /**< To use for conventional queries */
561
436
  THR_LOCK_OWNER *lock_id; /**< If not main_lock_id, points to the lock_id of a cursor. */
 
437
private:
 
438
  boost::mutex LOCK_delete; /**< Locked before session is deleted */
 
439
public:
 
440
 
 
441
  void lockForDelete()
 
442
  {
 
443
    LOCK_delete.lock();
 
444
  }
 
445
 
 
446
  void unlockForDelete()
 
447
  {
 
448
    LOCK_delete.unlock();
 
449
  }
 
450
 
 
451
  /**
 
452
   * A peek into the query string for the session. This is a best effort
 
453
   * delivery, there is no guarantee whether the content is meaningful.
 
454
   */
 
455
  char process_list_info[PROCESS_LIST_WIDTH+1];
562
456
 
563
457
  /**
564
458
   * A pointer to the stack frame of the scheduler thread
599
493
  /**
600
494
   * Is this session viewable by the current user?
601
495
   */
602
 
  bool isViewable() const;
 
496
  bool isViewable() const
 
497
  {
 
498
    return plugin::Authorization::isAuthorized(current_session->getSecurityContext(),
 
499
                                               this,
 
500
                                               false);
 
501
  }
603
502
 
604
503
  /**
605
504
    Used in error messages to tell user in what part of MySQL we found an
615
514
  */
616
515
  uint32_t dbug_sentry; /**< watch for memory corruption */
617
516
private:
618
 
  boost::thread::id boost_thread_id;
619
 
  boost_thread_shared_ptr _thread;
620
 
  boost::this_thread::disable_interruption *interrupt;
621
 
 
622
517
  internal::st_my_thread_var *mysys_var;
623
518
public:
624
519
 
625
 
  boost_thread_shared_ptr &getThread()
626
 
  {
627
 
    return _thread;
628
 
  }
629
 
 
630
 
  void pushInterrupt(boost::this_thread::disable_interruption *interrupt_arg)
631
 
  {
632
 
    interrupt= interrupt_arg;
633
 
  }
634
 
 
635
 
  boost::this_thread::disable_interruption &getThreadInterupt()
636
 
  {
637
 
    assert(interrupt);
638
 
    return *interrupt;
639
 
  }
640
 
 
641
520
  internal::st_my_thread_var *getThreadVar()
642
521
  {
643
522
    return mysys_var;
644
523
  }
645
524
 
 
525
  void resetThreadVar()
 
526
  {
 
527
    mysys_var= NULL;
 
528
  }
646
529
  /**
647
530
   * Type of current query: COM_STMT_PREPARE, COM_QUERY, etc. Set from
648
531
   * first byte of the packet in executeStatement()
730
613
  Field *dup_field;
731
614
  sigset_t signals;
732
615
 
733
 
  // As of right now we do not allow a concurrent execute to launch itself
734
 
private:
735
 
  bool concurrent_execute_allowed;
736
 
public:
737
 
 
738
 
  void setConcurrentExecute(bool arg)
739
 
  {
740
 
    concurrent_execute_allowed= arg;
741
 
  }
742
 
 
743
 
  bool isConcurrentExecuteAllowed() const
744
 
  {
745
 
    return concurrent_execute_allowed;
746
 
  }
747
 
 
748
616
  /* Tells if LAST_INSERT_ID(#) was called for the current statement */
749
617
  bool arg_of_last_insert_id_function;
750
 
 
751
618
  /*
752
619
    ALL OVER THIS FILE, "insert_id" means "*automatically generated* value for
753
620
    insertion into an auto_increment column".
851
718
  uint32_t row_count;
852
719
  session_id_t thread_id;
853
720
  uint32_t tmp_table;
854
 
  enum global_read_lock_t
855
 
  {
856
 
    NONE= 0,
857
 
    GOT_GLOBAL_READ_LOCK= 1,
858
 
    MADE_GLOBAL_READ_LOCK_BLOCK_COMMIT= 2
859
 
  };
860
 
private:
861
 
  global_read_lock_t _global_read_lock;
862
 
 
863
 
public:
864
 
 
865
 
  global_read_lock_t isGlobalReadLock() const
866
 
  {
867
 
    return _global_read_lock;
868
 
  }
869
 
 
870
 
  void setGlobalReadLock(global_read_lock_t arg)
871
 
  {
872
 
    _global_read_lock= arg;
873
 
  }
874
 
 
875
 
  DrizzleLock *lockTables(Table **tables, uint32_t count, uint32_t flags, bool *need_reopen);
876
 
  bool lockGlobalReadLock();
877
 
  bool lock_table_names(TableList *table_list);
878
 
  bool lock_table_names_exclusively(TableList *table_list);
879
 
  bool makeGlobalReadLockBlockCommit();
880
 
  bool abortLockForThread(Table *table);
881
 
  bool wait_if_global_read_lock(bool abort_on_refresh, bool is_not_commit);
882
 
  int lock_table_name(TableList *table_list);
883
 
  void abortLock(Table *table);
884
 
  void removeLock(Table *table);
885
 
  void unlockReadTables(DrizzleLock *sql_lock);
886
 
  void unlockSomeTables(Table **table, uint32_t count);
887
 
  void unlockTables(DrizzleLock *sql_lock);
888
 
  void startWaitingGlobalReadLock();
889
 
  void unlockGlobalReadLock();
890
 
 
891
 
private:
892
 
  int unlock_external(Table **table, uint32_t count);
893
 
  int lock_external(Table **tables, uint32_t count);
894
 
  bool wait_for_locked_table_names(TableList *table_list);
895
 
  DrizzleLock *get_lock_data(Table **table_ptr, uint32_t count,
896
 
                             bool should_lock, Table **write_lock_used);
897
 
public:
898
 
 
 
721
  uint32_t global_read_lock;
899
722
  uint32_t server_status;
900
723
  uint32_t open_options;
901
724
  uint32_t select_number; /**< number of select (used for EXPLAIN) */
903
726
  enum_tx_isolation session_tx_isolation;
904
727
  enum_check_fields count_cuted_fields;
905
728
 
906
 
  enum killed_state_t
 
729
  enum killed_state
907
730
  {
908
731
    NOT_KILLED,
909
732
    KILL_BAD_DATA,
911
734
    KILL_QUERY,
912
735
    KILLED_NO_VALUE /* means none of the above states apply */
913
736
  };
914
 
private:
915
 
  killed_state_t volatile _killed;
916
 
 
917
 
public:
918
 
 
919
 
  void setKilled(killed_state_t arg)
920
 
  {
921
 
    _killed= arg;
922
 
  }
923
 
 
924
 
  killed_state_t getKilled()
925
 
  {
926
 
    return _killed;
927
 
  }
928
 
 
929
 
  volatile killed_state_t *getKilledPtr() // Do not use this method, it is here for historical convience.
930
 
  {
931
 
    return &_killed;
932
 
  }
933
 
 
934
 
  bool is_admin_connection;
 
737
  killed_state volatile killed;
 
738
 
935
739
  bool some_tables_deleted;
936
740
  bool no_errors;
937
741
  bool password;
1020
824
  }
1021
825
 
1022
826
  /** Returns the current query ID */
1023
 
  query_id_t getQueryId()  const
 
827
  inline query_id_t getQueryId()  const
1024
828
  {
1025
829
    return query_id;
1026
830
  }
1038
842
    return warn_query_id;
1039
843
  }
1040
844
 
 
845
  /** Returns the current query text */
 
846
  inline const std::string &getQueryString()  const
 
847
  {
 
848
    return query;
 
849
  }
 
850
 
 
851
  /** Returns the length of the current query text */
 
852
  inline size_t getQueryLength() const
 
853
  {
 
854
    if (! query.empty())
 
855
      return query.length();
 
856
    else
 
857
      return 0;
 
858
  }
 
859
 
1041
860
  /** Accessor method returning the session's ID. */
1042
861
  inline session_id_t getSessionId()  const
1043
862
  {
1130
949
   */
1131
950
  void cleanup_after_query();
1132
951
  bool storeGlobals();
1133
 
  void awake(Session::killed_state_t state_to_set);
 
952
  void awake(Session::killed_state state_to_set);
1134
953
  /**
1135
954
   * Pulls thread-specific variables into Session state.
1136
955
   *
1213
1032
  /**
1214
1033
   * Schedule a session to be run on the default scheduler.
1215
1034
   */
1216
 
  static bool schedule(Session::shared_ptr&);
1217
 
 
1218
 
  static void unlink(Session::shared_ptr&);
 
1035
  bool schedule();
1219
1036
 
1220
1037
  /*
1221
1038
    For enter_cond() / exit_cond() to work the mutex must be got before
1228
1045
  inline time_t query_start() { return start_time; }
1229
1046
  inline void set_time()
1230
1047
  {
1231
 
    boost::posix_time::ptime mytime(boost::posix_time::microsec_clock::local_time());
1232
 
    boost::posix_time::ptime epoch(boost::gregorian::date(1970,1,1));
1233
 
    start_utime= utime_after_lock= (mytime-epoch).total_microseconds();
1234
 
 
1235
1048
    if (user_time)
1236
1049
    {
1237
1050
      start_time= user_time;
1238
 
      connect_microseconds= start_utime;
 
1051
      connect_microseconds= start_utime= utime_after_lock= my_micro_time();
1239
1052
    }
1240
 
    else 
1241
 
      start_time= (mytime-epoch).total_seconds();
 
1053
    else
 
1054
      start_utime= utime_after_lock= my_micro_time_and_time(&start_time);
1242
1055
  }
1243
1056
  inline void   set_current_time()    { start_time= time(NULL); }
1244
1057
  inline void   set_time(time_t t)
1245
1058
  {
1246
1059
    start_time= user_time= t;
1247
 
    boost::posix_time::ptime mytime(boost::posix_time::microsec_clock::local_time());
1248
 
    boost::posix_time::ptime epoch(boost::gregorian::date(1970,1,1));
1249
 
    uint64_t t_mark= (mytime-epoch).total_microseconds();
1250
 
 
1251
 
    start_utime= utime_after_lock= t_mark;
1252
 
  }
1253
 
  void set_time_after_lock()  { 
1254
 
     boost::posix_time::ptime mytime(boost::posix_time::microsec_clock::local_time());
1255
 
     boost::posix_time::ptime epoch(boost::gregorian::date(1970,1,1));
1256
 
     utime_after_lock= (mytime-epoch).total_microseconds();
1257
 
  }
 
1060
    start_utime= utime_after_lock= my_micro_time();
 
1061
  }
 
1062
  void set_time_after_lock()  { utime_after_lock= my_micro_time(); }
1258
1063
  /**
1259
1064
   * Returns the current micro-timestamp
1260
1065
   */
1261
1066
  inline uint64_t getCurrentTimestamp()  
1262
1067
  { 
1263
 
    boost::posix_time::ptime mytime(boost::posix_time::microsec_clock::local_time());
1264
 
    boost::posix_time::ptime epoch(boost::gregorian::date(1970,1,1));
1265
 
    uint64_t t_mark= (mytime-epoch).total_microseconds();
1266
 
 
1267
 
    return t_mark; 
 
1068
    return my_micro_time(); 
1268
1069
  }
1269
1070
  inline uint64_t found_rows(void)
1270
1071
  {
1290
1091
    @todo: To silence an error, one should use Internal_error_handler
1291
1092
    mechanism. In future this function will be removed.
1292
1093
  */
1293
 
  inline void clear_error(bool full= false)
 
1094
  inline void clear_error()
1294
1095
  {
1295
1096
    if (main_da.is_error())
1296
1097
      main_da.reset_diagnostics_area();
1297
 
 
1298
 
    if (full)
1299
 
    {
1300
 
      drizzle_reset_errors(this, true);
1301
 
    }
1302
 
  }
1303
 
 
1304
 
  void clearDiagnostics()
1305
 
  {
1306
 
    main_da.reset_diagnostics_area();
 
1098
    return;
1307
1099
  }
1308
1100
 
1309
1101
  /**
1347
1139
  void end_statement();
1348
1140
  inline int killed_errno() const
1349
1141
  {
1350
 
    killed_state_t killed_val; /* to cache the volatile 'killed' */
1351
 
    return (killed_val= _killed) != KILL_BAD_DATA ? killed_val : 0;
 
1142
    killed_state killed_val; /* to cache the volatile 'killed' */
 
1143
    return (killed_val= killed) != KILL_BAD_DATA ? killed_val : 0;
1352
1144
  }
1353
1145
  void send_kill_message() const;
1354
1146
  /* return true if we will abort query if we make a warning now */
1377
1169
    database usually involves other actions, like switching other database
1378
1170
    attributes including security context. In the future, this operation
1379
1171
    will be made private and more convenient interface will be provided.
 
1172
 
 
1173
    @return Operation status
 
1174
      @retval false Success
 
1175
      @retval true  Out-of-memory error
1380
1176
  */
1381
 
  void set_db(const std::string &new_db);
 
1177
  bool set_db(const std::string &new_db);
1382
1178
 
1383
1179
  /*
1384
1180
    Copy the current database to the argument. Use the current arena to
1617
1413
   * set to query_id of original query.
1618
1414
   */
1619
1415
  void mark_used_tables_as_free_for_reuse(Table *table);
 
1416
  /**
 
1417
    Mark all temporary tables which were used by the current statement or
 
1418
    substatement as free for reuse, but only if the query_id can be cleared.
 
1419
 
 
1420
    @param session thread context
 
1421
 
 
1422
    @remark For temp tables associated with a open SQL HANDLER the query_id
 
1423
            is not reset until the HANDLER is closed.
 
1424
  */
 
1425
  void mark_temp_tables_as_free_for_reuse();
1620
1426
 
1621
1427
public:
1622
1428
 
1669
1475
  void close_old_data_files(bool morph_locks= false,
1670
1476
                            bool send_refresh= false);
1671
1477
  void close_open_tables();
1672
 
  void close_data_files_and_morph_locks(const TableIdentifier &identifier);
 
1478
  void close_data_files_and_morph_locks(TableIdentifier &identifier);
1673
1479
 
1674
1480
private:
1675
1481
  bool free_cached_table();
1706
1512
  Table *openTable(TableList *table_list, bool *refresh, uint32_t flags= 0);
1707
1513
 
1708
1514
  void unlink_open_table(Table *find);
1709
 
  void drop_open_table(Table *table, const TableIdentifier &identifier);
 
1515
  void drop_open_table(Table *table, TableIdentifier &identifier);
1710
1516
  void close_cached_table(Table *table);
1711
1517
 
1712
1518
  /* Create a lock in the cache */
1713
1519
  table::Placeholder *table_cache_insert_placeholder(const TableIdentifier &identifier);
1714
 
  bool lock_table_name_if_not_cached(const TableIdentifier &identifier, Table **table);
 
1520
  bool lock_table_name_if_not_cached(TableIdentifier &identifier, Table **table);
1715
1521
 
1716
1522
  typedef boost::unordered_map<std::string, message::Table, util::insensitive_hash, util::insensitive_equal_to> TableMessageCache;
1717
 
 
1718
 
  class TableMessages
1719
 
  {
1720
 
    TableMessageCache table_message_cache;
1721
 
 
1722
 
  public:
1723
 
    bool storeTableMessage(const TableIdentifier &identifier, message::Table &table_message);
1724
 
    bool removeTableMessage(const TableIdentifier &identifier);
1725
 
    bool getTableMessage(const TableIdentifier &identifier, message::Table &table_message);
1726
 
    bool doesTableMessageExist(const TableIdentifier &identifier);
1727
 
    bool renameTableMessage(const TableIdentifier &from, const TableIdentifier &to);
1728
 
 
1729
 
  };
 
1523
  TableMessageCache table_message_cache;
 
1524
 
 
1525
  bool storeTableMessage(const TableIdentifier &identifier, message::Table &table_message);
 
1526
  bool removeTableMessage(const TableIdentifier &identifier);
 
1527
  bool getTableMessage(const TableIdentifier &identifier, message::Table &table_message);
 
1528
  bool doesTableMessageExist(const TableIdentifier &identifier);
 
1529
  bool renameTableMessage(const TableIdentifier &from, const TableIdentifier &to);
 
1530
 
 
1531
  /* Work with temporary tables */
 
1532
  Table *find_temporary_table(const TableIdentifier &identifier);
 
1533
 
 
1534
  void doGetTableNames(CachedDirectory &directory,
 
1535
                       const SchemaIdentifier &schema_identifier,
 
1536
                       std::set<std::string>& set_of_names);
 
1537
  void doGetTableNames(const SchemaIdentifier &schema_identifier,
 
1538
                       std::set<std::string>& set_of_names);
 
1539
 
 
1540
  void doGetTableIdentifiers(CachedDirectory &directory,
 
1541
                             const SchemaIdentifier &schema_identifier,
 
1542
                             TableIdentifiers &set_of_identifiers);
 
1543
  void doGetTableIdentifiers(const SchemaIdentifier &schema_identifier,
 
1544
                             TableIdentifiers &set_of_identifiers);
 
1545
 
 
1546
  int doGetTableDefinition(const drizzled::TableIdentifier &identifier,
 
1547
                           message::Table &table_proto);
 
1548
  bool doDoesTableExist(const drizzled::TableIdentifier &identifier);
 
1549
 
 
1550
  void close_temporary_tables();
 
1551
  void close_temporary_table(Table *table);
 
1552
  // The method below just handles the de-allocation of the table. In
 
1553
  // a better memory type world, this would not be needed.
1730
1554
private:
1731
 
  TableMessages _table_message_cache;
1732
 
 
 
1555
  void nukeTable(Table *table);
1733
1556
public:
1734
 
  TableMessages &getMessageCache()
1735
 
  {
1736
 
    return _table_message_cache;
1737
 
  }
 
1557
 
 
1558
  void dumpTemporaryTableNames(const char *id);
 
1559
  int drop_temporary_table(const drizzled::TableIdentifier &identifier);
 
1560
  bool rm_temporary_table(plugin::StorageEngine *base, TableIdentifier &identifier);
 
1561
  bool rm_temporary_table(TableIdentifier &identifier, bool best_effort= false);
 
1562
  Table *open_temporary_table(TableIdentifier &identifier,
 
1563
                              bool link_in_list= true);
1738
1564
 
1739
1565
  /* Reopen operations */
1740
1566
  bool reopen_tables(bool get_locks, bool mark_share_as_old);
1744
1570
  int setup_conds(TableList *leaves, COND **conds);
1745
1571
  int lock_tables(TableList *tables, uint32_t count, bool *need_reopen);
1746
1572
 
 
1573
  Table *create_virtual_tmp_table(List<CreateField> &field_list);
 
1574
  
1747
1575
  drizzled::util::Storable *getProperty(const std::string &arg)
1748
1576
  {
1749
1577
    return life_properties[arg];
1772
1600
    return global_system_variables.storage_engine;
1773
1601
  }
1774
1602
 
 
1603
  static void unlink(Session *session);
 
1604
 
1775
1605
  void get_xid(DRIZZLE_XID *xid); // Innodb only
1776
1606
 
1777
1607
  table::Instance *getInstanceTable();
1887
1717
static const std::bitset<CF_BIT_SIZE> CF_SHOW_TABLE_COMMAND(1 << CF_BIT_SHOW_TABLE_COMMAND);
1888
1718
static const std::bitset<CF_BIT_SIZE> CF_WRITE_LOGS_COMMAND(1 << CF_BIT_WRITE_LOGS_COMMAND);
1889
1719
 
1890
 
namespace display  {
1891
 
const std::string &type(drizzled::Session::global_read_lock_t type);
1892
 
size_t max_string_length(drizzled::Session::global_read_lock_t type);
1893
 
} /* namespace display */
1894
 
 
1895
1720
} /* namespace drizzled */
1896
1721
 
1897
1722
#endif /* DRIZZLED_SESSION_H */