Drizzled Public API Documentation

session.h
1 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3  *
4  * Copyright (C) 2008 Sun Microsystems, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #pragma once
21 
22 #include <algorithm>
23 #include <bitset>
24 #include <boost/make_shared.hpp>
25 #include <boost/scoped_ptr.hpp>
26 #include <boost/thread/condition_variable.hpp>
27 #include <boost/thread/mutex.hpp>
28 #include <boost/thread/shared_mutex.hpp>
29 #include <boost/thread/thread.hpp>
30 #include <map>
31 #include <netdb.h>
32 #include <string>
33 #include <sys/resource.h>
34 #include <sys/time.h>
35 
36 #include <drizzled/charset.h>
37 #include <drizzled/base.h>
38 #include <drizzled/error.h>
39 #include <drizzled/lock.h>
40 #include <drizzled/pthread_globals.h>
41 #include <drizzled/sql_error.h>
42 #include <drizzled/sql_locale.h>
43 #include <drizzled/visibility.h>
44 #include <drizzled/util/find_ptr.h>
45 #include <drizzled/util/string.h>
46 #include <drizzled/type/time.h>
47 
48 namespace drizzled {
49 
50 extern uint32_t server_id;
51 extern std::string server_uuid;
52 
53 #define TC_HEURISTIC_RECOVER_COMMIT 1
54 #define TC_HEURISTIC_RECOVER_ROLLBACK 2
55 extern uint32_t tc_heuristic_recover;
56 
57 extern DRIZZLED_API struct drizzle_system_variables global_system_variables;
58 
79 class Open_tables_state;
80 
82 {
83 private:
84  class impl_c;
85 
86  boost::scoped_ptr<impl_c> impl_;
87 public:
88  typedef boost::shared_ptr<Session> shared_ptr;
89 
90  static shared_ptr make_shared(plugin::Client *client, boost::shared_ptr<catalog::Instance> instance_arg)
91  {
92  assert(instance_arg);
93  return boost::make_shared<Session>(client, instance_arg);
94  }
95 
96  /*
97  MARK_COLUMNS_NONE: Means mark_used_colums is not set and no indicator to
98  handler of fields used is set
99  MARK_COLUMNS_READ: Means a bit in read set is set to inform handler
100  that the field is to be read. If field list contains
101  duplicates, then session->dup_field is set to point
102  to the last found duplicate.
103  MARK_COLUMNS_WRITE: Means a bit is set in write set to inform handler
104  that it needs to update this field in write_row
105  and update_row.
106  */
107  enum_mark_columns mark_used_columns;
108 
110  void free_items();
111 
117  memory::Root& mem;
120  uint64_t getXaId() const
121  {
122  return xa_id;
123  }
124 
125  void setXaId(uint64_t in_xa_id)
126  {
127  xa_id= in_xa_id;
128  }
129 
130 public:
131  Diagnostics_area& main_da();
132  const LEX& lex() const;
133  LEX& lex();
134  enum_sql_command getSqlCommand() const;
135 
137  typedef boost::shared_ptr<const std::string> QueryString;
138 
139 private:
140  boost::shared_ptr<std::string> query;
141 
142  // Never allow for a modification of this outside of the class. c_str()
143  // requires under some setup non const, you must copy the QueryString in
144  // order to use it.
145 public:
146  void resetQueryString();
147  const boost::shared_ptr<session::State>& state();
148 
149  QueryString getQueryString() const
150  {
151  return query;
152  }
153 
154  const char* getQueryStringCopy(size_t &length)
155  {
156  QueryString tmp_string(getQueryString());
157  if (not tmp_string)
158  {
159  length= 0;
160  return NULL;
161  }
162  length= tmp_string->length();
163  return mem.strdup(*tmp_string);
164  }
165 
166  util::string::ptr schema() const;
167 
174  static const char* const DEFAULT_WHERE;
175 
177 public:
178  void setClient(plugin::Client *client_arg);
179 
180  plugin::Client *getClient() const
181  {
182  return client;
183  }
184 
187  typedef boost::unordered_map<std::string, user_var_entry*, util::insensitive_hash, util::insensitive_equal_to> UserVars;
188 
189 private:
190  typedef std::pair< UserVars::iterator, UserVars::iterator > UserVarsRange;
191  UserVars user_vars;
193 public:
194  const UserVars &getUserVariables() const
195  {
196  return user_vars;
197  }
198 
200  enum_tx_isolation getTxIsolation() const;
201  system_status_var& status_var;
202 
212 
213  identifier::user::ptr user() const
214  {
215  return security_ctx;
216  }
217 
218  void setUser(identifier::user::mptr arg)
219  {
220  security_ctx= arg;
221  }
222 
223  int32_t getScoreboardIndex() const
224  {
225  return scoreboard_index;
226  }
227 
228  void setScoreboardIndex(int32_t in_scoreboard_index)
229  {
230  scoreboard_index= in_scoreboard_index;
231  }
232 
233  bool isOriginatingServerUUIDSet() const
234  {
235  return originating_server_uuid_set;
236  }
237 
238  void setOriginatingServerUUID(std::string in_originating_server_uuid)
239  {
240  originating_server_uuid= in_originating_server_uuid;
241  originating_server_uuid_set= true;
242  }
243 
244  const std::string &getOriginatingServerUUID() const
245  {
246  return originating_server_uuid;
247  }
248 
249  void setOriginatingCommitID(uint64_t in_originating_commit_id)
250  {
251  originating_commit_id= in_originating_commit_id;
252  }
253 
254  uint64_t getOriginatingCommitID() const
255  {
256  return originating_commit_id;
257  }
258 
262  bool isViewable(const identifier::User&) const;
263 
264 private:
270  const char *_where;
271 
272 public:
273  const char *where() const
274  {
275  return _where;
276  }
277 
278  void setWhere(const char *arg)
279  {
280  _where= arg;
281  }
282 
283  /*
284  One thread can hold up to one named user-level lock. This variable
285  points to a lock object if the lock is present. See item_func.cc and
286  chapter 'Miscellaneous functions', for functions GET_LOCK, RELEASE_LOCK.
287  */
288 
289 private:
290  boost::thread::id boost_thread_id;
291  thread_ptr _thread;
292  boost::this_thread::disable_interruption *interrupt;
293 
294  internal::st_my_thread_var *mysys_var;
295 
296 public:
297  thread_ptr &getThread()
298  {
299  return _thread;
300  }
301 
302  void pushInterrupt(boost::this_thread::disable_interruption *interrupt_arg)
303  {
304  interrupt= interrupt_arg;
305  }
306 
307  boost::this_thread::disable_interruption &getThreadInterupt()
308  {
309  assert(interrupt);
310  return *interrupt;
311  }
312 
313  internal::st_my_thread_var *getThreadVar()
314  {
315  return mysys_var;
316  }
317 
322  enum_server_command command;
323 
324  thr_lock_type update_lock_default;
325 
326  /*
327  Both of the following container points in session will be converted to an API.
328  */
329 
330 private:
331  /* container for handler's private per-connection data */
332  std::vector<Ha_data> ha_data;
333  /*
334  Id of current query. Statement can be reused to execute several queries
335  query_id is global in context of the whole MySQL server.
336  ID is automatically generated from an atomic counter.
337  It's used in Cursor code for various purposes: to check which columns
338  from table are necessary for this select, to check if it's necessary to
339  update auto-updatable fields (like auto_increment and timestamp).
340  */
341  query_id_t query_id;
342  query_id_t warn_query_id;
343 
344 public:
345  void **getEngineData(const plugin::MonitoredInTransaction *monitored);
346  ResourceContext& getResourceContext(const plugin::MonitoredInTransaction&, size_t index= 0);
347 
348  session::Transactions& transaction;
349  Open_tables_state& open_tables;
350  session::Times& times;
351 
352  Field *dup_field;
353  sigset_t signals;
354 
355 public:
356  // As of right now we do not allow a concurrent execute to launch itself
357  void setConcurrentExecute(bool arg)
358  {
359  concurrent_execute_allowed= arg;
360  }
361 
362  bool isConcurrentExecuteAllowed() const
363  {
364  return concurrent_execute_allowed;
365  }
366 
367  /*
368  ALL OVER THIS FILE, "insert_id" means "*automatically generated* value for
369  insertion into an auto_increment column".
370  */
400  uint64_t options;
401  int64_t row_count_func;
403  int64_t rowCount() const
404  {
405  return row_count_func;
406  }
407 
408  ha_rows cuted_fields;
414  ha_rows sent_row_count;
415 
420 
430  table_map used_tables;
431 
440  uint32_t warn_count[(uint32_t) DRIZZLE_ERROR::WARN_LEVEL_END];
441  uint32_t total_warn_count;
442 
447  uint32_t row_count;
448 
449  session_id_t thread_id;
450  uint32_t tmp_table;
451  enum global_read_lock_t
452  {
453  NONE= 0,
454  GOT_GLOBAL_READ_LOCK= 1,
455  MADE_GLOBAL_READ_LOCK_BLOCK_COMMIT= 2
456  };
457 private:
458  global_read_lock_t _global_read_lock;
459 
460 public:
461 
462  global_read_lock_t isGlobalReadLock() const
463  {
464  return _global_read_lock;
465  }
466 
467  void setGlobalReadLock(global_read_lock_t arg)
468  {
469  _global_read_lock= arg;
470  }
471 
472  DrizzleLock *lockTables(Table **tables, uint32_t count, uint32_t flags);
473  bool lockGlobalReadLock();
474  bool lock_table_names(TableList *table_list);
475  bool lock_table_names_exclusively(TableList *table_list);
476  bool makeGlobalReadLockBlockCommit();
477  bool abortLockForThread(Table *table);
478  bool wait_if_global_read_lock(bool abort_on_refresh, bool is_not_commit);
479  int lock_table_name(TableList *table_list);
480  void abortLock(Table *table);
481  void removeLock(Table *table);
482  void unlockReadTables(DrizzleLock *sql_lock);
483  void unlockSomeTables(Table **table, uint32_t count);
484  void unlockTables(DrizzleLock *sql_lock);
485  void startWaitingGlobalReadLock();
486  void unlockGlobalReadLock();
487 
488 private:
489  int unlock_external(Table **table, uint32_t count);
490  int lock_external(Table **tables, uint32_t count);
491  bool wait_for_locked_table_names(TableList *table_list);
492  DrizzleLock *get_lock_data(Table **table_ptr, uint32_t count,
493  bool should_lock, Table **write_lock_used);
494 public:
495 
496  uint32_t server_status;
497  uint32_t open_options;
498  uint32_t select_number;
499  /* variables.transaction_isolation is reset to this after each commit */
500  enum_tx_isolation session_tx_isolation;
501  enum_check_fields count_cuted_fields;
502 
503  enum killed_state_t
504  {
505  NOT_KILLED,
506  KILL_BAD_DATA,
507  KILL_CONNECTION,
508  KILL_QUERY,
509  KILLED_NO_VALUE /* means none of the above states apply */
510  };
511 private:
512  killed_state_t volatile _killed;
513 
514 public:
515 
516  void setKilled(killed_state_t arg)
517  {
518  _killed= arg;
519  }
520 
521  killed_state_t getKilled() const
522  {
523  return _killed;
524  }
525 
526  volatile killed_state_t *getKilledPtr() // Do not use this method, it is here for historical convience.
527  {
528  return &_killed;
529  }
530 
531  bool is_admin_connection;
532  bool no_errors;
561  bool cleanup_done;
562 
563 public:
564  bool got_warning;
568 
569  bool doing_tablespace_operation() const
570  {
571  return tablespace_op;
572  }
573 
574  void setDoingTablespaceOperation(bool doing)
575  {
576  tablespace_op= doing;
577  }
578 
579 
581  union
582  {
583  bool bool_value;
584  uint32_t uint32_t_value;
585  int32_t int32_t_value;
586  uint64_t uint64_t_value;
587  } sys_var_tmp;
588 
597 
600 
609  inline void set_proc_info(const char *info)
610  {
611  proc_info= info;
612  }
613  inline const char* get_proc_info() const
614  {
615  return proc_info;
616  }
617 
619  inline void setQueryId(query_id_t in_query_id)
620  {
621  query_id= in_query_id;
622  }
623 
625  query_id_t getQueryId() const
626  {
627  return query_id;
628  }
629 
630 
632  inline void setWarningQueryId(query_id_t in_query_id)
633  {
634  warn_query_id= in_query_id;
635  }
636 
638  inline query_id_t getWarningQueryId() const
639  {
640  return warn_query_id;
641  }
642 
644  inline session_id_t getSessionId() const
645  {
646  return thread_id;
647  }
648 
650  inline uint32_t getServerId() const
651  {
652  /* We return the global server ID. */
653  return server_id;
654  }
655 
656  inline std::string &getServerUUID() const
657  {
658  return server_uuid;
659  }
660 
661  inline void record_first_successful_insert_id_in_cur_stmt(uint64_t id_arg)
662  {
663  if (first_successful_insert_id_in_cur_stmt == 0)
664  first_successful_insert_id_in_cur_stmt= id_arg;
665  }
666  inline uint64_t read_first_successful_insert_id_in_prev_stmt() const
667  {
668  return first_successful_insert_id_in_prev_stmt;
669  }
670 
671  Session(plugin::Client*, boost::shared_ptr<catalog::Instance>);
672  ~Session();
673 
674  void cleanup();
687  void cleanup_after_query();
688  void storeGlobals();
689  void awake(Session::killed_state_t state_to_set);
690 
697  void prepareForQueries();
698 
713  bool executeStatement();
714 
731  void readAndStoreQuery(str_ref);
732 
741  bool endTransaction(enum enum_mysql_completiontype completion);
742  bool endActiveTransaction();
743  bool startTransaction(start_transaction_option_t opt= START_TRANS_NO_OPTIONS);
744  void markTransactionForRollback(bool all);
745 
751  bool authenticate();
752  void run();
753  static bool schedule(const Session::shared_ptr&);
754  static void unlink(session_id_t&);
755  static void unlink(const Session::shared_ptr&);
756 
757  /*
758  For enter_cond() / exit_cond() to work the mutex must be got before
759  enter_cond(); this mutex is then released by exit_cond().
760  Usage must be: lock mutex; enter_cond(); your code; exit_cond().
761  */
762  const char* enter_cond(boost::condition_variable_any &cond, boost::mutex &mutex, const char* msg);
763  void exit_cond(const char* old_msg);
764 
765  uint64_t found_rows() const
766  {
767  return limit_found_rows;
768  }
769 
771  bool inTransaction() const
772  {
773  return server_status & SERVER_STATUS_IN_TRANS;
774  }
775 
776  lex_string_t* make_lex_string(lex_string_t*, str_ref);
777 
778  void send_explain_fields(select_result*);
779 
780  void clear_error(bool full= false);
781  void clearDiagnostics();
782  bool is_error() const;
783 
784  static const charset_info_st *charset() { return default_charset_info; }
785 
794  void end_statement();
795  inline int killed_errno() const
796  {
797  killed_state_t killed_val; /* to cache the volatile 'killed' */
798  return (killed_val= _killed) != KILL_BAD_DATA ? killed_val : 0;
799  }
800  void send_kill_message() const;
801  /* return true if we will abort query if we make a warning now */
802  inline bool abortOnWarning()
803  {
804  return abort_on_warning;
805  }
806 
807  inline void setAbortOnWarning(bool arg)
808  {
809  abort_on_warning= arg;
810  }
811 
812  void setAbort(bool arg);
813  void lockOnSys();
814  void set_status_var_init();
832  void set_schema(const std::string&);
833 
834  /*
835  Copy the current database to the argument. Use the current arena to
836  allocate memory for a deep copy: current database may be freed after
837  a statement is parsed but before it's executed.
838  */
839  str_ref copy_db_to() const;
840 
841 public:
842 
856  void reset_for_next_command();
857 
866  void disconnect(enum error_t errcode= EE_OK);
867 
880  bool checkUser(const std::string &passwd, const std::string &db);
881 
888  {
889  return transaction_message;
890  }
891 
897  {
898  return statement_message;
899  }
900 
906  {
907  return resultset;
908  }
916  {
917  transaction_message= in_message;
918  }
919 
927  {
928  statement_message= in_message;
929  }
930 
938  {
939  resultset= in_message;
940  }
947  {
948  resultset= NULL;
949  }
950 
951  plugin::EventObserverList *getSessionObservers()
952  {
953  return session_event_observers;
954  }
955 
956  void setSessionObservers(plugin::EventObserverList *observers)
957  {
958  session_event_observers= observers;
959  }
960 
961  plugin::EventObserverList* getSchemaObservers(const std::string& schema);
962  plugin::EventObserverList* setSchemaObservers(const std::string& schema, plugin::EventObserverList*);
963 
964 public:
965  void my_ok(ha_rows affected_rows= 0, ha_rows found_rows_arg= 0, uint64_t passed_id= 0, const char *message= NULL);
966  void my_eof();
967  void add_item_to_list(Item *item);
968  void add_value_to_list(Item *value);
969  void add_order_to_list(Item *item, bool asc);
970  void add_group_to_list(Item *item, bool asc);
971 
972  void refresh_status();
973  user_var_entry* getVariable(str_ref name, bool create_if_not_exists);
974  void setVariable(const std::string& name, const std::string& value);
975 
980  void close_thread_tables();
981  void close_old_data_files(bool morph_locks= false, bool send_refresh= false);
982  void close_data_files_and_morph_locks(const identifier::Table&);
983 
990  void close_tables_for_reopen(TableList **tables);
991 
992 
1007  bool openTablesLock(TableList*);
1008  Table *open_temporary_table(const identifier::Table &identifier, bool link_in_list= true);
1009 
1010  int open_tables_from_list(TableList **start, uint32_t *counter, uint32_t flags= 0);
1011 
1012  Table *openTableLock(TableList *table_list, thr_lock_type lock_type);
1013  Table *openTable(TableList *table_list, bool *refresh, uint32_t flags= 0);
1014 
1015  void unlink_open_table(Table *find);
1016  void drop_open_table(Table *table, const identifier::Table &identifier);
1017  void close_cached_table(Table *table);
1018 
1019  /* Create a lock in the cache */
1020  table::Placeholder& table_cache_insert_placeholder(const identifier::Table&);
1021  Table* lock_table_name_if_not_cached(const identifier::Table&);
1022 
1023  session::TableMessages &getMessageCache();
1024 
1025  /* Reopen operations */
1026  bool reopen_tables();
1027  bool close_cached_tables(TableList *tables, bool wait_for_refresh, bool wait_for_placeholders);
1028 
1029  void wait_for_condition(boost::mutex &mutex, boost::condition_variable_any &cond);
1030  int setup_conds(TableList *leaves, COND **conds);
1031  int lock_tables(TableList *tables, uint32_t count, bool *need_reopen);
1032 
1033  template <class T>
1034  T* getProperty(const std::string& name)
1035  {
1036  return static_cast<T*>(getProperty0(name));
1037  }
1038 
1039  template <class T>
1040  T setProperty(const std::string& name, T value)
1041  {
1042  setProperty0(name, value);
1043  return value;
1044  }
1045 
1054  plugin::StorageEngine *getDefaultStorageEngine();
1055  void get_xid(DrizzleXid *xid) const; // Innodb only
1056 
1057  table::Singular& getInstanceTable();
1058  table::Singular& getInstanceTable(std::list<CreateField>&);
1059 
1060  void setUsage(bool arg)
1061  {
1062  use_usage= arg;
1063  }
1064 
1065  const rusage &getUsage()
1066  {
1067  return usage;
1068  }
1069 
1070  const catalog::Instance& catalog() const
1071  {
1072  return *_catalog;
1073  }
1074 
1075  catalog::Instance& catalog()
1076  {
1077  return *_catalog;
1078  }
1079 
1080  bool arg_of_last_insert_id_function; // Tells if LAST_INSERT_ID(#) was called for the current statement
1081 private:
1082  drizzled::util::Storable* getProperty0(const std::string&);
1083  void setProperty0(const std::string&, drizzled::util::Storable*);
1084 
1085  bool resetUsage()
1086  {
1087  return not getrusage(RUSAGE_THREAD, &usage);
1088  }
1089 
1090  boost::shared_ptr<catalog::Instance> _catalog;
1091 
1094  message::Statement *statement_message;
1095  /* Pointer to the current resultset of Select query */
1096  message::Resultset *resultset;
1097  plugin::EventObserverList *session_event_observers;
1098 
1099  uint64_t xa_id;
1100  const char *proc_info;
1101  bool abort_on_warning;
1102  bool concurrent_execute_allowed;
1104  bool use_usage;
1105  rusage usage;
1106  identifier::user::mptr security_ctx;
1107  int32_t scoreboard_index;
1108  bool originating_server_uuid_set;
1109  std::string originating_server_uuid;
1110  uint64_t originating_commit_id;
1111  plugin::Client *client;
1112 };
1113 
1114 #define ESCAPE_CHARS "ntrb0ZN" // keep synchronous with READ_INFO::unescape
1115 
1116 /* Bits in sql_command_flags */
1117 
1118 enum sql_command_flag_bits
1119 {
1120  CF_BIT_CHANGES_DATA,
1121  CF_BIT_HAS_ROW_COUNT,
1122  CF_BIT_STATUS_COMMAND,
1123  CF_BIT_SHOW_TABLE_COMMAND,
1124  CF_BIT_WRITE_LOGS_COMMAND,
1125  CF_BIT_SIZE
1126 };
1127 
1128 static const std::bitset<CF_BIT_SIZE> CF_CHANGES_DATA(1 << CF_BIT_CHANGES_DATA);
1129 static const std::bitset<CF_BIT_SIZE> CF_HAS_ROW_COUNT(1 << CF_BIT_HAS_ROW_COUNT);
1130 static const std::bitset<CF_BIT_SIZE> CF_STATUS_COMMAND(1 << CF_BIT_STATUS_COMMAND);
1131 static const std::bitset<CF_BIT_SIZE> CF_SHOW_TABLE_COMMAND(1 << CF_BIT_SHOW_TABLE_COMMAND);
1132 static const std::bitset<CF_BIT_SIZE> CF_WRITE_LOGS_COMMAND(1 << CF_BIT_WRITE_LOGS_COMMAND);
1133 
1134 namespace display
1135 {
1136  const std::string &type(Session::global_read_lock_t);
1137  size_t max_string_length(Session::global_read_lock_t);
1138 } /* namespace display */
1139 
1140 } /* namespace drizzled */
1141 
bool derived_tables_processing
Definition: session.h:567
uint32_t row_count
Definition: session.h:447
message::Statement * getStatementMessage() const
Definition: session.h:896
plugin::Scheduler * scheduler
Definition: session.h:185
bool substitute_null_with_insert_id
Definition: session.h:560
void set_proc_info(const char *info)
Definition: session.h:609
bool transaction_rollback_request
Definition: session.h:546
ha_rows examined_row_count
Definition: session.h:419
Lex_input_stream * m_lip
Definition: session.h:596
void * session_marker
Definition: session.h:599
message::Transaction * getTransactionMessage() const
Definition: session.h:887
ha_rows cuted_fields
Definition: session.h:408
session_id_t getSessionId() const
Definition: session.h:644
TODO: Rename this file - func.h is stupid.
message::Resultset * getResultsetMessage() const
Definition: session.h:905
void setQueryId(query_id_t in_query_id)
Definition: session.h:619
boost::shared_ptr< const std::string > QueryString
Definition: session.h:137
char * thread_stack
Definition: session.h:211
Item * free_list
Definition: session.h:116
uint64_t first_successful_insert_id_in_prev_stmt
Definition: session.h:379
uint64_t first_successful_insert_id_in_cur_stmt
Definition: session.h:385
#define DRIZZLED_API
Definition: visibility.h:62
void resetResultsetMessage()
Definition: session.h:946
Definition: wakeup.h:27
memory::Root warn_root
Definition: session.h:176
ha_rows sent_row_count
Definition: session.h:414
uint64_t limit_found_rows
Definition: session.h:399
Visibility Control Macros.
message::Transaction * transaction_message
Definition: session.h:1093
void setTransactionMessage(message::Transaction *in_message)
Definition: session.h:915
query_id_t getQueryId() const
Definition: session.h:625
void setWarningQueryId(query_id_t in_query_id)
Definition: session.h:632
table_map used_tables
Definition: session.h:430
bool is_fatal_sub_stmt_error
Definition: session.h:558
static const char *const DEFAULT_WHERE
Definition: session.h:174
THR_LOCK_OWNER * lock_id
Definition: session.h:205
bool is_fatal_error
Definition: session.h:540
query_id_t getWarningQueryId() const
Definition: session.h:638
const char * _where
Definition: session.h:270
bool no_warnings_for_error
Definition: session.h:565
UserVars user_vars
Definition: session.h:191
uint64_t options
Definition: session.h:400
enum_server_command command
Definition: session.h:322
uint32_t getServerId() const
Definition: session.h:650
uint32_t select_number
Definition: session.h:498
int64_t row_count_func
Definition: session.h:401
THR_LOCK_OWNER main_lock_id
Definition: session.h:204
memory::Root * mem_root
Definition: session.h:118
drizzle_system_variables & variables
Definition: session.h:199
bool inTransaction() const
Definition: session.h:771
char * strdup(const char *)
Duplicate a null-terminated string into memory allocated from within the specified Root...
Definition: root.cc:328
void setStatementMessage(message::Statement *in_message)
Definition: session.h:926
void setResultsetMessage(message::Resultset *in_message)
Definition: session.h:937
THR_LOCK_INFO lock_info
Definition: session.h:203