~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

Viewing changes to sql/sql_connect.h

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2013-12-22 10:27:05 UTC
  • Revision ID: package-import@ubuntu.com-20131222102705-mndw7s12mz0szrcn
Tags: upstream-5.5.32
Import upstream version 5.5.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
#include "structs.h"
 
22
#include <hash.h>
 
23
 
 
24
class THD;
 
25
typedef struct st_lex_user LEX_USER;
 
26
typedef struct user_conn USER_CONN;
 
27
 
 
28
void init_max_user_conn(void);
 
29
void init_global_user_stats(void);
 
30
void init_global_table_stats(void);
 
31
void init_global_index_stats(void);
 
32
void init_global_client_stats(void);
 
33
void free_max_user_conn(void);
 
34
void free_global_user_stats(void);
 
35
void free_global_table_stats(void);
 
36
void free_global_index_stats(void);
 
37
void free_global_client_stats(void);
 
38
 
 
39
pthread_handler_t handle_one_connection(void *arg);
 
40
void do_handle_one_connection(THD *thd_arg);
 
41
bool init_new_connection_handler_thread();
 
42
void reset_mqh(LEX_USER *lu, bool get_them);
 
43
bool check_mqh(THD *thd, uint check_command);
 
44
void time_out_user_resource_limits(THD *thd, USER_CONN *uc);
 
45
#ifndef NO_EMBEDDED_ACCESS_CHECKS
 
46
void decrease_user_connections(USER_CONN *uc);
 
47
#else
 
48
#define decrease_user_connections(X) do { } while(0)       /* nothing */
 
49
#endif
 
50
bool thd_init_client_charset(THD *thd, uint cs_number);
 
51
bool setup_connection_thread_globals(THD *thd);
 
52
bool thd_prepare_connection(THD *thd);
 
53
bool thd_is_connection_alive(THD *thd);
 
54
 
 
55
bool login_connection(THD *thd);
 
56
void prepare_new_connection_state(THD* thd);
 
57
void end_connection(THD *thd);
 
58
void update_global_user_stats(THD* thd, bool create_user, time_t now);
 
59
int get_or_create_user_conn(THD *thd, const char *user,
 
60
                            const char *host, const USER_RESOURCES *mqh);
 
61
int check_for_max_user_connections(THD *thd, USER_CONN *uc);
 
62
 
 
63
extern HASH global_user_stats;
 
64
extern HASH global_client_stats;
 
65
extern HASH global_table_stats;
 
66
extern HASH global_index_stats;
 
67
 
 
68
extern mysql_mutex_t LOCK_global_user_client_stats;
 
69
extern mysql_mutex_t LOCK_global_table_stats;
 
70
extern mysql_mutex_t LOCK_global_index_stats;
 
71
extern mysql_mutex_t LOCK_stats;
 
72
 
 
73
#endif /* SQL_CONNECT_INCLUDED */