Commit 1d812468 authored by unknown's avatar unknown

Updated with changes from Percona Server 5.1.66-rel14.1 tarball.

parent 190ccd24
......@@ -60,7 +60,7 @@ SET(INNODB_PLUGIN_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea
ibuf/ibuf0ibuf.c
pars/lexyy.c pars/pars0grm.c pars/pars0opt.c pars/pars0pars.c pars/pars0sym.c
lock/lock0lock.c lock/lock0iter.c
log/log0log.c log/log0recv.c
log/log0log.c log/log0recv.c log/log0online.c
mach/mach0data.c
mem/mem0mem.c mem/mem0pool.c
mtr/mtr0log.c mtr/mtr0mtr.c
......
2012-08-29 The InnoDB Team
* btr/btr0btr.c, page/page0cur.c, page/page0page.c:
Fix Bug#14554000 CRASH IN PAGE_REC_GET_NTH_CONST(NTH=0)
DURING COMPRESSED PAGE SPLIT
2012-08-16 The InnoDB Team
* btr/btr0cur.c:
Fix Bug#12595091 POSSIBLY INVALID ASSERTION IN
BTR_CUR_PESSIMISTIC_UPDATE()
2012-08-16 The InnoDB Team
* btr/btr0btr.c, btr/btr0cur.c:
Fix Bug#12845774 OPTIMISTIC INSERT/UPDATE USES WRONG HEURISTICS FOR
COMPRESSED PAGE SIZE
2012-08-16 The InnoDB Team
* btr/btr0cur.c, page/page0page.c:
Fix Bug#13523839 ASSERTION FAILURES ON COMPRESSED INNODB TABLES
2012-08-07 The InnoDB Team
* btr/btr0pcur.c, row/row0merge.c:
Fix Bug#14399148 INNODB TABLES UNDER LOAD PRODUCE DUPLICATE COPIES
OF ROWS IN QUERIES
2012-03-15 The InnoDB Team
* fil/fil0fil.c, ibuf/ibuf0ibuf.c, include/fil0fil.h,
lock/lock0lock.c:
Fix Bug#13825266 RACE IN LOCK_VALIDATE() WHEN ACCESSING PAGES
DIRECTLY FROM BUFFER POOL
2012-03-15 The InnoDB Team
* handler/ha_innodb.cc:
Fix Bug#13851171STRING OVERFLOW IN INNODB CODE FOUND BY STATIC
ANALYSIS
2012-03-15 The InnoDB Team
* include/sync0rw.ic:
Fix Bug#13537504 VALGRIND: COND. JUMP/MOVE DEPENDS ON
UNINITIALISED VALUES IN OS_THREAD_EQ
2012-03-08 The InnoDB Team
* btr/btr0pcur.c:
Fix Bug#13807811 BTR_PCUR_RESTORE_POSITION() CAN SKIP A RECORD
2012-02-28 The InnoDB Team
* btr/btr0btr.c, dict/dict0dict.c, include/btr0btr.h,
include/dict0dict.h, include/dict0dict.ic, include/dict0mem.h,
handler/handler0alter.cc, row/row0mysql.c:
Fix Bug#12861864 RACE CONDITION IN BTR_GET_SIZE() AND
DROP INDEX/TABLE/DATABASE
2012-02-15 The InnoDB Team
* btr/btr0btr.c, btr/btr0cur.c, fsp/fsp0fsp.c, ibuf/ibuf0ibuf.c,
include/btr0btr.h, include/btr0cur.h, include/btr0cur.ic,
include/buf0buf.h, include/buf0buf.ic, include/fsp0fsp.h,
include/mtr0mtr.h, include/mtr0mtr.ic, include/page0page.h,
include/page0page.ic, include/trx0rec.ic, include/trx0undo.h,
mtr/mtr0mtr.c, page/page0cur.c, page/page0page.c, row/row0ins.c,
row/row0row.c, row/row0upd.c, trx/trx0rec.c, trx/trx0sys.c,
trx/trx0undo.c:
Fix Bug#13721257 RACE CONDITION IN UPDATES OR INSERTS OF WIDE RECORDS
2012-02-06 The InnoDB Team
* handler/ha_innodb.cc:
Fix Bug#11754376 45976: INNODB LOST FILES FOR TEMPORARY TABLES ON
GRACEFUL SHUTDOWN
2012-01-30 The InnoDB Team
* fil/fil0fil.c:
Fix Bug#13636122 THE ORIGINAL TABLE MISSING WHILE EXECUTE THE
DDL 'ALTER TABLE ADD COLUMN'
2012-01-16 The InnoDB Team
* ibuf/ibuf0ibuf.c:
Fix Bug#13496818 ASSERTION: REC_PAGE_NO > 4 IN IBUF CONTRACTION
2012-01-16 The InnoDB Team
* handler/ha_innodb.cc:
Fix Bug#11765438: 58406: ISSUES WITH COPYING PARTITIONED INNODB
TABLES FROM LINUX TO WINDOWS
2012-01-04 The InnoDB Team
* row/row0mysql.c:
Fix Bug#12400341: INNODB CAN LEAVE ORPHAN IBD FILES AROUND
2011-12-22 The InnoDB Team
* row/row0sel.c:
Fix Bug#63775 Server crash on handler read next after delete record.
2011-12-21 The InnoDB Team
* include/ut0rnd.ic:
Fix Bug#11866367:FPE WHEN SETTING INNODB_SPIN_WAIT_DELAY
2011-12-13 The InnoDB Team
* handler/ha_innodb.cc, innodb.test, innodb.result:
Fix Bug#13117023: InnoDB was incrementing the handler_read_key,
also the SSV::ha_read_key_count, at the wrong place.
2011-12-10 The InnoDB Team
* include/page0page.h, page/page0page.c:
Fix Bug#13418887 ERROR IN DIAGNOSTIC FUNCTION PAGE_REC_PRINT()
2011-11-10 The InnoDB Team
* handler/ha_innodb.cc, row/row0ins.c, innodb_replace.test:
Fix Bug#11759688 52020: InnoDB can still deadlock
on just INSERT...ON DUPLICATE KEY a.k.a. the reintroduction of
Bug#7975 deadlock without any locking, simple select and update
2011-11-08 The InnoDB Team
* btr/btr0pcur.c, include/btr0pcur.h, include/btr0pcur.ic:
Fix Bug#13358468 ASSERTION FAILURE IN BTR_PCUR_GET_BLOCK
2011-10-27 The InnoDB Team
* row/row0mysql.c:
Fix Bug #12884631 62146: TABLES ARE LOST FOR DDL
2011-10-25 The InnoDB Team
* handler/ha_innodb.cc, row/row0ins.c:
Fix Bug#13002783 PARTIALLY UNINITIALIZED CASCADE UPDATE VECTOR
2011-10-20 The InnoDB Team
* btr/btr0cur.c:
Fix Bug#13116045 Compilation failure using GCC 4.6.1 in btr/btr0cur.c
2011-10-12 The InnoDB Team
* btr/btr0cur.c, btr/btr0sea.c, buf/buf0buf.c, buf/buf0lru.c,
ha/ha0ha.c, handler/ha_innodb.cc, ibuf/ibuf0ibuf.c, include/btr0sea.h,
include/btr0types.h, include/buf0buf.h, include/ha0ha.h,
include/ha0ha.ic, include/row0upd.ic, include/sync0sync.h,
page/page0page.c, sync/sync0sync.c:
Fix Bug#13006367 62487: innodb takes 3 minutes to clean up
the adaptive hash index at shutdown
2011-10-04 The InnoDB Team
* include/sync0rw.h, sync/sync0rw.c:
Fix Bug#13034534 RQG TESTS FAIL ON WINDOWS WITH CRASH NEAR
RW_LOCK_DEBUG_PRINT
2011-09-20 The InnoDB Team
* row/row0purge.c:
Fix Bug#12963823 CRASH IN PURGE THREAD UNDER UNUSUAL CIRCUMSTANCES
2011-09-12 The InnoDB Team
* row/row0sel.c:
Fix Bug#12601439 CONSISTENT READ FAILURE IN COLUMN PREFIX INDEX
2011-09-08 The InnoDB Team
* btr/btr0cur.c, include/page0page.h, include/row0upd.ic:
Fix Bug#12948130 UNNECESSARY X-LOCKING OF ADAPTIVE HASH INDEX
2011-09-06 The InnoDB Team
* buf/buf0buddy.c:
Fix Bug#12950803 62294: BUF_BUDDY_RELOCATE CALLS GETTIMEOFDAY
WHILE HOLDING BUFFER POOL MUTEX
2011-09-06 The InnoDB Team
* include/trx0undo.h, trx/trx0rec.c, trx/trx0undo.c:
Fix Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
2011-08-29 The InnoDB Team
* btr/btr0btr.c, btr/btr0cur.c, fsp/fsp0fsp.c,
include/btr0btr.h, include/btr0cur.h, include/fsp0fsp.h,
include/mtr0mtr.h, include/mtr0mtr.ic, mtr/mtr0mtr.c,
row/row0ins.c, row/row0row.c, row/row0upd.c, trx/trx0undo.c:
Fix Bug#12704861 Corruption after a crash during BLOB update
and other regressions from the fix of Bug#12612184
2011-08-15 The InnoDB Team
* btr/btr0btr.c, btr/btr0cur.c, btr/btr0pcur.c, btr/btr0sea.c,
dict/dict0crea.c, dict/dict0dict.c, ibuf/ibuf0ibuf.c,
include/btr0btr.h, include/btr0btr.ic, include/sync0sync.h,
sync/sync0sync.c:
Fix Bug#11766591 59733: Possible deadlock when buffered changes
are to be discarded in buf_page_create()
2011-08-08 The InnoDB Team
* row/row0sel.c:
......
......@@ -101,6 +101,7 @@ noinst_HEADERS= \
include/lock0types.h \
include/log0log.h \
include/log0log.ic \
include/log0online.h \
include/log0recv.h \
include/log0recv.ic \
include/mach0data.h \
......@@ -226,7 +227,6 @@ noinst_HEADERS= \
include/ut0vec.h \
include/ut0vec.ic \
include/ut0wqueue.h \
handler/innodb_patch_info.h \
mem/mem0dbg.c
EXTRA_LIBRARIES= libinnobase.a
......@@ -266,6 +266,7 @@ libinnobase_a_SOURCES= \
lock/lock0iter.c \
lock/lock0lock.c \
log/log0log.c \
log/log0online.c \
log/log0recv.c \
mach/mach0data.c \
mem/mem0mem.c \
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
/*****************************************************************************
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -127,6 +127,8 @@ btr_pcur_store_position(
ut_a(btr_page_get_next(page, mtr) == FIL_NULL);
ut_a(btr_page_get_prev(page, mtr) == FIL_NULL);
ut_ad(page_is_leaf(page));
ut_ad(page_get_page_no(page) == index->page);
cursor->old_stored = BTR_PCUR_OLD_STORED;
......@@ -253,6 +255,8 @@ btr_pcur_restore_position_func(
cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE,
index, latch_mode, btr_pcur_get_btr_cur(cursor), mtr);
cursor->latch_mode = latch_mode;
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
cursor->block_when_stored = btr_pcur_get_block(cursor);
return(FALSE);
......@@ -272,8 +276,10 @@ btr_pcur_restore_position_func(
file, line, mtr))) {
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
buf_block_dbg_add_level(btr_pcur_get_block(cursor),
SYNC_TREE_NODE);
buf_block_dbg_add_level(
btr_pcur_get_block(cursor),
dict_index_is_ibuf(index)
? SYNC_IBUF_TREE_NODE : SYNC_TREE_NODE);
if (cursor->rel_pos == BTR_PCUR_ON) {
#ifdef UNIV_DEBUG
......@@ -315,13 +321,19 @@ btr_pcur_restore_position_func(
/* Save the old search mode of the cursor */
old_mode = cursor->search_mode;
if (UNIV_LIKELY(cursor->rel_pos == BTR_PCUR_ON)) {
switch (cursor->rel_pos) {
case BTR_PCUR_ON:
mode = PAGE_CUR_LE;
} else if (cursor->rel_pos == BTR_PCUR_AFTER) {
break;
case BTR_PCUR_AFTER:
mode = PAGE_CUR_G;
} else {
ut_ad(cursor->rel_pos == BTR_PCUR_BEFORE);
break;
case BTR_PCUR_BEFORE:
mode = PAGE_CUR_L;
break;
default:
ut_error;
mode = 0;
}
btr_pcur_open_with_no_init_func(index, tuple, mode, latch_mode,
......@@ -330,19 +342,24 @@ btr_pcur_restore_position_func(
/* Restore the old search mode */
cursor->search_mode = old_mode;
if (cursor->rel_pos == BTR_PCUR_ON
&& btr_pcur_is_on_user_rec(cursor)
&& 0 == cmp_dtuple_rec(tuple, btr_pcur_get_rec(cursor),
rec_get_offsets(
btr_pcur_get_rec(cursor), index,
NULL, ULINT_UNDEFINED, &heap))) {
/* We have to store the NEW value for the modify clock, since
the cursor can now be on a different page! But we can retain
the value of old_rec */
cursor->block_when_stored = btr_pcur_get_block(cursor);
cursor->modify_clock = buf_block_get_modify_clock(
switch (cursor->rel_pos) {
case BTR_PCUR_ON:
if (btr_pcur_is_on_user_rec(cursor)
&& !cmp_dtuple_rec(
tuple, btr_pcur_get_rec(cursor),
rec_get_offsets(btr_pcur_get_rec(cursor),
index, NULL,
ULINT_UNDEFINED, &heap))) {
/* We have to store the NEW value for
the modify clock, since the cursor can
now be on a different page! But we can
retain the value of old_rec */
cursor->block_when_stored =
btr_pcur_get_block(cursor);
cursor->modify_clock =
buf_block_get_modify_clock(
cursor->block_when_stored);
cursor->old_stored = BTR_PCUR_OLD_STORED;
......@@ -350,6 +367,15 @@ btr_pcur_restore_position_func(
return(TRUE);
}
#ifdef UNIV_DEBUG
/* fall through */
case BTR_PCUR_BEFORE:
case BTR_PCUR_AFTER:
break;
default:
ut_error;
#endif /* UNIV_DEBUG */
}
mem_heap_free(heap);
......@@ -396,7 +422,8 @@ btr_pcur_move_to_next_page(
ut_ad(next_page_no != FIL_NULL);
next_block = btr_block_get(space, zip_size, next_page_no,
cursor->latch_mode, mtr);
cursor->latch_mode,
btr_pcur_get_btr_cur(cursor)->index, mtr);
next_page = buf_block_get_frame(next_block);
if (srv_pass_corrupt_table && !next_page) {
......
This diff is collapsed.
......@@ -354,7 +354,6 @@ buf_buddy_relocate(
{
buf_page_t* bpage;
const ulint size = BUF_BUDDY_LOW << i;
ullint usec = ut_time_us(NULL);
mutex_t* mutex;
ulint space;
ulint page_no;
......@@ -442,6 +441,7 @@ buf_buddy_relocate(
if (mutex && buf_page_can_relocate(bpage)) {
/* Relocate the compressed page. */
ullint usec = ut_time_us(NULL);
ut_a(bpage->zip.data == src);
memcpy(dst, src, size);
bpage->zip.data = dst;
......
This diff is collapsed.
......@@ -48,6 +48,7 @@ Created 11/5/1995 Heikki Tuuri
#include "page0zip.h"
#include "log0recv.h"
#include "srv0srv.h"
#include "srv0start.h"
/** The number of blocks from the LRU_old pointer onward, including
the block pointed to, must be buf_LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV
......@@ -292,7 +293,7 @@ next_page:
//mutex_enter(&((buf_block_t*) bpage)->mutex);
is_fixed = bpage->buf_fix_count > 0
|| !((buf_block_t*) bpage)->is_hashed;
|| !((buf_block_t*) bpage)->index;
//mutex_exit(&((buf_block_t*) bpage)->mutex);
if (is_fixed) {
......@@ -451,7 +452,7 @@ scan_again:
if (buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE) {
/* This is a compressed-only block
descriptor. Do nothing. */
} else if (((buf_block_t*) bpage)->is_hashed) {
} else if (((buf_block_t*) bpage)->index) {
ulint page_no;
ulint zip_size;
......@@ -465,7 +466,7 @@ scan_again:
mutex_exit(block_mutex);
/* Note that the following call will acquire
an S-latch on the page */
and release an X-latch on the page. */
btr_search_drop_page_hash_when_freed(
id, zip_size, page_no);
......@@ -537,7 +538,7 @@ buf_LRU_mark_space_was_deleted(
for (j = chunk->size; j--; block++) {
if (buf_block_get_state(block)
!= BUF_BLOCK_FILE_PAGE
|| !block->is_hashed
|| !(block->index != NULL)
|| buf_page_get_space(&block->page) != id) {
continue;
}
......@@ -1428,13 +1429,12 @@ buf_LRU_make_block_old(
Try to free a block. If bpage is a descriptor of a compressed-only
page, the descriptor object will be freed as well.
NOTE: If this function returns TRUE, it will temporarily
release buf_pool_mutex. Furthermore, the page frame will no longer be
accessible via bpage.
NOTE: This will temporarily release buf_pool_mutex. Furthermore, the
page frame will no longer be accessible via bpage.
The caller must hold buf_pool_mutex and buf_page_get_mutex(bpage) and
release these two mutexes after the call. No other
buf_page_get_mutex() may be held when calling this function.
The caller must hold buf_page_get_mutex(bpage) and release this mutex
after the call. No other buf_page_get_mutex() may be held when
calling this function.
@return TRUE if freed, FALSE otherwise. */
UNIV_INTERN
ibool
......@@ -2098,6 +2098,12 @@ func_exit:
/********************************************************************//**
Dump the LRU page list to the specific file. */
#define LRU_DUMP_FILE "ib_lru_dump"
#define LRU_DUMP_TEMP_FILE "ib_lru_dump.tmp"
#define LRU_OS_FILE_WRITE() \
os_file_write(LRU_DUMP_FILE, dump_file, buffer, \
(buffers << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL, \
(buffers >> (32 - UNIV_PAGE_SIZE_SHIFT)), \
UNIV_PAGE_SIZE)
UNIV_INTERN
ibool
......@@ -2109,17 +2115,19 @@ buf_LRU_file_dump(void)
byte* buffer_base = NULL;
byte* buffer = NULL;
buf_page_t* bpage;
buf_page_t* first_bpage;
ulint buffers;
ulint offset;
ibool ret = FALSE;
ulint pages_written;
ulint i;
ulint total_pages;
for (i = 0; i < srv_n_data_files; i++) {
if (strstr(srv_data_file_names[i], LRU_DUMP_FILE) != NULL) {
fprintf(stderr,
" InnoDB: The name '%s' seems to be used for"
" innodb_data_file_path. Dumping LRU list is not"
" done for safeness.\n", LRU_DUMP_FILE);
" innodb_data_file_path. Dumping LRU list is"
" not done for safeness.\n", LRU_DUMP_FILE);
goto end;
}
}
......@@ -2132,7 +2140,7 @@ buf_LRU_file_dump(void)
goto end;
}
dump_file = os_file_create(LRU_DUMP_FILE, OS_FILE_OVERWRITE,
dump_file = os_file_create(LRU_DUMP_TEMP_FILE, OS_FILE_OVERWRITE,
OS_FILE_NORMAL, OS_DATA_FILE, &success);
if (!success) {
os_file_get_last_error(TRUE);
......@@ -2142,12 +2150,21 @@ buf_LRU_file_dump(void)
}
mutex_enter(&LRU_list_mutex);
bpage = UT_LIST_GET_LAST(buf_pool->LRU);
bpage = first_bpage = UT_LIST_GET_FIRST(buf_pool->LRU);
total_pages = UT_LIST_GET_LEN(buf_pool->LRU);
buffers = offset = 0;
while (bpage != NULL) {
if (offset == 0) {
memset(buffer, 0, UNIV_PAGE_SIZE);
buffers = offset = pages_written = 0;
while (bpage != NULL && (pages_written++ < total_pages)) {
buf_page_t* next_bpage = UT_LIST_GET_NEXT(LRU, bpage);
if (next_bpage == first_bpage) {
mutex_exit(&LRU_list_mutex);
success = FALSE;
fprintf(stderr,
"InnoDB: detected cycle in LRU, skipping "
"dump\n");
goto end;
}
mach_write_to_4(buffer + offset * 4, bpage->space);
......@@ -2156,50 +2173,79 @@ buf_LRU_file_dump(void)
offset++;
if (offset == UNIV_PAGE_SIZE/4) {
success = os_file_write(LRU_DUMP_FILE, dump_file, buffer,
(buffers << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL,
(buffers >> (32 - UNIV_PAGE_SIZE_SHIFT)),
UNIV_PAGE_SIZE);
mutex_t *next_block_mutex = NULL;
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
mutex_exit(&LRU_list_mutex);
success = FALSE;
fprintf(stderr,
" InnoDB: stopped dumping lru pages"
" because of server shutdown.\n");
goto end;
}
/* while writing file, release buffer pool mutex but
keep the next page fixed so we don't worry about
our list iterator becoming invalid */
if (next_bpage) {
next_block_mutex = buf_page_get_mutex(
next_bpage);
mutex_enter(next_block_mutex);
next_bpage->buf_fix_count++;
mutex_exit(next_block_mutex);
}
mutex_exit(&LRU_list_mutex);
success = LRU_OS_FILE_WRITE();
/* grab this again here so that next_bpage
can't be purged when we drop the fix_count */
mutex_enter(&LRU_list_mutex);
if (next_bpage) {
mutex_enter(next_block_mutex);
next_bpage->buf_fix_count--;
mutex_exit(next_block_mutex);
}
if (!success) {
mutex_exit(&LRU_list_mutex);
fprintf(stderr,
" InnoDB: cannot write page %lu of %s\n",
" InnoDB: cannot write page"
" %lu of %s\n",
buffers, LRU_DUMP_FILE);
goto end;
}
buffers++;
offset = 0;
bpage = next_bpage;
} else {
bpage = UT_LIST_GET_NEXT(LRU, bpage);
}
bpage = UT_LIST_GET_PREV(LRU, bpage);
}
} /* while(bpage ...) */
mutex_exit(&LRU_list_mutex);
if (offset == 0) {
memset(buffer, 0, UNIV_PAGE_SIZE);
}
mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL);
offset++;
mach_write_to_4(buffer + offset * 4, 0xFFFFFFFFUL);
offset++;
success = os_file_write(LRU_DUMP_FILE, dump_file, buffer,
(buffers << UNIV_PAGE_SIZE_SHIFT) & 0xFFFFFFFFUL,
(buffers >> (32 - UNIV_PAGE_SIZE_SHIFT)),
UNIV_PAGE_SIZE);
if (!success) {
goto end;
}
ret = TRUE;
success = LRU_OS_FILE_WRITE();
end:
if (dump_file != -1)
if (dump_file != -1) {
if (success) {
success = os_file_flush(dump_file, TRUE);
}
os_file_close(dump_file);
}
if (success) {
success = os_file_rename(LRU_DUMP_TEMP_FILE,
LRU_DUMP_FILE);
}
if (buffer_base)
ut_free(buffer_base);
return(ret);
return(success);
}
typedef struct {
......@@ -2241,6 +2287,7 @@ buf_LRU_file_restore(void)
dump_record_t* records = NULL;
ulint size;
ulint size_high;
ulint recsize = sizeof(dump_record_t);
ulint length;
dump_file = os_file_create_simple_no_error_handling(
......@@ -2248,7 +2295,15 @@ buf_LRU_file_restore(void)
if (!success || !os_file_get_size(dump_file, &size, &size_high)) {
os_file_get_last_error(TRUE);
fprintf(stderr,
" InnoDB: cannot open %s\n", LRU_DUMP_FILE);
" InnoDB: cannot open %s,"
" buffer pool preload not done\n",
LRU_DUMP_FILE);
goto end;
}
if (size == 0 || size_high > 0 || size % recsize) {
fprintf(stderr, " InnoDB: broken LRU dump file,"
" buffer pool preload not done\n");
goto end;
}
......@@ -2332,6 +2387,14 @@ buf_LRU_file_restore(void)
if (offset % 16 == 15) {
os_aio_simulated_wake_handler_threads();
buf_flush_free_margin(FALSE);
/* skip loading of the rest of the file if we are
terminating anyway*/
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
fprintf(stderr,
" InnoDB: stopped loading LRU pages"
" because of server shutdown.\n");
break;
}
}
zip_size = fil_space_get_zip_size(space_id);
......
......@@ -236,6 +236,166 @@ dict_hdr_create(
return(TRUE);
}
/*****************************************************************//**
Verifies the SYS_STATS table by scanning its clustered index. This
function may only be called at InnoDB startup time.
@return TRUE if SYS_STATS was verified successfully */
UNIV_INTERN
ibool
dict_verify_xtradb_sys_stats(void)
/*==============================*/
{
dict_index_t* sys_stats_index;
ulint saved_srv_pass_corrupt_table = srv_pass_corrupt_table;
ibool result;
sys_stats_index = dict_table_get_first_index(dict_sys->sys_stats);
/* Since this may be called only during server startup, avoid hitting
various asserts by using XtraDB pass_corrupt_table option. */
srv_pass_corrupt_table = 1;
result = btr_validate_index(sys_stats_index, NULL);
srv_pass_corrupt_table = saved_srv_pass_corrupt_table;
return result;
}
/*****************************************************************//**
Creates the B-tree for the SYS_STATS clustered index, adds the XtraDB
mark and the id of the index to the dictionary header page. Rewrites
both passed args. */
static
void
dict_create_xtradb_sys_stats(
/*=========================*/
dict_hdr_t** dict_hdr, /*!< in/out: dictionary header */
mtr_t* mtr) /*!< in/out: mtr */
{
ulint root_page_no;
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
DICT_HDR_SPACE, 0, DICT_STATS_ID,
dict_ind_redundant, mtr);
if (root_page_no == FIL_NULL) {
fprintf(stderr, "InnoDB: Warning: failed to create SYS_STATS btr.\n");
srv_use_sys_stats_table = FALSE;
} else {
mlog_write_ulint(*dict_hdr + DICT_HDR_STATS, root_page_no,
MLOG_4BYTES, mtr);
mlog_write_dulint(*dict_hdr + DICT_HDR_XTRADB_MARK,
DICT_HDR_XTRADB_FLAG, mtr);
}
mtr_commit(mtr);
/* restart mtr */
mtr_start(mtr);
*dict_hdr = dict_hdr_get(mtr);
}
/*****************************************************************//**
Create the table and index structure of SYS_STATS for the dictionary
cache and add it there. If called for the first time, also support
wrong root page id injection for testing purposes. */
static
void
dict_add_to_cache_xtradb_sys_stats(
/*===============================*/
ibool first_time __attribute__((unused)),
/*!< in: first invocation flag. If
TRUE, optionally inject wrong root page
id */
mem_heap_t* heap, /*!< in: memory heap for table/index
allocation */
dict_hdr_t* dict_hdr, /*!< in: dictionary header */
mtr_t* mtr) /*!< in: mtr */
{
dict_table_t* table;
dict_index_t* index;
ulint root_page_id;
ulint error;
table = dict_mem_table_create("SYS_STATS", DICT_HDR_SPACE, 4, 0);
table->n_mysql_handles_opened = 1; /* for pin */
dict_mem_table_add_col(table, heap, "INDEX_ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "KEY_COLS", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "DIFF_VALS", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "NON_NULL_VALS", DATA_BINARY, 0, 0);
/* The '+ 2' below comes from the fields DB_TRX_ID, DB_ROLL_PTR */
#if DICT_SYS_STATS_DIFF_VALS_FIELD != 2 + 2
#error "DICT_SYS_STATS_DIFF_VALS_FIELD != 2 + 2"
#endif
#if DICT_SYS_STATS_NON_NULL_VALS_FIELD != 3 + 2
#error "DICT_SYS_STATS_NON_NULL_VALS_FIELD != 3 + 2"
#endif
table->id = DICT_STATS_ID;
dict_table_add_to_cache(table, heap);
dict_sys->sys_stats = table;
mem_heap_empty(heap);
index = dict_mem_index_create("SYS_STATS", "CLUST_IND",
DICT_HDR_SPACE,
DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, "INDEX_ID", 0);
dict_mem_index_add_field(index, "KEY_COLS", 0);
index->id = DICT_STATS_ID;
root_page_id = mtr_read_ulint(dict_hdr + DICT_HDR_STATS, MLOG_4BYTES,
mtr);
#ifdef UNIV_DEBUG
if ((srv_sys_stats_root_page != 0) && first_time)
root_page_id = srv_sys_stats_root_page;
#endif
error = dict_index_add_to_cache(table, index, root_page_id, FALSE);
ut_a(error == DB_SUCCESS);
mem_heap_empty(heap);
}
/*****************************************************************//**
Discard the existing dictionary cache SYS_STATS information, create and
add it there anew. Does not touch the old SYS_STATS tablespace page
under the assumption that they are corrupted or overwritten for other
purposes. */
UNIV_INTERN
void
dict_recreate_xtradb_sys_stats(void)
/*================================*/
{
mtr_t mtr;
dict_hdr_t* dict_hdr;
dict_index_t* sys_stats_clust_idx;
mem_heap_t* heap;
heap = mem_heap_create(450);
mutex_enter(&(dict_sys->mutex));
sys_stats_clust_idx = dict_table_get_first_index(dict_sys->sys_stats);
dict_index_remove_from_cache(dict_sys->sys_stats, sys_stats_clust_idx);
dict_table_remove_from_cache(dict_sys->sys_stats);
dict_sys->sys_stats = NULL;
mtr_start(&mtr);
dict_hdr = dict_hdr_get(&mtr);
dict_create_xtradb_sys_stats(&dict_hdr, &mtr);
dict_add_to_cache_xtradb_sys_stats(FALSE, heap, dict_hdr, &mtr);
mem_heap_free(heap);
mtr_commit(&mtr);
mutex_exit(&(dict_sys->mutex));
}
/*****************************************************************//**
Initializes the data dictionary memory structures when the database is
started. This function is also called when the data dictionary is created. */
......@@ -251,39 +411,23 @@ dict_boot(void)
mtr_t mtr;
ulint error;
heap = mem_heap_create(450);
mtr_start(&mtr);
/* Create the hash tables etc. */
dict_init();
heap = mem_heap_create(450);
mutex_enter(&(dict_sys->mutex));
/* Get the dictionary header */
dict_hdr = dict_hdr_get(&mtr);
if (ut_dulint_cmp(mtr_read_dulint(dict_hdr + DICT_HDR_XTRADB_MARK, &mtr),
DICT_HDR_XTRADB_FLAG) != 0) {
/* not extended yet by XtraDB, need to be extended */
ulint root_page_no;
if (ut_dulint_cmp(mtr_read_dulint(dict_hdr + DICT_HDR_XTRADB_MARK,
&mtr), DICT_HDR_XTRADB_FLAG) != 0) {
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
DICT_HDR_SPACE, 0, DICT_STATS_ID,
dict_ind_redundant, &mtr);
if (root_page_no == FIL_NULL) {
fprintf(stderr, "InnoDB: Warning: failed to create SYS_STATS btr.\n");
srv_use_sys_stats_table = FALSE;
} else {
mlog_write_ulint(dict_hdr + DICT_HDR_STATS, root_page_no,
MLOG_4BYTES, &mtr);
mlog_write_dulint(dict_hdr + DICT_HDR_XTRADB_MARK,
DICT_HDR_XTRADB_FLAG, &mtr);
}
mtr_commit(&mtr);
/* restart mtr */
mtr_start(&mtr);
dict_hdr = dict_hdr_get(&mtr);
/* not extended yet by XtraDB, need to be extended */
dict_create_xtradb_sys_stats(&dict_hdr, &mtr);
}
/* Because we only write new row ids to disk-based data structure
......@@ -464,42 +608,7 @@ dict_boot(void)
FALSE);
ut_a(error == DB_SUCCESS);
/*-------------------------*/
table = dict_mem_table_create("SYS_STATS", DICT_HDR_SPACE, 4, 0);
table->n_mysql_handles_opened = 1; /* for pin */
dict_mem_table_add_col(table, heap, "INDEX_ID", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "KEY_COLS", DATA_INT, 0, 4);
dict_mem_table_add_col(table, heap, "DIFF_VALS", DATA_BINARY, 0, 0);
dict_mem_table_add_col(table, heap, "NON_NULL_VALS", DATA_BINARY, 0, 0);
/* The '+ 2' below comes from the fields DB_TRX_ID, DB_ROLL_PTR */
#if DICT_SYS_STATS_DIFF_VALS_FIELD != 2 + 2
#error "DICT_SYS_STATS_DIFF_VALS_FIELD != 2 + 2"
#endif
#if DICT_SYS_STATS_NON_NULL_VALS_FIELD != 3 + 2
#error "DICT_SYS_STATS_NON_NULL_VALS_FIELD != 3 + 2"
#endif
table->id = DICT_STATS_ID;
dict_table_add_to_cache(table, heap);
dict_sys->sys_stats = table;
mem_heap_empty(heap);
index = dict_mem_index_create("SYS_STATS", "CLUST_IND",
DICT_HDR_SPACE,
DICT_UNIQUE | DICT_CLUSTERED, 2);
dict_mem_index_add_field(index, "INDEX_ID", 0);
dict_mem_index_add_field(index, "KEY_COLS", 0);
index->id = DICT_STATS_ID;
error = dict_index_add_to_cache(table, index,
mtr_read_ulint(dict_hdr
+ DICT_HDR_STATS,
MLOG_4BYTES, &mtr),
FALSE);
ut_a(error == DB_SUCCESS);
dict_add_to_cache_xtradb_sys_stats(TRUE, heap, dict_hdr, &mtr);
mem_heap_free(heap);
......
/*****************************************************************************
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -899,7 +899,7 @@ dict_truncate_index_tree(
appropriate field in the SYS_INDEXES record: this mini-transaction
marks the B-tree totally truncated */
btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, NULL, mtr);
btr_free_root(space, zip_size, root_page_no, mtr);
create:
......
/*****************************************************************************
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -24,6 +24,8 @@ Created 1/8/1996 Heikki Tuuri
***********************************************************************/
#include "dict0dict.h"
#include "m_string.h"
#include "my_sys.h"
#ifdef UNIV_NONINL
#include "dict0dict.ic"
......@@ -270,15 +272,39 @@ dict_table_stats_lock(
ulint latch_mode) /*!< in: RW_S_LATCH or
RW_X_LATCH */
{
rw_lock_t *want, *got;
ut_ad(table != NULL);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
switch (latch_mode) {
case RW_S_LATCH:
rw_lock_s_lock(GET_TABLE_STATS_LATCH(table));
/* Lock one of dict_table_stats_latches in S-mode.
Latch is picked using table->id. table->id might be
changed while we are waiting for lock to be grabbed */
for (;;) {
want= GET_TABLE_STATS_LATCH(table);
rw_lock_s_lock(want);
got= GET_TABLE_STATS_LATCH(table);
if (want == got) {
break;
}
rw_lock_s_unlock(want);
}
break;
case RW_X_LATCH:
rw_lock_x_lock(GET_TABLE_STATS_LATCH(table));
/* Lock one of dict_table_stats_latches in X-mode.
Latch is picked using table->id. table->id might be
changed while we are waiting for lock to be grabbed */
for (;;) {
want= GET_TABLE_STATS_LATCH(table);
rw_lock_x_lock(want);
got= GET_TABLE_STATS_LATCH(table);
if (want == got) {
break;
}
rw_lock_x_unlock(want);
}
break;
case RW_NO_LATCH:
/* fall through */
......@@ -1164,12 +1190,21 @@ dict_table_change_id_in_cache(
dict_table_t* table, /*!< in/out: table object already in cache */
dulint new_id) /*!< in: new id to set */
{
dict_table_t table_tmp;
ut_ad(table);
ut_ad(mutex_own(&(dict_sys->mutex)));
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
/* Remove the table from the hash table of id's */
/* Lock is needed to prevent dict_table_stats_latches from
being leaked. dict_table_stats_lock picks one latch using
table->id. We are changing table->id below. That is why
we also should remember the old value to unlock table */
dict_table_stats_lock(table, RW_X_LATCH);
table_tmp= *table;
HASH_DELETE(dict_table_t, id_hash, dict_sys->table_id_hash,
ut_fold_dulint(table->id), table);
table->id = new_id;
......@@ -1177,6 +1212,8 @@ dict_table_change_id_in_cache(
/* Add the table back to the hash table */
HASH_INSERT(dict_table_t, id_hash, dict_sys->table_id_hash,
ut_fold_dulint(table->id), table);
dict_table_stats_unlock(&table_tmp, RW_X_LATCH);
}
/**********************************************************************//**
......@@ -1724,7 +1761,9 @@ undo_size_ok:
new_index->stat_n_leaf_pages = 1;
new_index->page = page_no;
rw_lock_create(&new_index->lock, SYNC_INDEX_TREE);
rw_lock_create(&new_index->lock,
dict_index_is_ibuf(index)
? SYNC_IBUF_INDEX_TREE : SYNC_INDEX_TREE);
if (!UNIV_UNLIKELY(new_index->type & DICT_UNIVERSAL)) {
......@@ -2338,6 +2377,8 @@ dict_foreign_free(
/*==============*/
dict_foreign_t* foreign) /*!< in, own: foreign key struct */
{
ut_a(foreign->foreign_table->n_foreign_key_checks_running == 0);
mem_heap_free(foreign->heap);
}
......@@ -4306,19 +4347,26 @@ dict_reload_statistics(
heap = mem_heap_create(1000);
while (index) {
mtr_t mtr;
if (table->is_corrupt) {
ut_a(srv_pass_corrupt_table);
mem_heap_free(heap);
return(FALSE);
}
size = btr_get_size(index, BTR_TOTAL_SIZE);
mtr_start(&mtr);
mtr_s_lock(dict_index_get_lock(index), &mtr);
size = btr_get_size(index, BTR_TOTAL_SIZE, &mtr);
index->stat_index_size = size;
*sum_of_index_sizes += size;
size = btr_get_size(index, BTR_N_LEAF_PAGES);
size = btr_get_size(index, BTR_N_LEAF_PAGES, &mtr);
mtr_commit(&mtr);
if (size == 0) {
/* The root node of the tree is a leaf */
......@@ -4574,12 +4622,6 @@ next_rec:
}
btr_pcur_close(&pcur);
mtr_commit(&mtr);
if (rests) {
fprintf(stderr, "InnoDB: Warning: failed to store %lu stats entries"
" of %s/%s to SYS_STATS system table.\n",
rests, index->table_name, index->name);
}
}
/*===========================================*/
......@@ -4668,16 +4710,27 @@ dict_update_statistics(
(srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE
|| (srv_force_recovery < SRV_FORCE_NO_LOG_REDO
&& dict_index_is_clust(index)))) {
mtr_t mtr;
ulint size;
size = btr_get_size(index, BTR_TOTAL_SIZE);
index->stat_index_size = size;
mtr_start(&mtr);
mtr_s_lock(dict_index_get_lock(index), &mtr);
size = btr_get_size(index, BTR_TOTAL_SIZE, &mtr);
if (size != ULINT_UNDEFINED) {
sum_of_index_sizes += size;
index->stat_index_size = size;
size = btr_get_size(
index, BTR_N_LEAF_PAGES, &mtr);
}
size = btr_get_size(index, BTR_N_LEAF_PAGES);
mtr_commit(&mtr);
if (size == 0) {
switch (size) {
case ULINT_UNDEFINED:
goto fake_statistics;
case 0:
/* The root node of the tree is a leaf */
size = 1;
}
......@@ -4694,6 +4747,7 @@ dict_update_statistics(
various means, also via secondary indexes. */
ulint i;
fake_statistics:
sum_of_index_sizes++;
index->stat_index_size = index->stat_n_leaf_pages = 1;
......@@ -5334,6 +5388,28 @@ dict_table_replace_index_in_foreign_list(
foreign->foreign_index = new_index;
}
}
for (foreign = UT_LIST_GET_FIRST(table->referenced_list);
foreign;
foreign = UT_LIST_GET_NEXT(referenced_list, foreign)) {
dict_index_t* new_index;
if (foreign->referenced_index == index) {
ut_ad(foreign->referenced_table == index->table);
new_index = dict_foreign_find_index(
foreign->referenced_table,
foreign->referenced_col_names,
foreign->n_fields, index,
/*check_charsets=*/TRUE, /*check_null=*/FALSE);
ut_ad(new_index || !trx->check_foreigns);
ut_ad(!new_index || new_index->table == index->table);
foreign->referenced_index = new_index;
}
}
}
/**********************************************************************//**
......
......@@ -165,7 +165,7 @@ dict_print(void)
monitor printout */
mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */
srv_fatal_semaphore_wait_threshold += SRV_SEMAPHORE_WAIT_EXTENSION;
mutex_exit(&kernel_mutex);
mutex_enter(&(dict_sys->mutex));
......@@ -193,7 +193,7 @@ loop:
/* Restore the fatal semaphore wait timeout */
mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */
srv_fatal_semaphore_wait_threshold -= SRV_SEMAPHORE_WAIT_EXTENSION;
mutex_exit(&kernel_mutex);
return;
......@@ -430,7 +430,7 @@ loop:
object and check that the .ibd file exists. */
fil_open_single_table_tablespace(FALSE, space_id,
flags, name);
flags, name, NULL);
}
mem_free(name);
......@@ -1023,7 +1023,7 @@ err_exit:
if (!fil_open_single_table_tablespace(
TRUE, space,
flags == DICT_TF_COMPACT ? 0 :
flags & ~(~0 << DICT_TF_BITS), name)) {
flags & ~(~0 << DICT_TF_BITS), name, NULL)) {
/* We failed to find a sensible
tablespace file */
......
......@@ -183,7 +183,7 @@ struct fil_space_struct {
.ibd file of tablespace and want to
stop temporarily posting of new i/o
requests on the file */
ibool stop_ibuf_merges;
ibool stop_new_ops;
/*!< we set this TRUE when we start
deleting a single-table tablespace */
ibool is_being_deleted;
......@@ -208,12 +208,13 @@ struct fil_space_struct {
ulint n_pending_flushes; /*!< this is positive when flushing
the tablespace to disk; dropping of the
tablespace is forbidden if this is positive */
ulint n_pending_ibuf_merges;/*!< this is positive
when merging insert buffer entries to
a page so that we may need to access
the ibuf bitmap page in the
tablespade: dropping of the tablespace
is forbidden if this is positive */
ulint n_pending_ops;/*!< this is positive when we
have pending operations against this
tablespace. The pending operations can
be ibuf merges or lock validation code
trying to read a block.
Dropping of the tablespace is forbidden
if this is positive */
hash_node_t hash; /*!< hash chain node */
hash_node_t name_hash;/*!< hash chain the name_hash table */
#ifndef UNIV_HOTBACKUP
......@@ -928,11 +929,6 @@ retry:
return;
}
if (fil_system->n_open < fil_system->max_n_open) {
return;
}
space = fil_space_get_by_id(space_id);
if (space != NULL && space->stop_ios) {
......@@ -949,6 +945,25 @@ retry:
mutex_exit(&fil_system->mutex);
#ifndef UNIV_HOTBACKUP
/* Wake the i/o-handler threads to make sure pending
i/o's are performed */
os_aio_simulated_wake_handler_threads();
/* The sleep here is just to give IO helper threads a
bit of time to do some work. It is not required that
all IO related to the tablespace being renamed must
be flushed here as we do fil_flush() in
fil_rename_tablespace() as well. */
os_thread_sleep(20000);
#endif /* UNIV_HOTBACKUP */
/* Flush tablespaces so that we can close modified
files in the LRU list */
fil_flush_file_spaces(FIL_TABLESPACE);
os_thread_sleep(20000);
count2++;
......@@ -956,6 +971,11 @@ retry:
goto retry;
}
if (fil_system->n_open < fil_system->max_n_open) {
return;
}
/* If the file is already open, no need to do anything; if the space
does not exist, we handle the situation in the function which called
this function */
......@@ -1228,7 +1248,7 @@ try_again:
}
space->stop_ios = FALSE;
space->stop_ibuf_merges = FALSE;
space->stop_new_ops = FALSE;
space->is_being_deleted = FALSE;
space->purpose = purpose;
space->size = 0;
......@@ -1237,7 +1257,7 @@ try_again:
space->n_reserved_extents = 0;
space->n_pending_flushes = 0;
space->n_pending_ibuf_merges = 0;
space->n_pending_ops = 0;
UT_LIST_INIT(space->chain);
space->magic_n = FIL_SPACE_MAGIC_N;
......@@ -1840,13 +1860,12 @@ fil_read_flushed_lsn_and_arch_log_no(
#ifndef UNIV_HOTBACKUP
/*******************************************************************//**
Increments the count of pending insert buffer page merges, if space is not
being deleted.
@return TRUE if being deleted, and ibuf merges should be skipped */
Increments the count of pending operation, if space is not being deleted.
@return TRUE if being deleted, and operation should be skipped */
UNIV_INTERN
ibool
fil_inc_pending_ibuf_merges(
/*========================*/
fil_inc_pending_ops(
/*================*/
ulint id) /*!< in: space id */
{
fil_space_t* space;
......@@ -1857,18 +1876,18 @@ fil_inc_pending_ibuf_merges(
if (space == NULL) {
fprintf(stderr,
"InnoDB: Error: trying to do ibuf merge to a"
"InnoDB: Error: trying to do an operation on a"
" dropped tablespace %lu\n",
(ulong) id);
}
if (space == NULL || space->stop_ibuf_merges) {
if (space == NULL || space->stop_new_ops) {
mutex_exit(&fil_system->mutex);
return(TRUE);
}
space->n_pending_ibuf_merges++;
space->n_pending_ops++;
mutex_exit(&fil_system->mutex);
......@@ -1876,11 +1895,11 @@ fil_inc_pending_ibuf_merges(
}
/*******************************************************************//**
Decrements the count of pending insert buffer page merges. */
Decrements the count of pending operations. */
UNIV_INTERN
void
fil_decr_pending_ibuf_merges(
/*=========================*/
fil_decr_pending_ops(
/*=================*/
ulint id) /*!< in: space id */
{
fil_space_t* space;
......@@ -1891,13 +1910,13 @@ fil_decr_pending_ibuf_merges(
if (space == NULL) {
fprintf(stderr,
"InnoDB: Error: decrementing ibuf merge of a"
" dropped tablespace %lu\n",
"InnoDB: Error: decrementing pending operation"
" of a dropped tablespace %lu\n",
(ulong) id);
}
if (space != NULL) {
space->n_pending_ibuf_merges--;
space->n_pending_ops--;
}
mutex_exit(&fil_system->mutex);
......@@ -2187,15 +2206,15 @@ fil_delete_tablespace(
char* path;
ut_a(id != 0);
stop_ibuf_merges:
stop_new_ops:
mutex_enter(&fil_system->mutex);
space = fil_space_get_by_id(id);
if (space != NULL) {
space->stop_ibuf_merges = TRUE;
space->stop_new_ops = TRUE;
if (space->n_pending_ibuf_merges == 0) {
if (space->n_pending_ops == 0) {
mutex_exit(&fil_system->mutex);
count = 0;
......@@ -2209,9 +2228,10 @@ stop_ibuf_merges:
ut_print_filename(stderr, space->name);
fprintf(stderr, ",\n"
"InnoDB: but there are %lu pending"
" ibuf merges on it.\n"
" operations (most likely ibuf merges)"
" on it.\n"
"InnoDB: Loop %lu.\n",
(ulong) space->n_pending_ibuf_merges,
(ulong) space->n_pending_ops,
(ulong) count);
}
......@@ -2220,7 +2240,7 @@ stop_ibuf_merges:
os_thread_sleep(20000);
count++;
goto stop_ibuf_merges;
goto stop_new_ops;
}
}
......@@ -2246,7 +2266,7 @@ try_again:
}
ut_a(space);
ut_a(space->n_pending_ibuf_merges == 0);
ut_a(space->n_pending_ops == 0);
space->is_being_deleted = TRUE;
......@@ -2523,7 +2543,7 @@ fil_rename_tablespace(
retry:
count++;
if (count > 1000) {
if (!(count % 1000)) {
ut_print_timestamp(stderr);
fputs(" InnoDB: Warning: problems renaming ", stderr);
ut_print_filename(stderr, old_name);
......@@ -3124,8 +3144,11 @@ fil_open_single_table_tablespace(
accessing the first page of the file */
ulint id, /*!< in: space id */
ulint flags, /*!< in: tablespace flags */
const char* name) /*!< in: table name in the
const char* name, /*!< in: table name in the
databasename/tablename format */
trx_t* trx) /*!< in: transaction. This is only used
for IMPORT TABLESPACE, must be NULL
otherwise */
{
os_file_t file;
char* filepath;
......@@ -3342,11 +3365,17 @@ skip_info:
/* over write space id of all pages */
rec_offs_init(offsets_);
/* Unlock the data dictionary to not block queries
accessing other tables */
ut_a(trx);
row_mysql_unlock_data_dictionary(trx);
fprintf(stderr, "InnoDB: Progress in %%:");
for (offset = 0; offset < free_limit_bytes;
offset += zip_size ? zip_size : UNIV_PAGE_SIZE) {
ibool page_is_corrupt;
ibool is_descr_page = FALSE;
success = os_file_read(file, page,
(ulint)(offset & 0xFFFFFFFFUL),
......@@ -3385,6 +3414,7 @@ skip_info:
/* store as descr page */
memcpy(descr_page, page, (zip_size ? zip_size : UNIV_PAGE_SIZE));
is_descr_page = TRUE;
} else if (descr_is_corrupt) {
/* unknown state of the page */
......@@ -3461,7 +3491,8 @@ skip_info:
}
}
if (fil_page_get_type(page) == FIL_PAGE_INDEX) {
if (fil_page_get_type(page) ==
FIL_PAGE_INDEX && !is_descr_page) {
dulint tmp = mach_read_from_8(page + (PAGE_HEADER + PAGE_INDEX_ID));
for (i = 0; i < n_index; i++) {
......@@ -3543,6 +3574,9 @@ skip_write:
fprintf(stderr, " done.\n");
/* Reacquire the data dictionary lock */
row_mysql_lock_data_dictionary(trx);
/* update SYS_INDEXES set root page */
index = dict_table_get_first_index(table);
while (index) {
......@@ -3678,7 +3712,6 @@ func_exit:
ulint page_no;
ulint zip_size;
ulint height;
ulint root_height = 0;
rec_t* node_ptr;
dict_table_t* table;
dict_index_t* index;
......@@ -3717,7 +3750,6 @@ func_exit:
if (height == ULINT_UNDEFINED) {
height = btr_page_get_level(page, &mtr);
root_height = height;
}
if (height == 0) {
......@@ -3837,7 +3869,7 @@ convert_err_exit:
level = btr_page_get_level(page, &mtr);
new_block = btr_page_alloc(index, 0, FSP_NO_DIR, level, &mtr);
new_block = btr_page_alloc(index, 0, FSP_NO_DIR, level, &mtr, &mtr);
new_page = buf_block_get_frame(new_block);
new_page_zip = buf_block_get_page_zip(new_block);
btr_page_create(new_block, new_page_zip, index, level, &mtr);
......@@ -3885,7 +3917,7 @@ convert_err_exit:
split_rec = page_get_middle_rec(page);
new_block = btr_page_alloc(index, page_no + 1, FSP_UP,
btr_page_get_level(page, &mtr), &mtr);
btr_page_get_level(page, &mtr), &mtr, &mtr);
new_page = buf_block_get_frame(new_block);
new_page_zip = buf_block_get_page_zip(new_block);
btr_page_create(new_block, new_page_zip, index,
......
This diff is collapsed.
/*****************************************************************************
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -88,40 +88,6 @@ ha_create_func(
return(table);
}
/*************************************************************//**
Empties a hash table and frees the memory heaps. */
UNIV_INTERN
void
ha_clear(
/*=====*/
hash_table_t* table) /*!< in, own: hash table */
{
ulint i;
ulint n;
ut_ad(table);
ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&btr_search_latch, RW_LOCK_EXCLUSIVE));
#endif /* UNIV_SYNC_DEBUG */
#ifndef UNIV_HOTBACKUP
/* Free the memory heaps. */
n = table->n_mutexes;
for (i = 0; i < n; i++) {
mem_heap_free(table->heaps[i]);
}
#endif /* !UNIV_HOTBACKUP */
/* Clear the hash table. */
n = hash_get_n_cells(table);
for (i = 0; i < n; i++) {
hash_get_nth_cell(table, i)->node = NULL;
}
}
/*************************************************************//**
Inserts an entry into a hash table. If an entry with the same fold number
is found, its node is updated to point to the new data, and no new node
......@@ -140,7 +106,7 @@ ha_insert_for_fold_func(
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
buf_block_t* block, /*!< in: buffer block containing the data */
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
void* data) /*!< in: data, must not be NULL */
const rec_t* data) /*!< in: data, must not be NULL */
{
hash_cell_t* cell;
ha_node_t* node;
......@@ -153,7 +119,11 @@ ha_insert_for_fold_func(
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
ut_a(block->frame == page_align(data));
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&btr_search_latch, RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
ASSERT_HASH_MUTEX_OWN(table, fold);
ut_ad(btr_search_enabled);
hash = hash_calc_hash(fold, table);
......@@ -173,7 +143,6 @@ ha_insert_for_fold_func(
prev_block->n_pointers--;
block->n_pointers++;
}
ut_ad(!btr_search_fully_disabled);
# endif /* !UNIV_HOTBACKUP */
prev_node->block = block;
......@@ -186,13 +155,6 @@ ha_insert_for_fold_func(
prev_node = prev_node->next;
}
/* We are in the process of disabling hash index, do not add
new chain node */
if (!btr_search_enabled) {
ut_ad(!btr_search_fully_disabled);
return(TRUE);
}
/* We have to allocate a new chain node */
node = mem_heap_alloc(hash_get_heap(table, fold), sizeof(ha_node_t));
......@@ -250,6 +212,10 @@ ha_delete_hash_node(
{
ut_ad(table);
ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&btr_search_latch, RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
ut_ad(btr_search_enabled);
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
if (table->adaptive) {
......@@ -272,11 +238,11 @@ ha_search_and_update_if_found_func(
/*===============================*/
hash_table_t* table, /*!< in/out: hash table */
ulint fold, /*!< in: folded value of the searched data */
void* data, /*!< in: pointer to the data */
const rec_t* data, /*!< in: pointer to the data */
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
buf_block_t* new_block,/*!< in: block containing new_data */
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
void* new_data)/*!< in: new pointer to the data */
const rec_t* new_data)/*!< in: new pointer to the data */
{
ha_node_t* node;
......@@ -286,6 +252,13 @@ ha_search_and_update_if_found_func(
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
ut_a(new_block->frame == page_align(new_data));
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&btr_search_latch, RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
if (!btr_search_enabled) {
return;
}
node = ha_search_with_data(table, fold, data);
......@@ -322,6 +295,10 @@ ha_remove_all_nodes_to_page(
ut_ad(table);
ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
ASSERT_HASH_MUTEX_OWN(table, fold);
#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&btr_search_latch, RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
ut_ad(btr_search_enabled);
node = ha_chain_get_first(table, fold);
......
This diff is collapsed.
......@@ -133,9 +133,11 @@ class ha_innobase: public handler
const key_map* keys_to_use_for_scanning();
int open(const char *name, int mode, uint test_if_locked);
handler* clone(const char *name, MEM_ROOT *mem_root);
int close(void);
double scan_time();
double read_time(uint index, uint ranges, ha_rows rows);
my_bool is_fake_change_enabled(THD *thd);
bool is_corrupt() const;
int write_row(uchar * buf);
......
/*****************************************************************************
Copyright (c) 2005, 2010, Innobase Oy. All Rights Reserved.
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
......@@ -668,6 +668,10 @@ ha_innobase::add_index(
DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
}
if (innodb_table->tablespace_discarded) {
DBUG_RETURN(-1);
}
/* Check that index keys are sensible */
error = innobase_check_index_keys(key_info, num_of_keys, innodb_table);
......@@ -823,6 +827,8 @@ ha_innobase::add_index(
innodb_table, indexed_table,
index, num_of_idx, table);
DBUG_EXECUTE_IF("crash_innodb_add_index_after", DBUG_SUICIDE(););
error_handling:
/* After an error, remove all those index definitions from the
dictionary which were defined. */
......@@ -1024,7 +1030,9 @@ ha_innobase::prepare_drop_index(
goto func_exit;
}
rw_lock_x_lock(dict_index_get_lock(index));
index->to_be_dropped = TRUE;
rw_lock_x_unlock(dict_index_get_lock(index));
}
/* If FOREIGN_KEY_CHECKS = 1 you may not drop an index defined
......@@ -1143,7 +1151,9 @@ func_exit:
= dict_table_get_first_index(prebuilt->table);
do {
rw_lock_x_lock(dict_index_get_lock(index));
index->to_be_dropped = FALSE;
rw_lock_x_unlock(dict_index_get_lock(index));
index = dict_table_get_next_index(index);
} while (index);
}
......@@ -1209,7 +1219,9 @@ ha_innobase::final_drop_index(
for (index = dict_table_get_first_index(prebuilt->table);
index; index = dict_table_get_next_index(index)) {
rw_lock_x_lock(dict_index_get_lock(index));
index->to_be_dropped = FALSE;
rw_lock_x_unlock(dict_index_get_lock(index));
}
goto func_exit;
......
This diff is collapsed.
......@@ -36,7 +36,6 @@ extern struct st_mysql_plugin i_s_innodb_cmp;
extern struct st_mysql_plugin i_s_innodb_cmp_reset;
extern struct st_mysql_plugin i_s_innodb_cmpmem;
extern struct st_mysql_plugin i_s_innodb_cmpmem_reset;
extern struct st_mysql_plugin i_s_innodb_patches;
extern struct st_mysql_plugin i_s_innodb_rseg;
extern struct st_mysql_plugin i_s_innodb_table_stats;
extern struct st_mysql_plugin i_s_innodb_index_stats;
......@@ -44,5 +43,9 @@ extern struct st_mysql_plugin i_s_innodb_admin_command;
extern struct st_mysql_plugin i_s_innodb_sys_tables;
extern struct st_mysql_plugin i_s_innodb_sys_indexes;
extern struct st_mysql_plugin i_s_innodb_sys_stats;
extern struct st_mysql_plugin i_s_innodb_changed_pages;
extern struct st_mysql_plugin i_s_innodb_buffer_page;
extern struct st_mysql_plugin i_s_innodb_buffer_page_lru;
extern struct st_mysql_plugin i_s_innodb_buffer_stats;
#endif /* i_s_h */
/* Copyright (C) 2002-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
struct innodb_enhancement {
const char *file;
const char *name;
const char *comment;
const char *link;
}innodb_enhancements[] = {
{"xtradb_show_enhancements","I_S.XTRADB_ENHANCEMENTS","","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_show_status","Improvements to SHOW INNODB STATUS","Memory information and lock info fixes","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_io","Improvements to InnoDB IO","","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_opt_lru_count","Fix of buffer_pool mutex","Decreases contention on buffer_pool mutex on LRU operations","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_buffer_pool_pages","Information of buffer pool content","","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_expand_undo_slots","expandable maximum number of undo slots","from 1024 (default) to about 4000","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_extra_rseg","allow to create extra rollback segments","When create new db, the new parameter allows to create more rollback segments","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_overwrite_relay_log_info","overwrite relay-log.info when slave recovery","Building as plugin, it is not used.","http://www.percona.com/docs/wiki/percona-xtradb:innodb_overwrite_relay_log_info"},
{"innodb_thread_concurrency_timer_based","use InnoDB timer based concurrency throttling (backport from MySQL 5.4.0)","",""},
{"innodb_expand_import","convert .ibd file automatically when import tablespace","the files are generated by xtrabackup export mode.","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_dict_size_limit","Limit dictionary cache size","Variable innodb_dict_size_limit in bytes","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_split_buf_pool_mutex","More fix of buffer_pool mutex","Spliting buf_pool_mutex and optimizing based on innodb_opt_lru_count","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_stats","Additional features about InnoDB statistics/optimizer","","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_recovery_patches","Bugfixes and adjustments about recovery process","","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_purge_thread","Enable to use purge devoted thread","","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_admin_command_base","XtraDB specific command interface through i_s","","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_show_lock_name","Show mutex/lock name instead of crated file/line","","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_extend_slow","Extended statistics in slow.log","It is InnoDB-part only. It needs to patch also to mysqld.","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_lru_dump_restore","Dump and restore command for content of buffer pool","","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_separate_doublewrite","Add option 'innodb_doublewrite_file' to separate doublewrite dedicated tablespace","","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_pass_corrupt_table","Treat tables as corrupt instead of crash, when meet corrupt blocks","","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_fast_checksum","Using the checksum on 32bit-unit calculation","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_files_extend","allow >4GB transaction log files, and can vary universal page size of datafiles","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_sys_tables_sys_indexes","Expose InnoDB SYS_TABLES and SYS_INDEXES schema tables","","http://www.percona.com/docs/wiki/percona-xtradb"},
{NULL, NULL, NULL, NULL}
};
This diff is collapsed.
/*****************************************************************************
Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
*****************************************************************************/
......@@ -188,26 +188,45 @@ btr_block_get_func(
ulint mode, /*!< in: latch mode */
const char* file, /*!< in: file name */
ulint line, /*!< in: line where called */
mtr_t* mtr) /*!< in/out: mtr */
__attribute__((nonnull));
# ifdef UNIV_SYNC_DEBUG
const dict_index_t* index, /*!< in: index tree, may be NULL
if it is not an insert buffer tree */
# endif /* UNIV_SYNC_DEBUG */
mtr_t* mtr); /*!< in/out: mini-transaction */
# ifdef UNIV_SYNC_DEBUG
/** Gets a buffer page and declares its latching order level.
@param space tablespace identifier
@param zip_size compressed page size in bytes or 0 for uncompressed pages
@param page_no page number
@param mode latch mode
@param index index tree, may be NULL if not the insert buffer tree
@param mtr mini-transaction handle
@return the block descriptor */
# define btr_block_get(space,zip_size,page_no,mode,mtr) \
# define btr_block_get(space,zip_size,page_no,mode,index,mtr) \
btr_block_get_func(space,zip_size,page_no,mode, \
__FILE__,__LINE__,index,mtr)
# else /* UNIV_SYNC_DEBUG */
/** Gets a buffer page and declares its latching order level.
@param space tablespace identifier
@param zip_size compressed page size in bytes or 0 for uncompressed pages
@param page_no page number
@param mode latch mode
@param idx index tree, may be NULL if not the insert buffer tree
@param mtr mini-transaction handle
@return the block descriptor */
# define btr_block_get(space,zip_size,page_no,mode,idx,mtr) \
btr_block_get_func(space,zip_size,page_no,mode,__FILE__,__LINE__,mtr)
# endif /* UNIV_SYNC_DEBUG */
/** Gets a buffer page and declares its latching order level.
@param space tablespace identifier
@param zip_size compressed page size in bytes or 0 for uncompressed pages
@param page_no page number
@param mode latch mode
@param idx index tree, may be NULL if not the insert buffer tree
@param mtr mini-transaction handle
@return the uncompressed page frame */
# define btr_page_get(space,zip_size,page_no,mode,mtr) \
buf_block_get_frame(btr_block_get(space,zip_size,page_no,mode,mtr))
# define btr_page_get(space,zip_size,page_no,mode,idx,mtr) \
buf_block_get_frame(btr_block_get(space,zip_size,page_no,mode,idx,mtr))
/**************************************************************//**
Sets the index id field of a page. */
UNIV_INLINE
......@@ -378,8 +397,7 @@ btr_free_root(
ulint zip_size, /*!< in: compressed page size in bytes
or 0 for uncompressed pages */
ulint root_page_no, /*!< in: root page number */
mtr_t* mtr); /*!< in: a mini-transaction which has already
been started */
mtr_t* mtr); /*!< in/out: mini-transaction */
/*************************************************************//**
Makes tree one level higher by splitting the root, and inserts
the tuple. It is assumed that mtr contains an x-latch on the tree.
......@@ -588,17 +606,23 @@ btr_parse_page_reorganize(
#ifndef UNIV_HOTBACKUP
/**************************************************************//**
Gets the number of pages in a B-tree.
@return number of pages */
@return number of pages, or ULINT_UNDEFINED if the index is unavailable */
UNIV_INTERN
ulint
btr_get_size(
/*=========*/
dict_index_t* index, /*!< in: index */
ulint flag); /*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */
ulint flag, /*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */
mtr_t* mtr) /*!< in/out: mini-transaction where index
is s-latched */
__attribute__((nonnull, warn_unused_result));
/**************************************************************//**
Allocates a new file page to be used in an index tree. NOTE: we assume
that the caller has made the reservation for free extents!
@return new allocated block, x-latched; NULL if out of space */
@retval NULL if no page could be allocated
@retval block, rw_lock_x_lock_count(&block->lock) == 1 if allocation succeeded
(init_mtr == mtr, or the page was not previously freed in mtr)
@retval block (not allocated or initialized) otherwise */
UNIV_INTERN
buf_block_t*
btr_page_alloc(
......@@ -609,7 +633,12 @@ btr_page_alloc(
page split is made */
ulint level, /*!< in: level where the page is placed
in the tree */
mtr_t* mtr); /*!< in: mtr */
mtr_t* mtr, /*!< in/out: mini-transaction
for the allocation */
mtr_t* init_mtr) /*!< in/out: mini-transaction
for x-latching and initializing
the page */
__attribute__((nonnull, warn_unused_result));
/**************************************************************//**
Frees a file page used in an index tree. NOTE: cannot free field external
storage pages because the page must contain info on its level. */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -97,6 +97,8 @@ enum db_err {
DB_FOREIGN_EXCEED_MAX_CASCADE, /* Foreign key constraint related
cascading delete/update exceeds
maximum allowed depth */
DB_TABLE_IN_FK_CHECK, /* table is being used in foreign
key check */
/* The following are partial failure codes */
DB_FAIL = 1000,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment