summaryrefslogtreecommitdiff
path: root/storage/innobase/include
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/include')
-rw-r--r--storage/innobase/include/buf0buf.h11
-rw-r--r--storage/innobase/include/buf0buf.ic6
-rw-r--r--storage/innobase/include/buf0dblwr.h7
-rw-r--r--storage/innobase/include/db0err.h2
-rw-r--r--storage/innobase/include/fil0fil.h28
-rw-r--r--storage/innobase/include/lock0lock.h15
-rw-r--r--storage/innobase/include/log0recv.h8
-rw-r--r--storage/innobase/include/os0sync.h4
-rw-r--r--storage/innobase/include/os0sync.ic6
-rw-r--r--storage/innobase/include/row0log.h13
-rw-r--r--storage/innobase/include/sync0rw.ic33
-rw-r--r--storage/innobase/include/sync0sync.ic6
-rw-r--r--storage/innobase/include/univ.i2
-rw-r--r--storage/innobase/include/ut0ut.h15
14 files changed, 110 insertions, 46 deletions
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index e49bc837b75..351bf5a26db 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
@@ -654,6 +654,15 @@ buf_page_is_corrupted(
ulint zip_size) /*!< in: size of compressed page;
0 for uncompressed pages */
__attribute__((nonnull, warn_unused_result));
+/********************************************************************//**
+Checks if a page is all zeroes.
+@return TRUE if the page is all zeroes */
+bool
+buf_page_is_zeroes(
+/*===============*/
+ const byte* read_buf, /*!< in: a database page */
+ const ulint zip_size); /*!< in: size of compressed page;
+ 0 for uncompressed pages */
#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Gets the space id, page offset, and byte offset within page of a
diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic
index 85868ad9f0e..b15a7fb11b6 100644
--- a/storage/innobase/include/buf0buf.ic
+++ b/storage/innobase/include/buf0buf.ic
@@ -405,8 +405,8 @@ buf_block_set_file_page(
ulint page_no)/*!< in: page number */
{
buf_block_set_state(block, BUF_BLOCK_FILE_PAGE);
- block->page.space = space;
- block->page.offset = page_no;
+ block->page.space = static_cast<ib_uint32_t>(space);
+ block->page.offset = static_cast<ib_uint32_t>(page_no);
}
/*********************************************************************//**
@@ -627,7 +627,7 @@ buf_page_set_accessed(
if (bpage->access_time == 0) {
/* Make this the time of the first access. */
- bpage->access_time = ut_time_ms();
+ bpage->access_time = static_cast<uint>(ut_time_ms());
}
}
diff --git a/storage/innobase/include/buf0dblwr.h b/storage/innobase/include/buf0dblwr.h
index 740286d0a82..a62a6400d97 100644
--- a/storage/innobase/include/buf0dblwr.h
+++ b/storage/innobase/include/buf0dblwr.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2014, 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
@@ -52,11 +52,12 @@ we already have a doublewrite buffer created in the data files. If we are
upgrading to an InnoDB version which supports multiple tablespaces, then this
function performs the necessary update operations. If we are in a crash
recovery, this function loads the pages from double write buffer into memory. */
-UNIV_INTERN
void
buf_dblwr_init_or_load_pages(
/*=========================*/
- bool load_corrupt_pages);
+ os_file_t file,
+ char* path,
+ bool load_corrupt_pages);
/****************************************************************//**
Process the double write buffer pages. */
diff --git a/storage/innobase/include/db0err.h b/storage/innobase/include/db0err.h
index 982bf1943cf..71916cb33f2 100644
--- a/storage/innobase/include/db0err.h
+++ b/storage/innobase/include/db0err.h
@@ -128,6 +128,8 @@ enum dberr_t {
DB_FTS_EXCEED_RESULT_CACHE_LIMIT, /*!< FTS query memory
exceeds result cache limit */
DB_TEMP_FILE_WRITE_FAILURE, /*!< Temp file write failure */
+ DB_FTS_TOO_MANY_WORDS_IN_PHRASE,
+ /*< Too many words in a phrase */
/* The following are partial failure codes */
DB_FAIL = 1000,
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index 5d56bd0b4b8..e1f938dbf32 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
@@ -182,6 +182,20 @@ extern ulint fil_n_pending_tablespace_flushes;
/** Number of files currently open */
extern ulint fil_n_file_opened;
+struct fsp_open_info {
+ ibool success; /*!< Has the tablespace been opened? */
+ const char* check_msg; /*!< fil_check_first_page() message */
+ ibool valid; /*!< Is the tablespace valid? */
+ os_file_t file; /*!< File handle */
+ char* filepath; /*!< File path to open */
+ lsn_t lsn; /*!< Flushed LSN from header page */
+ ulint id; /*!< Space ID */
+ ulint flags; /*!< Tablespace flags */
+#ifdef UNIV_LOG_ARCHIVE
+ ulint arch_log_no; /*!< latest archived log file number */
+#endif /* UNIV_LOG_ARCHIVE */
+};
+
#ifndef UNIV_HOTBACKUP
/*******************************************************************//**
Returns the version number of a tablespace, -1 if not found.
@@ -999,6 +1013,18 @@ fil_mtr_rename_log(
mtr_t* mtr) /*!< in/out: mini-transaction */
__attribute__((nonnull));
+/*******************************************************************//**
+Finds the given page_no of the given space id from the double write buffer,
+and copies it to the corresponding .ibd file.
+@return true if copy was successful, or false. */
+bool
+fil_user_tablespace_restore_page(
+/*==============================*/
+ fsp_open_info* fsp, /* in: contains space id and .ibd
+ file information */
+ ulint page_no); /* in: page_no to obtain from double
+ write buffer */
+
#endif /* !UNIV_INNOCHECKSUM */
/****************************************************************//**
diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h
index 2c8bff47952..6d5ed35d5d8 100644
--- a/storage/innobase/include/lock0lock.h
+++ b/storage/innobase/include/lock0lock.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2014, 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
@@ -892,22 +892,15 @@ lock_trx_has_rec_x_lock(
remains set when the waiting lock is granted,
or if the lock is inherited to a neighboring
record */
-#define LOCK_CONV_BY_OTHER 4096 /*!< this bit is set when the lock is created
- by other transaction */
-#if (LOCK_WAIT|LOCK_GAP|LOCK_REC_NOT_GAP|LOCK_INSERT_INTENTION|LOCK_CONV_BY_OTHER)&LOCK_MODE_MASK
+
+#if (LOCK_WAIT|LOCK_GAP|LOCK_REC_NOT_GAP|LOCK_INSERT_INTENTION)&LOCK_MODE_MASK
# error
#endif
-#if (LOCK_WAIT|LOCK_GAP|LOCK_REC_NOT_GAP|LOCK_INSERT_INTENTION|LOCK_CONV_BY_OTHER)&LOCK_TYPE_MASK
+#if (LOCK_WAIT|LOCK_GAP|LOCK_REC_NOT_GAP|LOCK_INSERT_INTENTION)&LOCK_TYPE_MASK
# error
#endif
/* @} */
-/** Checks if this is a waiting lock created by lock->trx itself.
-@param type_mode lock->type_mode
-@return whether it is a waiting lock belonging to lock->trx */
-#define lock_is_wait_not_by_other(type_mode) \
- ((type_mode & (LOCK_CONV_BY_OTHER | LOCK_WAIT)) == LOCK_WAIT)
-
/** Lock operation struct */
struct lock_op_t{
dict_table_t* table; /*!< table to be locked */
diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h
index b94f5a6fcec..8ede49d4ecc 100644
--- a/storage/innobase/include/log0recv.h
+++ b/storage/innobase/include/log0recv.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2014, 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
@@ -371,9 +371,13 @@ struct recv_addr_t{
struct recv_dblwr_t {
void add(byte* page);
- byte* find_first_page(ulint space_id);
+ byte* find_page(ulint space_id, ulint page_no);
std::list<byte *> pages; /* Pages from double write buffer */
+
+ void operator() () {
+ pages.clear();
+ }
};
/** Recovery system data structure */
diff --git a/storage/innobase/include/os0sync.h b/storage/innobase/include/os0sync.h
index ea3f2a06db5..9b4ce2343c5 100644
--- a/storage/innobase/include/os0sync.h
+++ b/storage/innobase/include/os0sync.h
@@ -598,7 +598,7 @@ amount of increment. */
(win_xchg_and_add(ptr, amount) + amount)
# define os_atomic_increment_uint32(ptr, amount) \
- ((ulint) _InterlockedExchangeAdd((long*) ptr, amount))
+ ((ulint) InterlockedExchangeAdd((long*) ptr, amount))
# define os_atomic_increment_ulint(ptr, amount) \
((ulint) (win_xchg_and_add((lint*) ptr, (lint) amount) + amount))
@@ -613,7 +613,7 @@ Returns the resulting value, ptr is pointer to target, amount is the
amount to decrement. There is no atomic substract function on Windows */
# define os_atomic_decrement_uint32(ptr, amount) \
- ((ulint) _InterlockedExchangeAdd((long*) ptr, (-amount)))
+ ((ulint) InterlockedExchangeAdd((long*) ptr, (-amount)))
# define os_atomic_decrement_lint(ptr, amount) \
(win_xchg_and_add(ptr, -(lint) amount) - amount)
diff --git a/storage/innobase/include/os0sync.ic b/storage/innobase/include/os0sync.ic
index 33c238ceb47..9a7e520ece6 100644
--- a/storage/innobase/include/os0sync.ic
+++ b/storage/innobase/include/os0sync.ic
@@ -112,8 +112,10 @@ pfs_os_fast_mutex_lock(
PSI_mutex_locker* locker;
PSI_mutex_locker_state state;
- locker = PSI_MUTEX_CALL(start_mutex_wait)(&state, fast_mutex->pfs_psi,
- PSI_MUTEX_LOCK, file_name, line);
+ locker = PSI_MUTEX_CALL(start_mutex_wait)(
+ &state, fast_mutex->pfs_psi,
+ PSI_MUTEX_LOCK, file_name,
+ static_cast<uint>(line));
os_fast_mutex_lock_func(&fast_mutex->mutex);
diff --git a/storage/innobase/include/row0log.h b/storage/innobase/include/row0log.h
index 41dac63963d..62715fe8808 100644
--- a/storage/innobase/include/row0log.h
+++ b/storage/innobase/include/row0log.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 2014, 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
@@ -122,10 +122,9 @@ row_log_table_delete(
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */
- bool purge, /*!< in: true=purging BLOBs */
- trx_id_t trx_id) /*!< in: DB_TRX_ID of the record before
- it was deleted */
- UNIV_COLD __attribute__((nonnull));
+ const byte* sys) /*!< in: DB_TRX_ID,DB_ROLL_PTR that should
+ be logged, or NULL to use those in rec */
+ UNIV_COLD __attribute__((nonnull(1,2,3)));
/******************************************************//**
Logs an update operation to a table that is being rebuilt.
@@ -158,8 +157,10 @@ row_log_table_get_pk(
or X-latched */
const ulint* offsets,/*!< in: rec_get_offsets(rec,index),
or NULL */
+ byte* sys, /*!< out: DB_TRX_ID,DB_ROLL_PTR for
+ row_log_table_delete(), or NULL */
mem_heap_t** heap) /*!< in/out: memory heap where allocated */
- UNIV_COLD __attribute__((nonnull(1,2,4), warn_unused_result));
+ UNIV_COLD __attribute__((nonnull(1,2,5), warn_unused_result));
/******************************************************//**
Logs an insert to a table that is being rebuilt.
diff --git a/storage/innobase/include/sync0rw.ic b/storage/innobase/include/sync0rw.ic
index 1ddae5e6c58..467a8b4eb44 100644
--- a/storage/innobase/include/sync0rw.ic
+++ b/storage/innobase/include/sync0rw.ic
@@ -581,12 +581,15 @@ pfs_rw_lock_x_lock_func(
/* Record the entry of rw x lock request in performance schema */
locker = PSI_RWLOCK_CALL(start_rwlock_wrwait)(
- &state, lock->pfs_psi, PSI_RWLOCK_WRITELOCK, file_name, line);
+ &state, lock->pfs_psi, PSI_RWLOCK_WRITELOCK,
+ file_name, static_cast<uint>(line));
- rw_lock_x_lock_func(lock, pass, file_name, line);
+ rw_lock_x_lock_func(
+ lock, pass, file_name, static_cast<uint>(line));
- if (locker != NULL)
+ if (locker != NULL) {
PSI_RWLOCK_CALL(end_rwlock_wrwait)(locker, 0);
+ }
}
else
{
@@ -617,12 +620,15 @@ pfs_rw_lock_x_lock_func_nowait(
/* Record the entry of rw x lock request in performance schema */
locker = PSI_RWLOCK_CALL(start_rwlock_wrwait)(
- &state, lock->pfs_psi, PSI_RWLOCK_WRITELOCK, file_name, line);
+ &state, lock->pfs_psi, PSI_RWLOCK_WRITELOCK,
+ file_name, static_cast<uint>(line));
ret = rw_lock_x_lock_func_nowait(lock, file_name, line);
- if (locker != NULL)
- PSI_RWLOCK_CALL(end_rwlock_wrwait)(locker, ret);
+ if (locker != NULL) {
+ PSI_RWLOCK_CALL(end_rwlock_wrwait)(
+ locker, static_cast<int>(ret));
+ }
}
else
{
@@ -672,12 +678,14 @@ pfs_rw_lock_s_lock_func(
/* Instrumented to inform we are aquiring a shared rwlock */
locker = PSI_RWLOCK_CALL(start_rwlock_rdwait)(
- &state, lock->pfs_psi, PSI_RWLOCK_READLOCK, file_name, line);
+ &state, lock->pfs_psi, PSI_RWLOCK_READLOCK,
+ file_name, static_cast<uint>(line));
rw_lock_s_lock_func(lock, pass, file_name, line);
- if (locker != NULL)
+ if (locker != NULL) {
PSI_RWLOCK_CALL(end_rwlock_rdwait)(locker, 0);
+ }
}
else
{
@@ -711,12 +719,15 @@ pfs_rw_lock_s_lock_low(
/* Instrumented to inform we are aquiring a shared rwlock */
locker = PSI_RWLOCK_CALL(start_rwlock_rdwait)(
- &state, lock->pfs_psi, PSI_RWLOCK_READLOCK, file_name, line);
+ &state, lock->pfs_psi, PSI_RWLOCK_READLOCK,
+ file_name, static_cast<uint>(line));
ret = rw_lock_s_lock_low(lock, pass, file_name, line);
- if (locker != NULL)
- PSI_RWLOCK_CALL(end_rwlock_rdwait)(locker, ret);
+ if (locker != NULL) {
+ PSI_RWLOCK_CALL(end_rwlock_rdwait)(
+ locker, static_cast<int>(ret));
+ }
}
else
{
diff --git a/storage/innobase/include/sync0sync.ic b/storage/innobase/include/sync0sync.ic
index ad77ad6d5a4..cb375cb4a4f 100644
--- a/storage/innobase/include/sync0sync.ic
+++ b/storage/innobase/include/sync0sync.ic
@@ -240,7 +240,8 @@ pfs_mutex_enter_func(
locker = PSI_MUTEX_CALL(start_mutex_wait)(
&state, mutex->pfs_psi,
- PSI_MUTEX_LOCK, file_name, line);
+ PSI_MUTEX_LOCK, file_name,
+ static_cast<uint>(line));
mutex_enter_func(mutex, file_name, line);
@@ -275,7 +276,8 @@ pfs_mutex_enter_nowait_func(
locker = PSI_MUTEX_CALL(start_mutex_wait)(
&state, mutex->pfs_psi,
- PSI_MUTEX_TRYLOCK, file_name, line);
+ PSI_MUTEX_TRYLOCK, file_name,
+ static_cast<uint>(line));
ret = mutex_enter_nowait_func(mutex, file_name, line);
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index e6240549d96..3105a1fc0ce 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -44,7 +44,7 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 5
#define INNODB_VERSION_MINOR 6
-#define INNODB_VERSION_BUGFIX 16
+#define INNODB_VERSION_BUGFIX 17
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h
index 1260e0381bf..7d1c3cd4f0b 100644
--- a/storage/innobase/include/ut0ut.h
+++ b/storage/innobase/include/ut0ut.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2014, 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
@@ -51,6 +51,19 @@ Created 1/20/1994 Heikki Tuuri
/** Time stamp */
typedef time_t ib_time_t;
+/* In order to call a piece of code, when a function returns or when the
+scope ends, use this utility class. It will invoke the given function
+object in its destructor. */
+template<typename F>
+struct ut_when_dtor {
+ ut_when_dtor(F& p) : f(p) {}
+ ~ut_when_dtor() {
+ f();
+ }
+private:
+ F& f;
+};
+
#ifndef UNIV_HOTBACKUP
# if defined(HAVE_PAUSE_INSTRUCTION)
/* According to the gcc info page, asm volatile means that the