At file:///home/psergey/bzr-new/mysql-5.1-maria-contd2/ ------------------------------------------------------------ revno: 2725 revision-id: psergey@askmonty.org-20090909221538-1k8a5q1qzqdyymyw parent: psergey@askmonty.org-20090909215928-jd9v62cem7e2uukw committer: Sergey Petrunya <psergey@askmonty.org> branch nick: mysql-5.1-maria-contd2 timestamp: Thu 2009-09-10 02:15:38 +0400 message: Apply Yasufumi's patch for MBUG#417751. === modified file 'storage/xtradb/btr/btr0cur.c' --- a/storage/xtradb/btr/btr0cur.c 2009-06-25 01:43:25 +0000 +++ b/storage/xtradb/btr/btr0cur.c 2009-09-09 22:15:38 +0000 @@ -3267,6 +3267,7 @@ } while (rec != supremum) { + rec_t* next_rec; /* count recs */ if (stats_method == SRV_STATS_METHOD_IGNORE_NULLS) { n_recs++; @@ -3280,8 +3281,7 @@ n_not_nulls[j]++; } } - - rec_t* next_rec = page_rec_get_next(rec); + next_rec = page_rec_get_next(rec); if (next_rec == supremum) { break; } === modified file 'storage/xtradb/buf/buf0buddy.c' --- a/storage/xtradb/buf/buf0buddy.c 2009-06-25 01:43:25 +0000 +++ b/storage/xtradb/buf/buf0buddy.c 2009-09-09 22:15:38 +0000 @@ -461,16 +461,15 @@ actually is a properly initialized buf_page_t object. */ if (size >= PAGE_ZIP_MIN_SIZE) { - if (!have_page_hash_mutex) - mutex_exit(&zip_free_mutex); - /* This is a compressed page. */ mutex_t* mutex; if (!have_page_hash_mutex) { + mutex_exit(&zip_free_mutex); mutex_enter(&LRU_list_mutex); rw_lock_x_lock(&page_hash_latch); } + /* The src block may be split into smaller blocks, some of which may be free. Thus, the mach_read_from_4() calls below may attempt to read === modified file 'storage/xtradb/buf/buf0flu.c' --- a/storage/xtradb/buf/buf0flu.c 2009-08-09 07:04:58 +0000 +++ b/storage/xtradb/buf/buf0flu.c 2009-09-09 22:15:38 +0000 @@ -1233,13 +1233,13 @@ + BUF_FLUSH_EXTRA_MARGIN) && (distance < BUF_LRU_FREE_SEARCH_LEN)) { + mutex_t* block_mutex; if (!bpage->in_LRU_list) { /* reatart. but it is very optimistic */ bpage = UT_LIST_GET_LAST(buf_pool->LRU); continue; } - - mutex_t* block_mutex = buf_page_get_mutex(bpage); + block_mutex = buf_page_get_mutex_enter(bpage); retry_lock: mutex_enter(block_mutex); === modified file 'storage/xtradb/fil/fil0fil.c' --- a/storage/xtradb/fil/fil0fil.c 2009-06-25 01:43:25 +0000 +++ b/storage/xtradb/fil/fil0fil.c 2009-09-09 22:15:38 +0000 @@ -3039,6 +3039,13 @@ ulint i; int len; ib_uint64_t current_lsn; + ulint size_low, size_high, size; + ib_int64_t size_bytes; + dict_table_t* table; + dict_index_t* index; + fil_system_t* system; + fil_node_t* node = NULL; + fil_space_t* space; current_lsn = log_get_lsn(); @@ -3060,25 +3067,20 @@ success = os_file_write(filepath, file, page, 0, 0, UNIV_PAGE_SIZE); /* get file size */ - ulint size_low, size_high, size; - ib_int64_t size_bytes; os_file_get_size(file, &size_low, &size_high); size_bytes = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low; /* get cruster index information */ - dict_table_t* table; - dict_index_t* index; table = dict_table_get_low(name); index = dict_table_get_first_index(table); ut_a(index->page==3); - /* read metadata from .exp file */ n_index = 0; - bzero(old_id, sizeof(old_id)); - bzero(new_id, sizeof(new_id)); - bzero(root_page, sizeof(root_page)); + memset(old_id, 0, sizeof(old_id)); + memset(new_id, 0, sizeof(new_id)); + memset(root_page, 0, sizeof(root_page)); info_file_path = fil_make_ibd_name(name, FALSE); len = strlen(info_file_path); @@ -3128,10 +3130,10 @@ mem_heap_t* heap = NULL; ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint* offsets = offsets_; + ib_int64_t offset; + size = (ulint) (size_bytes / UNIV_PAGE_SIZE); /* over write space id of all pages */ - ib_int64_t offset; - rec_offs_init(offsets_); fprintf(stderr, "InnoDB: Progress in %:"); @@ -3284,10 +3286,8 @@ } mem_free(info_file_path); - fil_system_t* system = fil_system; + system = fil_system; mutex_enter(&(system->mutex)); - fil_node_t* node = NULL; - fil_space_t* space; space = fil_space_get_by_id(id); if (space) node = UT_LIST_GET_FIRST(space->chain); === modified file 'storage/xtradb/handler/i_s.cc' --- a/storage/xtradb/handler/i_s.cc 2009-06-25 01:43:25 +0000 +++ b/storage/xtradb/handler/i_s.cc 2009-09-09 22:15:38 +0000 @@ -806,7 +806,7 @@ field_store_string(table->field[0], NULL); p = (char *)index->table_name; } - strcpy(table_name_raw, p); + strcpy(table_name_raw, (const char*)p); filename_to_tablename(table_name_raw, table_name, sizeof(table_name)); field_store_string(table->field[1], table_name); field_store_string(table->field[2], index->name); @@ -2861,7 +2861,7 @@ } else { rec_per_key = n_rows; } - snprintf(buff, 256, (i == index->n_uniq)?"%llu":"%llu, ", + ut_snprintf(buff, 256, (i == index->n_uniq)?"%llu":"%llu, ", rec_per_key); strncat(row_per_keys, buff, 256 - strlen(row_per_keys)); } === modified file 'storage/xtradb/srv/srv0srv.c' --- a/storage/xtradb/srv/srv0srv.c 2009-09-08 16:04:58 +0000 +++ b/storage/xtradb/srv/srv0srv.c 2009-09-09 22:15:38 +0000 @@ -2694,11 +2694,11 @@ /* defence line (max_checkpoint_age * 1/2) */ ib_uint64_t lsn = log_sys->lsn; - mutex_exit(&(log_sys->mutex)); - ib_uint64_t level, bpl; buf_page_t* bpage; + mutex_exit(&(log_sys->mutex)); + mutex_enter(&flush_list_mutex); level = 0; === modified file 'storage/xtradb/srv/srv0start.c' --- a/storage/xtradb/srv/srv0start.c 2009-08-03 20:09:53 +0000 +++ b/storage/xtradb/srv/srv0start.c 2009-09-09 22:15:38 +0000 @@ -1134,7 +1134,12 @@ os_aio_use_native_aio = FALSE; } else { /* On Win 2000 and XP use async i/o */ - os_aio_use_native_aio = TRUE; + //os_aio_use_native_aio = TRUE; + os_aio_use_native_aio = FALSE; + fprintf(stderr, + "InnoDB: Windows native async i/o is disabled as default.\n" + "InnoDB: It is not applicable for the current" + " multi io threads implementation.\n"); } #endif if (srv_file_flush_method_str == NULL) { @@ -1170,6 +1175,12 @@ } else if (0 == ut_strcmp(srv_file_flush_method_str, "async_unbuffered")) { srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED; + os_aio_use_native_aio = TRUE; + srv_n_read_io_threads = srv_n_write_io_threads = 1; + fprintf(stderr, + "InnoDB: 'async_unbuffered' was detected as innodb_flush_method.\n" + "InnoDB: Windows native async i/o is enabled.\n" + "InnoDB: And io threads are restricted.\n"); #endif } else { fprintf(stderr,