mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge rama.(none):/home/jimw/my/tmp_merge
into rama.(none):/home/jimw/my/mysql-5.1-clean client/mysql.cc: Auto merged client/mysqldump.c: Auto merged configure.in: Auto merged extra/yassl/include/openssl/ssl.h: Auto merged extra/yassl/include/yassl_int.hpp: Auto merged extra/yassl/src/ssl.cpp: Auto merged extra/yassl/src/template_instnt.cpp: Auto merged extra/yassl/src/yassl_imp.cpp: Auto merged extra/yassl/src/yassl_int.cpp: Auto merged include/mysql.h: Auto merged libmysql/libmysql.c: Auto merged libmysqld/embedded_priv.h: Auto merged BitKeeper/deleted/.del-mysql_explain_log.sh~5ddc62808e16bd57: Auto merged libmysqld/lib_sql.cc: Auto merged libmysqld/libmysqld.c: Auto merged mysql-test/r/date_formats.result: Auto merged mysql-test/r/func_str.result: Auto merged mysql-test/r/mysqldump-max.result: Auto merged mysql-test/r/ps.result: Auto merged mysql-test/t/date_formats.test: Auto merged mysql-test/t/ps.test: Auto merged scripts/mysqld_safe.sh: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_lex.cc: Auto merged sql-common/client.c: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_string.h: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged sql/time.cc: Auto merged storage/myisam/mi_create.c: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: Auto merged storage/ndb/src/mgmsrv/ConfigInfo.cpp: Auto merged tests/mysql_client_test.c: Auto merged BitKeeper/deleted/.del-have_case_sensitive_file_system.inc: Delete: mysql-test/include/have_case_sensitive_file_system.inc BitKeeper/deleted/.del-case_sensitive_file_system.require: Delete: mysql-test/r/case_sensitive_file_system.require mysql-test/lib/mtr_cases.pl: Resolve conflict mysql-test/mysql-test-run.pl: Resolve conflict mysql-test/r/mysqldump.result: Resolve conflict mysql-test/t/mysqldump.test: Resolve conflict sql/sql_parse.cc: Resolve conflict
This commit is contained in:
@ -64,8 +64,8 @@ extern "C" int gethostname(char *name, int namelen);
|
||||
static void time_out_user_resource_limits(THD *thd, USER_CONN *uc);
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
static int check_for_max_user_connections(THD *thd, USER_CONN *uc);
|
||||
#endif
|
||||
static void decrease_user_connections(USER_CONN *uc);
|
||||
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||
static bool check_multi_update_lock(THD *thd);
|
||||
static void remove_escape(char *name);
|
||||
static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables);
|
||||
@ -218,6 +218,7 @@ static bool some_non_temp_table_to_be_updated(THD *thd, TABLE_LIST *tables)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
static HASH hash_user_connections;
|
||||
|
||||
static int get_or_create_user_conn(THD *thd, const char *user,
|
||||
@ -269,6 +270,7 @@ end:
|
||||
return return_val;
|
||||
|
||||
}
|
||||
#endif /* !NO_EMBEDDED_ACCESS_CHECKS */
|
||||
|
||||
|
||||
/*
|
||||
@ -317,8 +319,6 @@ int check_user(THD *thd, enum enum_server_command command,
|
||||
{
|
||||
/* Send the error to the client */
|
||||
net_send_error(thd);
|
||||
if (thd->user_connect)
|
||||
decrease_user_connections(thd->user_connect);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
}
|
||||
@ -509,10 +509,12 @@ extern "C" void free_user(struct user_conn *uc)
|
||||
|
||||
void init_max_user_conn(void)
|
||||
{
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
(void) hash_init(&hash_user_connections,system_charset_info,max_connections,
|
||||
0,0,
|
||||
(hash_get_key) get_key_conn, (hash_free_key) free_user,
|
||||
0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -575,7 +577,6 @@ static int check_for_max_user_connections(THD *thd, USER_CONN *uc)
|
||||
(void) pthread_mutex_unlock(&LOCK_user_conn);
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||
|
||||
/*
|
||||
Decrease user connection count
|
||||
@ -609,13 +610,18 @@ static void decrease_user_connections(USER_CONN *uc)
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||
|
||||
|
||||
void free_max_user_conn(void)
|
||||
{
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
hash_free(&hash_user_connections);
|
||||
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Mark all commands that somehow changes a table
|
||||
This is used to check number of updates / hour
|
||||
@ -1770,9 +1776,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
/* we've authenticated new user */
|
||||
if (save_user_connect)
|
||||
decrease_user_connections(save_user_connect);
|
||||
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
|
||||
x_free((gptr) save_db);
|
||||
x_free((gptr) save_security_ctx.user);
|
||||
}
|
||||
|
Reference in New Issue
Block a user