diff options
author | pem@mysql.com <> | 2003-11-19 15:19:46 +0100 |
---|---|---|
committer | pem@mysql.com <> | 2003-11-19 15:19:46 +0100 |
commit | 28a2c6a96b0e6383ab47494dc9f67653d24a01f3 (patch) | |
tree | e3ba11d4938f6675c5c72ee69cc88980a81ad705 /sql/sql_class.h | |
parent | 8e1584d79e792545c6f726eb94655f457968aaf8 (diff) | |
parent | c4871b240da54a5a808ee30ede7c1ec751119763 (diff) | |
download | mariadb-git-28a2c6a96b0e6383ab47494dc9f67653d24a01f3.tar.gz |
Merging 4.1->5.0.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index b19caf057e6..9a7b45c816b 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -26,6 +26,8 @@ class Query_log_event; class Load_log_event; class Slave_log_event; +class sp_rcontext; +class sp_cache; enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE }; enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY }; @@ -447,7 +449,8 @@ public: ulong extra_length; #endif NET net; // client connection descriptor - LEX lex; // parse tree descriptor + LEX main_lex; + LEX *lex; // parse tree descriptor MEM_ROOT mem_root; // 1 command-life memory pool MEM_ROOT con_root; // connection-life memory MEM_ROOT warn_root; // For warnings and errors @@ -605,12 +608,27 @@ public: bool query_start_used,last_insert_id_used,insert_id_used,rand_used; bool system_thread,in_lock_tables,global_read_lock; bool query_error, bootstrap, cleanup_done; - bool volatile killed; + + enum killed_state { NOT_KILLED=0, KILL_CONNECTION=ER_SERVER_SHUTDOWN, KILL_QUERY=ER_QUERY_INTERRUPTED }; + killed_state volatile killed; + inline int killed_errno() const + { + return killed; + } + inline void send_kill_message() const + { + my_error(killed_errno(), MYF(0)); + } + bool prepare_command; bool tmp_table_used; bool charset_is_system_charset, charset_is_collation_connection; bool slow_command; + sp_rcontext *spcont; // SP runtime context + sp_cache *sp_proc_cache; + sp_cache *sp_func_cache; + /* If we do a purge of binary logs, log index info of the threads that are currently reading it needs to be adjusted. To do that @@ -648,7 +666,7 @@ public: } void close_active_vio(); #endif - void awake(bool prepare_to_die); + void awake(THD::killed_state state_to_set); inline const char* enter_cond(pthread_cond_t *cond, pthread_mutex_t* mutex, const char* msg) { @@ -1144,13 +1162,25 @@ public: bool send_eof(); }; +class my_var : public Sql_alloc { +public: + LEX_STRING s; + bool local; + uint offset; + enum_field_types type; + my_var (LEX_STRING& j, bool i, uint o, enum_field_types t) + :s(j), local(i), offset(o), type(t) + {} + ~my_var() {} +}; class select_dumpvar :public select_result { ha_rows row_count; public: - List<LEX_STRING> var_list; + List<my_var> var_list; List<Item_func_set_user_var> vars; - select_dumpvar(void) { var_list.empty(); vars.empty(); row_count=0;} + List<Item_splocal> local_vars; + select_dumpvar(void) { var_list.empty(); local_vars.empty(); vars.empty(); row_count=0;} ~select_dumpvar() {} int prepare(List<Item> &list, SELECT_LEX_UNIT *u); bool send_fields(List<Item> &list, uint flag) {return 0;} |