mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Removed mysql_ssl_clear()
Added statistics information for alarms (for bug tracking) Don't store "incomplete" in the xxx.cfg file if we are not using --restart. (Crash-me) Enlarged STACK_BUF_ALLOC becasue of failed crash-me test Aded new script mysql_tableinfo to make a system directory. Docs/manual.texi: Changelog and TODO include/mysql.h: Removed mysql_ssl_clear() (One should use mysql_close() instead) include/thr_alarm.h: Added info for alarms libmysql/libmysql.c: Made mysql_ssl_clear() static libmysql/libmysql.def: cleanup libmysqld/libmysqld.def: cleanup myisam/myisamchk.c: describe -> description myisam/myisampack.c: Fixed copyright. mysys/thr_alarm.c: Added statistics information for alarms (for bug tracking) scripts/Makefile.am: Added mysql_table_info sql-bench/crash-me.sh: Don't store "incomplete" in the xxx.cfg file if we are not using --restart. This was done becasue "incomplete" made it harder to quickly repeat a test that failed. sql-bench/limits/mysql.cfg: Update to 1.58 sql/hostname.cc: Remved compiler warning sql/item_func.cc: cleanup sql/item_func.h: Cleanup sql/mysql_priv.h: Enlarged STACK_BUF_ALLOC becasue of failed crash-me test sql/opt_range.cc: Removed purify warning sql/sql_parse.cc: cleanup sql/sql_test.cc: Added ala
This commit is contained in:
@ -345,13 +345,12 @@ char uc_update_queries[SQLCOM_END];
|
||||
static bool check_mqh(THD *thd, uint check_command)
|
||||
{
|
||||
bool error=0;
|
||||
DBUG_ENTER("check_mqh");
|
||||
time_t check_time = thd->start_time ? thd->start_time : time(NULL);
|
||||
USER_CONN *uc=thd->user_connect;
|
||||
DBUG_ENTER("check_mqh");
|
||||
DBUG_ASSERT(uc != 0);
|
||||
|
||||
bool my_start = thd->start_time != 0;
|
||||
time_t check_time = (my_start) ? thd->start_time : time(NULL);
|
||||
|
||||
/* If more than a hour since last check, reset resource checking */
|
||||
if (check_time - uc->intime >= 3600)
|
||||
{
|
||||
(void) pthread_mutex_lock(&LOCK_user_conn);
|
||||
@ -361,6 +360,7 @@ static bool check_mqh(THD *thd, uint check_command)
|
||||
uc->intime=check_time;
|
||||
(void) pthread_mutex_unlock(&LOCK_user_conn);
|
||||
}
|
||||
/* Check that we have not done too many questions / hour */
|
||||
if (uc->user_resources.questions &&
|
||||
uc->questions++ >= uc->user_resources.questions)
|
||||
{
|
||||
@ -371,14 +371,15 @@ static bool check_mqh(THD *thd, uint check_command)
|
||||
}
|
||||
if (check_command < (uint) SQLCOM_END)
|
||||
{
|
||||
if (uc->user_resources.updates && uc_update_queries[check_command] &&
|
||||
++(uc->updates) > uc->user_resources.updates)
|
||||
{
|
||||
net_printf(&thd->net, ER_USER_LIMIT_REACHED, uc->user, "max_updates",
|
||||
(long) uc->user_resources.updates);
|
||||
error=1;
|
||||
goto end;
|
||||
}
|
||||
/* Check that we have not done too many updates / hour */
|
||||
if (uc->user_resources.updates && uc_update_queries[check_command] &&
|
||||
uc->updates++ >= uc->user_resources.updates)
|
||||
{
|
||||
net_printf(&thd->net, ER_USER_LIMIT_REACHED, uc->user, "max_updates",
|
||||
(long) uc->user_resources.updates);
|
||||
error=1;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
end:
|
||||
DBUG_RETURN(error);
|
||||
|
Reference in New Issue
Block a user