Skip to content

Commit

Permalink
Merge 10.2 into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Dec 30, 2016
2 parents 86209c7 + b727213 commit f5148fa
Show file tree
Hide file tree
Showing 118 changed files with 1,479 additions and 4,022 deletions.
8 changes: 8 additions & 0 deletions mysql-test/suite/innodb/r/log_data_file_size.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SET GLOBAL innodb_file_per_table=0;
CREATE TABLE t(a INT)ENGINE=InnoDB;
SET GLOBAL innodb_file_per_table=1;
CREATE TABLE ibd4(a INT UNIQUE)ENGINE=InnoDB;
CREATE TABLE ibd4f(a INT UNIQUE)ENGINE=InnoDB;
CREATE TABLE ibd5(a INT UNIQUE, b INT UNIQUE)ENGINE=InnoDB;
# Kill the server
DROP TABLE t,ibd4,ibd4f,ibd5;
2 changes: 2 additions & 0 deletions mysql-test/suite/innodb/t/log_data_file_size.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--loose-innodb-sys-indexes
--innodb-data-file-path=ibdata1:1M:autoextend
65 changes: 65 additions & 0 deletions mysql-test/suite/innodb/t/log_data_file_size.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
--source include/have_innodb.inc
--source include/not_embedded.inc

let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
let MYSQLD_DATADIR=`select @@datadir`;
let MYSQLD_IS_DEBUG=`select version() like '%debug%'`;
--source include/no_checkpoint_start.inc
SET GLOBAL innodb_file_per_table=0;
CREATE TABLE t(a INT)ENGINE=InnoDB;
let INNODB_ROOT_PAGE= `SELECT page_no FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE name='GEN_CLUST_INDEX'`;
SET GLOBAL innodb_file_per_table=1;

CREATE TABLE ibd4(a INT UNIQUE)ENGINE=InnoDB;
CREATE TABLE ibd4f(a INT UNIQUE)ENGINE=InnoDB;
CREATE TABLE ibd5(a INT UNIQUE, b INT UNIQUE)ENGINE=InnoDB;

let $drop_tables= DROP TABLE t,ibd4,ibd4f,ibd5;
--let CLEANUP_IF_CHECKPOINT= $drop_tables;
--source ../include/no_checkpoint_end.inc

perl;
use Fcntl 'SEEK_CUR', 'SEEK_END';

my $page_size = $ENV{'INNODB_PAGE_SIZE'};
my $restart = 'restart';
if ($ENV{'MYSQLD_IS_DEBUG'})
{
# It is impractical to ensure that CREATE TABLE t will extend ibdata1.
# We rely on innodb_system_tablespace_extend_debug=1
# to recover from this fault injection if no size change was redo-logged.
my $root = $ENV{'INNODB_ROOT_PAGE'};
open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}ibdata1") or die;
my $size = sysseek(FILE, 0, SEEK_END) / $page_size;
seek(FILE, $page_size * ($root + 1), SEEK_SET) or die;
my $empty_tail= 1;
while(<FILE>) { unless (/\0*/gso) { $empty_tail= 0; last } }
if ($empty_tail)
{
$restart = 'restart: --innodb-data-file-size-debug=' . $size;
truncate(FILE, $page_size * $root);
}
close FILE;
}
open(FILE, ">$ENV{MYSQLTEST_VARDIR}/log/start_mysqld.txt") || die;
print FILE '--exec echo "', $restart, '" > $_expect_file_name
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
';
close FILE;
open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}test/ibd4.ibd") or die;
truncate(FILE, $page_size * 4);
close FILE;
open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}test/ibd4f.ibd") or die;
truncate(FILE, $page_size * 4 + 1234);
close FILE;
open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}test/ibd5.ibd") or die;
truncate(FILE, $page_size * 5);
close FILE;
EOF

--source $MYSQLTEST_VARDIR/log/start_mysqld.txt
--remove_file $MYSQLTEST_VARDIR/log/start_mysqld.txt

eval $drop_tables;
28 changes: 28 additions & 0 deletions mysql-test/suite/sys_vars/r/sysvars_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,20 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_DATA_FILE_SIZE_DEBUG
SESSION_VALUE NULL
GLOBAL_VALUE 0
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT InnoDB system tablespace size to be set in recovery.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_DATA_HOME_DIR
SESSION_VALUE NULL
GLOBAL_VALUE
Expand Down Expand Up @@ -2581,6 +2595,20 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_USE_FALLOCATE
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Use posix_fallocate() to allocate files. DEPRECATED, has no effect.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_USE_MTFLUSH
SESSION_VALUE NULL
GLOBAL_VALUE OFF
Expand Down
31 changes: 0 additions & 31 deletions storage/innobase/btr/btr0btr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Created 6/2/1994 Heikki Tuuri
#include "page0zip.h"
#include "gis0rtree.h"

#ifndef UNIV_HOTBACKUP
#include "btr0cur.h"
#include "btr0sea.h"
#include "btr0pcur.h"
Expand All @@ -64,8 +63,6 @@ btr_can_merge_with_page(
buf_block_t** merge_block, /*!< out: the merge block */
mtr_t* mtr); /*!< in: mini-transaction */

#endif /* UNIV_HOTBACKUP */

/**************************************************************//**
Report that an index page is corrupted. */
void
Expand All @@ -80,7 +77,6 @@ btr_corruption_report(
<< " of table " << index->table->name;
}

#ifndef UNIV_HOTBACKUP
/*
Latching strategy of the InnoDB B-tree
--------------------------------------
Expand Down Expand Up @@ -174,7 +170,6 @@ btr_root_block_get(
buf_block_t* block = btr_block_get(page_id, page_size, mode,
index, mtr);


if (!block) {
if (index && index->table) {
index->table->is_encrypted = TRUE;
Expand Down Expand Up @@ -1526,7 +1521,6 @@ btr_write_autoinc(dict_index_t* index, ib_uint64_t autoinc, bool reset)
fil_space_release(space);
}
}
#endif /* !UNIV_HOTBACKUP */

/*************************************************************//**
Reorganizes an index page.
Expand Down Expand Up @@ -1554,9 +1548,7 @@ btr_page_reorganize_low(
mtr_t* mtr) /*!< in/out: mini-transaction */
{
buf_block_t* block = page_cur_get_block(cursor);
#ifndef UNIV_HOTBACKUP
buf_pool_t* buf_pool = buf_pool_from_bpage(&block->page);
#endif /* !UNIV_HOTBACKUP */
page_t* page = buf_block_get_frame(block);
page_zip_des_t* page_zip = buf_block_get_page_zip(block);
buf_block_t* temp_block;
Expand All @@ -1581,12 +1573,7 @@ btr_page_reorganize_low(
/* Turn logging off */
mtr_log_t log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE);

#ifndef UNIV_HOTBACKUP
temp_block = buf_block_alloc(buf_pool);
#else /* !UNIV_HOTBACKUP */
ut_ad(block == back_block1);
temp_block = back_block2;
#endif /* !UNIV_HOTBACKUP */
temp_page = temp_block->frame;

MONITOR_INC(MONITOR_INDEX_REORG_ATTEMPTS);
Expand All @@ -1599,11 +1586,9 @@ btr_page_reorganize_low(
/* Copy the old page to temporary space */
buf_frame_copy(temp_page, page);

#ifndef UNIV_HOTBACKUP
if (!recovery) {
btr_search_drop_page_hash_index(block);
}
#endif /* !UNIV_HOTBACKUP */

/* Save the cursor position. */
pos = page_rec_get_n_recs_before(page_cur_get_rec(cursor));
Expand Down Expand Up @@ -1678,12 +1663,10 @@ btr_page_reorganize_low(
goto func_exit;
}

#ifndef UNIV_HOTBACKUP
if (!recovery && !dict_table_is_locking_disabled(index->table)) {
/* Update the record lock bitmaps */
lock_move_reorganize_page(block, temp_block);
}
#endif /* !UNIV_HOTBACKUP */

data_size2 = page_get_data_size(page);
max_ins_size2 = page_get_max_insert_size_after_reorganize(page, 1);
Expand Down Expand Up @@ -1712,14 +1695,11 @@ btr_page_reorganize_low(
#ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
#ifndef UNIV_HOTBACKUP
buf_block_free(temp_block);
#endif /* !UNIV_HOTBACKUP */

/* Restore logging mode */
mtr_set_log_mode(mtr, log_mode);

#ifndef UNIV_HOTBACKUP
if (success) {
mlog_id_t type;
byte* log_ptr;
Expand Down Expand Up @@ -1748,7 +1728,6 @@ btr_page_reorganize_low(

MONITOR_INC(MONITOR_INDEX_REORG_SUCCESSFUL);
}
#endif /* !UNIV_HOTBACKUP */

return(success);
}
Expand Down Expand Up @@ -1784,7 +1763,6 @@ btr_page_reorganize_block(
return(btr_page_reorganize_low(recovery, z_level, &cur, index, mtr));
}

#ifndef UNIV_HOTBACKUP
/*************************************************************//**
Reorganizes an index page.
Expand All @@ -1806,7 +1784,6 @@ btr_page_reorganize(
return(btr_page_reorganize_low(false, page_zip_level,
cursor, index, mtr));
}
#endif /* !UNIV_HOTBACKUP */

/***********************************************************//**
Parses a redo log record of reorganizing a page.
Expand Down Expand Up @@ -1850,7 +1827,6 @@ btr_parse_page_reorganize(
return(ptr);
}

#ifndef UNIV_HOTBACKUP
/*************************************************************//**
Empties an index page. @see btr_page_create(). */
static
Expand Down Expand Up @@ -3345,9 +3321,6 @@ btr_set_min_rec_mark_log(
/* Write rec offset as a 2-byte ulint */
mlog_catenate_ulint(mtr, page_offset(rec), MLOG_2BYTES);
}
#else /* !UNIV_HOTBACKUP */
# define btr_set_min_rec_mark_log(rec,comp,mtr) ((void) 0)
#endif /* !UNIV_HOTBACKUP */

/****************************************************************//**
Parses the redo log record for setting an index record as the predefined
Expand Down Expand Up @@ -3405,7 +3378,6 @@ btr_set_min_rec_mark(
}
}

#ifndef UNIV_HOTBACKUP
/*************************************************************//**
Deletes on the upper level the node pointer to a page. */
void
Expand Down Expand Up @@ -5497,7 +5469,6 @@ btr_can_merge_with_page(
goto error;
}


max_ins_size = page_get_max_insert_size(mpage, n_recs);

if (data_size > max_ins_size) {
Expand Down Expand Up @@ -5531,5 +5502,3 @@ btr_can_merge_with_page(
*merge_block = NULL;
DBUG_RETURN(false);
}

#endif /* !UNIV_HOTBACKUP */

0 comments on commit f5148fa

Please sign in to comment.