1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

merge with 4.0

This commit is contained in:
monty@mysql.com
2004-03-16 22:41:30 +02:00
195 changed files with 2651 additions and 4109 deletions

View File

@ -34,12 +34,9 @@ Created 10/8/1995 Heikki Tuuri
#include "sync0sync.h"
#include "sync0ipm.h"
#include "thr0loc.h"
#include "com0com.h"
#include "com0shm.h"
#include "que0que.h"
#include "srv0que.h"
#include "log0recv.h"
#include "odbc0odbc.h"
#include "pars0pars.h"
#include "usr0sess.h"
#include "lock0lock.h"
@ -253,9 +250,6 @@ ibool srv_use_adaptive_hash_indexes = TRUE;
ulint srv_n_spin_wait_rounds = 20;
ulint srv_spin_wait_delay = 5;
ibool srv_priority_boost = TRUE;
char srv_endpoint_name[COM_MAX_ADDR_LEN];
ulint srv_n_com_threads = ULINT_MAX;
ulint srv_n_worker_threads = ULINT_MAX;
ibool srv_print_thread_releases = FALSE;
ibool srv_print_lock_waits = FALSE;
@ -263,14 +257,14 @@ ibool srv_print_buf_io = FALSE;
ibool srv_print_log_io = FALSE;
ibool srv_print_latch_waits = FALSE;
ulint srv_n_rows_inserted = 0;
ulint srv_n_rows_updated = 0;
ulint srv_n_rows_deleted = 0;
ulint srv_n_rows_read = 0;
ulint srv_n_rows_inserted_old = 0;
ulint srv_n_rows_updated_old = 0;
ulint srv_n_rows_deleted_old = 0;
ulint srv_n_rows_read_old = 0;
ulint srv_n_rows_inserted = 0;
ulint srv_n_rows_updated = 0;
ulint srv_n_rows_deleted = 0;
ulint srv_n_rows_read = 0;
static ulint srv_n_rows_inserted_old = 0;
static ulint srv_n_rows_updated_old = 0;
static ulint srv_n_rows_deleted_old = 0;
static ulint srv_n_rows_read_old = 0;
/*
Set the following to 0 if you want InnoDB to write messages on
@ -630,7 +624,9 @@ srv_suspend_thread(void)
ulint slot_no;
ulint type;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
slot_no = thr_local_get_slot_no(os_thread_get_curr_id());
@ -681,7 +677,9 @@ srv_release_threads(
ut_ad(type >= SRV_WORKER);
ut_ad(type <= SRV_MASTER);
ut_ad(n > 0);
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
for (i = 0; i < OS_THREAD_MAX_N; i++) {
@ -1185,7 +1183,9 @@ srv_table_reserve_slot_for_mysql(void)
srv_slot_t* slot;
ulint i;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
i = 0;
slot = srv_mysql_table + i;
@ -1215,7 +1215,7 @@ srv_table_reserve_slot_for_mysql(void)
(ulong) difftime(ut_time(), slot->suspend_time));
}
ut_a(0);
ut_error;
}
slot = srv_mysql_table + i;
@ -1250,7 +1250,9 @@ srv_suspend_mysql_thread(
ibool had_dict_lock = FALSE;
ibool was_declared_inside_innodb = FALSE;
#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
trx = thr_get_trx(thr);
@ -1369,7 +1371,9 @@ srv_release_mysql_thread_if_suspended(
srv_slot_t* slot;
ulint i;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
for (i = 0; i < OS_THREAD_MAX_N; i++) {
@ -1465,6 +1469,13 @@ srv_sprintf_innodb_monitor(
buf = buf + strlen(buf);
ut_a(buf < buf_end + 1500);
/* Conceptually, srv_innodb_monitor_mutex has a very high latching
order level in sync0sync.h, while dict_foreign_err_mutex has a very
low level 135. Therefore we can reserve the latter mutex here without
a danger of a deadlock of threads. */
mutex_enter(&dict_foreign_err_mutex);
if (*dict_foreign_err_buf != '\0') {
buf += sprintf(buf,
"------------------------\n"
@ -1476,18 +1487,7 @@ srv_sprintf_innodb_monitor(
}
}
ut_a(buf < buf_end + 1500);
if (*dict_unique_err_buf != '\0') {
buf += sprintf(buf,
"---------------------------------------------------------------\n"
"LATEST UNIQUE KEY ERROR (is masked in REPLACE or INSERT IGNORE)\n"
"---------------------------------------------------------------\n");
if (buf_end - buf > 6000) {
buf+= sprintf(buf, "%.4000s", dict_unique_err_buf);
}
}
mutex_exit(&dict_foreign_err_mutex);
ut_a(buf < buf_end + 1500);