MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sql_connect.h
1 /* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation; version 2 of the License.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software
14  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15 
16 #ifndef SQL_CONNECT_INCLUDED
17 #define SQL_CONNECT_INCLUDED
18 
19 #include "my_sys.h" /* pthread_handler_t */
20 #include "mysql_com.h" /* enum_server_command */
21 
22 class THD;
23 typedef struct st_lex_user LEX_USER;
24 typedef struct user_conn USER_CONN;
25 
26 void init_max_user_conn(void);
27 void free_max_user_conn(void);
28 
29 pthread_handler_t handle_one_connection(void *arg);
30 void do_handle_one_connection(THD *thd_arg);
31 bool init_new_connection_handler_thread();
32 void reset_mqh(LEX_USER *lu, bool get_them);
33 bool check_mqh(THD *thd, uint check_command);
34 void time_out_user_resource_limits(THD *thd, USER_CONN *uc);
35 void decrease_user_connections(USER_CONN *uc);
36 void release_user_connection(THD *thd);
37 bool thd_init_client_charset(THD *thd, uint cs_number);
38 bool setup_connection_thread_globals(THD *thd);
39 bool thd_prepare_connection(THD *thd);
40 bool thd_is_connection_alive(THD *thd);
41 
42 int check_user(THD *thd, enum enum_server_command command,
43  const char *passwd, uint passwd_len, const char *db,
44  bool check_count);
45 
46 bool login_connection(THD *thd);
47 void prepare_new_connection_state(THD* thd);
48 void end_connection(THD *thd);
49 int get_or_create_user_conn(THD *thd, const char *user,
50  const char *host, const USER_RESOURCES *mqh);
51 int check_for_max_user_connections(THD *thd, const USER_CONN *uc);
52 
53 #endif /* SQL_CONNECT_INCLUDED */