mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
Merge with 4.0
innobase/dict/dict0boot.c: Auto merged innobase/dict/dict0load.c: Auto merged innobase/dict/dict0mem.c: Auto merged innobase/fut/fut0lst.c: Auto merged innobase/include/buf0lru.h: Auto merged innobase/include/dict0mem.h: Auto merged innobase/include/fsp0fsp.h: Auto merged innobase/include/ha0ha.h: Auto merged innobase/include/ibuf0ibuf.h: Auto merged innobase/include/lock0lock.h: Auto merged innobase/include/log0log.h: Auto merged innobase/include/mem0pool.h: Auto merged innobase/include/mtr0mtr.h: Auto merged innobase/include/os0file.h: Auto merged innobase/include/rem0rec.h: Auto merged innobase/include/rem0rec.ic: Auto merged innobase/include/srv0srv.h: Auto merged innobase/include/sync0sync.h: Auto merged innobase/include/trx0sys.h: Auto merged innobase/include/ut0byte.h: Auto merged innobase/include/ut0ut.h: Auto merged innobase/mem/mem0pool.c: Auto merged innobase/mtr/mtr0mtr.c: Auto merged innobase/os/os0proc.c: Auto merged innobase/pars/lexyy.c: Auto merged innobase/pars/pars0opt.c: Auto merged innobase/row/row0ins.c: Auto merged innobase/row/row0purge.c: Auto merged innobase/row/row0uins.c: Auto merged innobase/row/row0umod.c: Auto merged innobase/row/row0undo.c: Auto merged innobase/row/row0upd.c: Auto merged innobase/trx/trx0purge.c: Auto merged innobase/trx/trx0roll.c: Auto merged innobase/trx/trx0sys.c: Auto merged innobase/trx/trx0undo.c: Auto merged innobase/ut/ut0byte.c: Auto merged pstack/bucomm.h: Auto merged pstack/budbg.h: Auto merged sql/item_sum.h: Auto merged sql/slave.cc: Auto merged sql/sql_db.cc: Auto merged support-files/mysql.spec.sh: Auto merged tests/insert_test.c: Auto merged mysql-test/t/func_group.test: Merge with 4.0 Put 4.1 tests lasts sql/ha_innodb.cc: Merge with 4.0 Added checking of results from my_malloc() BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
This commit is contained in:
commit
1065f2bbd6
125 changed files with 4583 additions and 4780 deletions
|
|
@ -63,13 +63,13 @@ dulint srv_shutdown_lsn;
|
|||
|
||||
ibool srv_start_raw_disk_in_use = FALSE;
|
||||
|
||||
ibool srv_start_has_been_called = FALSE;
|
||||
static ibool srv_start_has_been_called = FALSE;
|
||||
|
||||
ulint srv_sizeof_trx_t_in_ha_innodb_cc;
|
||||
|
||||
ibool srv_startup_is_before_trx_rollback_phase = FALSE;
|
||||
ibool srv_is_being_started = FALSE;
|
||||
ibool srv_was_started = FALSE;
|
||||
static ibool srv_was_started = FALSE;
|
||||
|
||||
/* At a shutdown the value first climbs to SRV_SHUTDOWN_CLEANUP
|
||||
and then to SRV_SHUTDOWN_LAST_PHASE */
|
||||
|
|
@ -77,19 +77,20 @@ ulint srv_shutdown_state = 0;
|
|||
|
||||
ibool measure_cont = FALSE;
|
||||
|
||||
os_file_t files[1000];
|
||||
static os_file_t files[1000];
|
||||
|
||||
mutex_t ios_mutex;
|
||||
ulint ios;
|
||||
static mutex_t ios_mutex;
|
||||
static ulint ios;
|
||||
|
||||
ulint n[SRV_MAX_N_IO_THREADS + 5];
|
||||
os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 5];
|
||||
static ulint n[SRV_MAX_N_IO_THREADS + 5];
|
||||
static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 5];
|
||||
|
||||
/* We use this mutex to test the return value of pthread_mutex_trylock
|
||||
on successful locking. HP-UX does NOT return 0, though Linux et al do. */
|
||||
os_fast_mutex_t srv_os_test_mutex;
|
||||
static os_fast_mutex_t srv_os_test_mutex;
|
||||
|
||||
ibool srv_os_test_mutex_is_locked = FALSE;
|
||||
/* Name of srv_monitor_file */
|
||||
static char* srv_monitor_file_name;
|
||||
|
||||
#define SRV_N_PENDING_IOS_PER_THREAD OS_AIO_N_PENDING_IOS_PER_THREAD
|
||||
#define SRV_MAX_N_PENDING_SYNC_IOS 100
|
||||
|
|
@ -161,17 +162,13 @@ srv_parse_data_file_paths_and_sizes(
|
|||
str++;
|
||||
}
|
||||
|
||||
if (strlen(str) >= ut_strlen(":autoextend")
|
||||
&& 0 == ut_memcmp(str, (char*)":autoextend",
|
||||
ut_strlen(":autoextend"))) {
|
||||
if (0 == memcmp(str, ":autoextend", (sizeof ":autoextend") - 1)) {
|
||||
|
||||
str += ut_strlen(":autoextend");
|
||||
str += (sizeof ":autoextend") - 1;
|
||||
|
||||
if (strlen(str) >= ut_strlen(":max:")
|
||||
&& 0 == ut_memcmp(str, (char*)":max:",
|
||||
ut_strlen(":max:"))) {
|
||||
if (0 == memcmp(str, ":max:", (sizeof ":max:") - 1)) {
|
||||
|
||||
str += ut_strlen(":max:");
|
||||
str += (sizeof ":max:") - 1;
|
||||
|
||||
size = strtoul(str, &endp, 10);
|
||||
|
||||
|
|
@ -200,10 +197,7 @@ srv_parse_data_file_paths_and_sizes(
|
|||
str += 3;
|
||||
}
|
||||
|
||||
if (strlen(str) >= 3
|
||||
&& *str == 'r'
|
||||
&& *(str + 1) == 'a'
|
||||
&& *(str + 2) == 'w') {
|
||||
if (*str == 'r' && *(str + 1) == 'a' && *(str + 2) == 'w') {
|
||||
str += 3;
|
||||
}
|
||||
|
||||
|
|
@ -269,19 +263,15 @@ srv_parse_data_file_paths_and_sizes(
|
|||
(*data_file_names)[i] = path;
|
||||
(*data_file_sizes)[i] = size;
|
||||
|
||||
if (strlen(str) >= ut_strlen(":autoextend")
|
||||
&& 0 == ut_memcmp(str, (char*)":autoextend",
|
||||
ut_strlen(":autoextend"))) {
|
||||
if (0 == memcmp(str, ":autoextend", (sizeof ":autoextend") - 1)) {
|
||||
|
||||
*is_auto_extending = TRUE;
|
||||
|
||||
str += ut_strlen(":autoextend");
|
||||
str += (sizeof ":autoextend") - 1;
|
||||
|
||||
if (strlen(str) >= ut_strlen(":max:")
|
||||
&& 0 == ut_memcmp(str, (char*)":max:",
|
||||
ut_strlen(":max:"))) {
|
||||
if (0 == memcmp(str, ":max:", (sizeof ":max:") - 1)) {
|
||||
|
||||
str += ut_strlen(":max:");
|
||||
str += (sizeof ":max:") - 1;
|
||||
|
||||
size = strtoul(str, &endp, 10);
|
||||
|
||||
|
|
@ -315,10 +305,7 @@ srv_parse_data_file_paths_and_sizes(
|
|||
(*data_file_is_raw_partition)[i] = SRV_NEW_RAW;
|
||||
}
|
||||
|
||||
if (strlen(str) >= 3
|
||||
&& *str == 'r'
|
||||
&& *(str + 1) == 'a'
|
||||
&& *(str + 2) == 'w') {
|
||||
if (*str == 'r' && *(str + 1) == 'a' && *(str + 2) == 'w') {
|
||||
str += 3;
|
||||
|
||||
if ((*data_file_is_raw_partition)[i] == 0) {
|
||||
|
|
@ -420,8 +407,8 @@ io_handler_thread(
|
|||
segment = *((ulint*)arg);
|
||||
|
||||
#ifdef UNIV_DEBUG_THREAD_CREATION
|
||||
printf("Io handler thread %lu starts, id %lu\n", segment,
|
||||
os_thread_pf(os_thread_get_curr_id()));
|
||||
fprintf(stderr, "Io handler thread %lu starts, id %lu\n", segment,
|
||||
os_thread_pf(os_thread_get_curr_id()));
|
||||
#endif
|
||||
for (i = 0;; i++) {
|
||||
fil_aio_wait(segment);
|
||||
|
|
@ -461,12 +448,10 @@ srv_normalize_path_for_win(
|
|||
character string */
|
||||
{
|
||||
#ifdef __WIN__
|
||||
ulint i;
|
||||
for (; *str; str++) {
|
||||
|
||||
for (i = 0; i < ut_strlen(str); i++) {
|
||||
|
||||
if (str[i] == '/') {
|
||||
str[i] = '\\';
|
||||
if (*str == '/') {
|
||||
*str = '\\';
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -535,8 +520,6 @@ ulint
|
|||
open_or_create_log_file(
|
||||
/*====================*/
|
||||
/* out: DB_SUCCESS or error code */
|
||||
ibool create_new_db, /* in: TRUE if we should create a
|
||||
new database */
|
||||
ibool* log_file_created, /* out: TRUE if new log file
|
||||
created */
|
||||
ibool log_file_has_been_opened,/* in: TRUE if a log file has been
|
||||
|
|
@ -550,14 +533,14 @@ open_or_create_log_file(
|
|||
ulint size_high;
|
||||
char name[10000];
|
||||
|
||||
UT_NOT_USED(create_new_db);
|
||||
|
||||
*log_file_created = FALSE;
|
||||
|
||||
srv_normalize_path_for_win(srv_log_group_home_dirs[k]);
|
||||
srv_log_group_home_dirs[k] = srv_add_path_separator_if_needed(
|
||||
srv_log_group_home_dirs[k]);
|
||||
|
||||
ut_a(strlen(srv_log_group_home_dirs[k]) <
|
||||
(sizeof name) - 10 - sizeof "ib_logfile");
|
||||
sprintf(name, "%s%s%lu", srv_log_group_home_dirs[k], "ib_logfile", (ulong) i);
|
||||
|
||||
files[i] = os_file_create(name, OS_FILE_CREATE, OS_FILE_NORMAL,
|
||||
|
|
@ -709,6 +692,8 @@ open_or_create_data_files(
|
|||
for (i = 0; i < srv_n_data_files; i++) {
|
||||
srv_normalize_path_for_win(srv_data_file_names[i]);
|
||||
|
||||
ut_a(strlen(srv_data_home) + strlen(srv_data_file_names[i])
|
||||
< (sizeof name) - 1);
|
||||
sprintf(name, "%s%s", srv_data_home, srv_data_file_names[i]);
|
||||
|
||||
if (srv_data_file_is_raw_partition[i] == 0) {
|
||||
|
|
@ -1122,6 +1107,19 @@ NetWare. */
|
|||
return((int) err);
|
||||
}
|
||||
|
||||
mutex_create(&srv_monitor_file_mutex);
|
||||
srv_monitor_file_name = mem_alloc(
|
||||
strlen(fil_path_to_mysql_datadir) +
|
||||
20 + sizeof "/innodb_status.");
|
||||
sprintf(srv_monitor_file_name, "%s/innodb.status.%lu",
|
||||
fil_path_to_mysql_datadir, os_proc_get_number());
|
||||
srv_monitor_file = fopen(srv_monitor_file_name, "w+");
|
||||
if (!srv_monitor_file) {
|
||||
fprintf(stderr, "InnoDB: unable to create %s: %s\n",
|
||||
srv_monitor_file_name, strerror(errno));
|
||||
return(DB_ERROR);
|
||||
}
|
||||
|
||||
/* Restrict the maximum number of file i/o threads */
|
||||
if (srv_n_file_io_threads > SRV_MAX_N_IO_THREADS) {
|
||||
|
||||
|
|
@ -1457,7 +1455,9 @@ NetWare. */
|
|||
|
||||
os_thread_create(&srv_master_thread, NULL, thread_ids + 1 +
|
||||
SRV_MAX_N_IO_THREADS);
|
||||
#ifdef UNIV_DEBUG
|
||||
/* buf_debug_prints = TRUE; */
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
sum_of_data_file_sizes = 0;
|
||||
|
||||
|
|
@ -1663,6 +1663,15 @@ innobase_shutdown_for_mysql(void)
|
|||
(ulong) os_thread_count);
|
||||
}
|
||||
|
||||
if (srv_monitor_file) {
|
||||
fclose(srv_monitor_file);
|
||||
srv_monitor_file = 0;
|
||||
unlink(srv_monitor_file_name);
|
||||
mem_free(srv_monitor_file_name);
|
||||
}
|
||||
|
||||
mutex_free(&srv_monitor_file_mutex);
|
||||
|
||||
/* 3. Free all InnoDB's own mutexes and the os_fast_mutexes inside
|
||||
them */
|
||||
|
||||
|
|
@ -1689,6 +1698,13 @@ innobase_shutdown_for_mysql(void)
|
|||
(ulong) os_mutex_count, (ulong) os_fast_mutex_count);
|
||||
}
|
||||
|
||||
if (dict_foreign_err_file) {
|
||||
fclose(dict_foreign_err_file);
|
||||
}
|
||||
if (lock_latest_err_file) {
|
||||
fclose(lock_latest_err_file);
|
||||
}
|
||||
|
||||
if (srv_print_verbose_log) {
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue