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 Mar 25, 2019
2 parents f03f4da + 72b934e commit c3a6c68
Show file tree
Hide file tree
Showing 24 changed files with 129 additions and 109 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ ENDIF()

MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}")

SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${CMAKE_SOURCE_DIR}/cmake ${CMAKE_SOURCE_DIR}/cmake/Internal/CPack)

# Use a default manufacturer if no manufacturer was identified.
IF(NOT DEFINED MANUFACTURER)
Expand Down
6 changes: 5 additions & 1 deletion cmake/CPackRPM.cmake → cmake/Internal/CPack/CPackRPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ endif()
# load the original CPackRPM.cmake
set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
unset(CMAKE_MODULE_PATH)
include(CPackRPM)
if (CMAKE_VERSION VERSION_GREATER "3.12.99")
include(Internal/CPack/CPackRPM)
else()
include(CPackRPM)
endif()
set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH})

restore(LICENSE)
Expand Down
4 changes: 1 addition & 3 deletions cmake/build_configurations/mysql_release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ IF(FEATURE_SET)
ENDIF()

SET(WITH_INNODB_SNAPPY OFF CACHE STRING "")
SET(WITH_NUMA 0 CACHE BOOL "")
IF(WIN32)
SET(INSTALL_MYSQLTESTDIR "" CACHE STRING "")
SET(INSTALL_SQLBENCHDIR "" CACHE STRING "")
Expand All @@ -96,18 +97,15 @@ ELSEIF(RPM)
SET(WITH_ZLIB system CACHE STRING "")
SET(CHECKMODULE /usr/bin/checkmodule CACHE STRING "")
SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE STRING "")
SET(WITH_LIBARCHIVE ON CACHE STRING "")
ELSEIF(DEB)
SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB system CACHE STRING "")
SET(WITH_LIBWRAP ON)
SET(HAVE_EMBEDDED_PRIVILEGE_CONTROL ON)
SET(WITH_LIBARCHIVE ON CACHE STRING "")
ELSE()
SET(WITH_SSL bundled CACHE STRING "")
SET(WITH_ZLIB bundled CACHE STRING "")
SET(WITH_JEMALLOC static CACHE STRING "")
SET(WITH_LIBARCHIVE STATIC CACHE STRING "")
ENDIF()

IF(NOT COMPILATION_COMMENT)
Expand Down
16 changes: 8 additions & 8 deletions mysql-test/main/default.result
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ drop table t1;
#
create table t1 (a int);
create or replace table t1 (a int default b, b int default a);
ERROR 01000: Expression for field `a` is refering to uninitialized field `b`
ERROR 01000: Expression for field `a` is referring to uninitialized field `b`
show create table t1;
ERROR 42S02: Table 'test.t1' doesn't exist
#
Expand All @@ -451,16 +451,16 @@ create or replace table t1 (a varchar(128) default @@version);
create or replace table t1 (a int not null, b int as (a));
create or replace table t1 (a int not null, b int default (a+1));
create or replace table t1 (a int default a);
ERROR 01000: Expression for field `a` is refering to uninitialized field `a`
ERROR 01000: Expression for field `a` is referring to uninitialized field `a`
create or replace table t1 (a int default b, b int default (1+1));
create or replace table t1 (a int default 1, b int as (c), c int as (a+1));
ERROR 01000: Expression for field `b` is refering to uninitialized field `c`
ERROR 01000: Expression for field `b` is referring to uninitialized field `c`
CREATE TABLE t1 (a INT DEFAULT (DEFAULT(a)));
ERROR 01000: Expression for field `a` is refering to uninitialized field `a`
ERROR 01000: Expression for field `a` is referring to uninitialized field `a`
CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)), b INT DEFAULT(DEFAULT(a)));
ERROR 01000: Expression for field `a` is refering to uninitialized field `b`
ERROR 01000: Expression for field `a` is referring to uninitialized field `b`
CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)) NOT NULL, b INT DEFAULT(DEFAULT(a)) NOT NULL);
ERROR 01000: Expression for field `a` is refering to uninitialized field `b`
ERROR 01000: Expression for field `a` is referring to uninitialized field `b`
#
# Allow defaults to refer to not default fields
#
Expand Down Expand Up @@ -519,7 +519,7 @@ Got one of the listed errors
CREATE TABLE t1 (a INT DEFAULT(?));
Got one of the listed errors
CREATE TABLE t1 (a INT DEFAULT (b), b INT DEFAULT(a));
ERROR 01000: Expression for field `a` is refering to uninitialized field `b`
ERROR 01000: Expression for field `a` is referring to uninitialized field `b`
CREATE TABLE t1 (a INT DEFAULT(NAME_CONST('xxx', 'yyy'));
ERROR HY000: Function or expression 'name_const()' cannot be used in the DEFAULT clause of `a`
CREATE TABLE t1 (a INT DEFAULT COUNT(*));
Expand Down Expand Up @@ -3369,7 +3369,7 @@ a b t
4 5 5 the value of the DEFAULT(a), that is b
drop table t1;
create table t1 (col1 int default(-(default(col1))));
ERROR 01000: Expression for field `col1` is refering to uninitialized field `col1`
ERROR 01000: Expression for field `col1` is referring to uninitialized field `col1`
create table t1 (col int default (yearweek((exp(710)))));
ERROR 22003: DOUBLE value is out of range in 'exp(710)'
#
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ a b c
4 -4 -3
drop table t1;
create table t1 (a int, b int generated always as(-b) virtual, c int generated always as (b + 1) virtual);
ERROR 01000: Expression for field `b` is refering to uninitialized field `b`
ERROR 01000: Expression for field `b` is referring to uninitialized field `b`
create table t1 (a int, b int generated always as(-c) virtual, c int generated always as (b + 1) virtual);
ERROR 01000: Expression for field `b` is refering to uninitialized field `c`
ERROR 01000: Expression for field `b` is referring to uninitialized field `c`
create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) stored, col_int_key int);
ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the GENERATED ALWAYS AS clause of `pk`
# Bug#20339347: FAIL TO USE CREATE ....SELECT STATEMENT TO CREATE A NEW TABLE
Expand All @@ -277,7 +277,7 @@ drop table t1,tt;
# THD->CHANGE_LIST.IS_EMPTY()
#
CREATE TABLE t1(a bigint AS (a between 1 and 1));
ERROR 01000: Expression for field `a` is refering to uninitialized field `a`
ERROR 01000: Expression for field `a` is referring to uninitialized field `a`
# Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES
# IN FIND_FIELD_IN_TABLE
#
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ a b c
4 -4 -3
drop table t1;
create table t1 (a int, b int generated always as(-b) virtual, c int generated always as (b + 1) virtual);
ERROR 01000: Expression for field `b` is refering to uninitialized field `b`
ERROR 01000: Expression for field `b` is referring to uninitialized field `b`
create table t1 (a int, b int generated always as(-c) virtual, c int generated always as (b + 1) virtual);
ERROR 01000: Expression for field `b` is refering to uninitialized field `c`
ERROR 01000: Expression for field `b` is referring to uninitialized field `c`
create table t1 (pk int auto_increment primary key, col_int_nokey int generated always as (pk + col_int_key) stored, col_int_key int);
ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the GENERATED ALWAYS AS clause of `pk`
# Bug#20339347: FAIL TO USE CREATE ....SELECT STATEMENT TO CREATE A NEW TABLE
Expand All @@ -277,7 +277,7 @@ drop table t1,tt;
# THD->CHANGE_LIST.IS_EMPTY()
#
CREATE TABLE t1(a bigint AS (a between 1 and 1));
ERROR 01000: Expression for field `a` is refering to uninitialized field `a`
ERROR 01000: Expression for field `a` is referring to uninitialized field `a`
# Bug#20757211: GENERATED COLUMNS: ALTER TABLE CRASHES
# IN FIND_FIELD_IN_TABLE
#
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/vcol/r/vcol_misc.result
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ drop table t1;
# MDEV-5611: self-referencing virtual column
#
create table t1 (a int, b int as (b is null) virtual);
ERROR 01000: Expression for field `b` is refering to uninitialized field `b`
ERROR 01000: Expression for field `b` is referring to uninitialized field `b`
create table t1 (a int as (1+1), b int as (a is null) virtual);
drop table t1;
# end of 5.3 tests
Expand Down
2 changes: 1 addition & 1 deletion sql/item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ bool Item_field::register_field_in_write_map(void *arg)
}

/**
Check that we are not refering to any not yet initialized fields
Check that we are not referring to any not yet initialized fields
Fields are initialized in this order:
- All fields that have default value as a constant are initialized first.
Expand Down
2 changes: 1 addition & 1 deletion sql/share/errmsg-utf8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7623,7 +7623,7 @@ ER_ERROR_EVALUATING_EXPRESSION
ER_CALCULATING_DEFAULT_VALUE
eng "Got an error when calculating default value for %`s"
ER_EXPRESSION_REFERS_TO_UNINIT_FIELD 01000
eng "Expression for field %`-.64s is refering to uninitialized field %`s"
eng "Expression for field %`-.64s is referring to uninitialized field %`s"
ER_PARTITION_DEFAULT_ERROR
eng "Only one DEFAULT partition allowed"
ukr "Припустимо мати тільки один DEFAULT розділ"
Expand Down
2 changes: 1 addition & 1 deletion sql/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
if (check_constraint_ptr)
*check_constraint_ptr= 0;

/* Check that expressions aren't refering to not yet initialized fields */
/* Check that expressions aren't referring to not yet initialized fields */
for (field_ptr= table->field; *field_ptr; field_ptr++)
{
Field *field= *field_ptr;
Expand Down
38 changes: 23 additions & 15 deletions storage/innobase/btr/btr0btr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2014, 2018, MariaDB Corporation.
Copyright (c) 2014, 2019, MariaDB Corporation.
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
Expand Down Expand Up @@ -378,8 +378,7 @@ btr_root_adjust_on_import(
page = buf_block_get_frame(block);
page_zip = buf_block_get_page_zip(block);

if (!page_is_root(page)) {

if (!fil_page_index_page_check(page) || page_has_siblings(page)) {
err = DB_CORRUPTION;

} else if (dict_index_is_clust(index)) {
Expand Down Expand Up @@ -1161,11 +1160,11 @@ btr_free_root_check(
buf_block_dbg_add_level(block, SYNC_TREE_NODE);

if (fil_page_index_page_check(block->frame)
&& index_id == btr_page_get_index_id(block->frame)) {
&& index_id == btr_page_get_index_id(block->frame)) {
/* This should be a root page.
It should not be possible to reassign the same
index_id for some other index in the tablespace. */
ut_ad(page_is_root(block->frame));
ut_ad(!page_has_siblings(block->frame));
} else {
block = NULL;
}
Expand Down Expand Up @@ -1356,7 +1355,8 @@ btr_free_but_not_root(
ibool finished;
mtr_t mtr;

ut_ad(page_is_root(block->frame));
ut_ad(fil_page_index_page_check(block->frame));
ut_ad(!page_has_siblings(block->frame));
leaf_loop:
mtr_start(&mtr);
mtr_set_log_mode(&mtr, log_mode);
Expand Down Expand Up @@ -1427,7 +1427,6 @@ btr_free_if_exists(
return;
}

ut_ad(page_is_root(root->frame));
btr_free_but_not_root(root, mtr->get_log_mode());
mtr->set_named_space_id(page_id.space());
btr_free_root(root, mtr);
Expand All @@ -1450,8 +1449,6 @@ btr_free(
page_id, page_size, RW_X_LATCH, &mtr);

if (block) {
ut_ad(page_is_root(block->frame));

btr_free_but_not_root(block, MTR_LOG_NO_REDO);
btr_free_root(block, &mtr);
}
Expand Down Expand Up @@ -1598,12 +1595,17 @@ btr_page_reorganize_low(

ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
btr_assert_not_corrupted(block, index);
ut_ad(fil_page_index_page_check(block->frame));
ut_ad(index->is_dummy
|| block->page.id.space() == index->table->space->id);
ut_ad(index->is_dummy
|| block->page.id.page_no() != index->page
|| !page_has_siblings(page));
#ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
data_size1 = page_get_data_size(page);
max_ins_size1 = page_get_max_insert_size_after_reorganize(page, 1);

/* Turn logging off */
mtr_log_t log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE);

Expand Down Expand Up @@ -1661,7 +1663,7 @@ btr_page_reorganize_low(
|| page_get_max_trx_id(page) == 0
|| (dict_index_is_sec_or_ibuf(index)
? page_is_leaf(temp_page)
: page_is_root(temp_page)));
: block->page.id.page_no() == index->page));

/* If innodb_log_compressed_pages is ON, page reorganize should log the
compressed page image.*/
Expand Down Expand Up @@ -1731,7 +1733,7 @@ btr_page_reorganize_low(
ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */

if (!recovery && page_is_root(temp_page)
if (!recovery && block->page.id.page_no() == index->page
&& fil_page_get_type(temp_page) == FIL_PAGE_TYPE_INSTANT) {
/* Preserve the PAGE_INSTANT information. */
ut_ad(!page_zip);
Expand Down Expand Up @@ -1904,6 +1906,8 @@ btr_page_empty(

ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
ut_ad(page_zip == buf_block_get_page_zip(block));
ut_ad(!index->is_dummy);
ut_ad(index->table->space->id == block->page.id.space());
#ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
Expand All @@ -1916,7 +1920,8 @@ btr_page_empty(
/* Preserve PAGE_ROOT_AUTO_INC when creating a clustered index
root page. */
const ib_uint64_t autoinc
= dict_index_is_clust(index) && page_is_root(page)
= dict_index_is_clust(index)
&& index->page == block->page.id.page_no()
? page_get_autoinc(page)
: 0;

Expand Down Expand Up @@ -4233,6 +4238,8 @@ btr_discard_only_page_on_level(
ulint page_level = 0;
trx_id_t max_trx_id;

ut_ad(!index->is_dummy);

/* Save the PAGE_MAX_TRX_ID from the leaf page. */
max_trx_id = page_get_max_trx_id(buf_block_get_frame(block));

Expand All @@ -4244,7 +4251,8 @@ btr_discard_only_page_on_level(
ut_a(page_get_n_recs(page) == 1);
ut_a(page_level == btr_page_get_level(page));
ut_a(!page_has_siblings(page));

ut_ad(fil_page_index_page_check(page));
ut_ad(block->page.id.space() == index->table->space->id);
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
btr_search_drop_page_hash_index(block);

Expand All @@ -4271,7 +4279,7 @@ btr_discard_only_page_on_level(

/* block is the root page, which must be empty, except
for the node pointer to the (now discarded) block(s). */
ut_ad(page_is_root(block->frame));
ut_ad(!page_has_siblings(block->frame));

#ifdef UNIV_BTR_DEBUG
if (!dict_index_is_ibuf(index)) {
Expand Down
18 changes: 12 additions & 6 deletions storage/innobase/btr/btr0cur.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Copyright (c) 1994, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2015, 2018, MariaDB Corporation.
Copyright (c) 2015, 2019, MariaDB Corporation.

Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
Expand Down Expand Up @@ -557,7 +557,11 @@ index root page.
@return whether the page is corrupted */
bool btr_cur_instant_root_init(dict_index_t* index, const page_t* page)
{
ut_ad(page_is_root(page));
ut_ad(!index->is_dummy);
ut_ad(fil_page_index_page_check(page));
ut_ad(!page_has_siblings(page));
ut_ad(page_get_space_id(page) == index->table->space_id);
ut_ad(page_get_page_no(page) == index->page);
ut_ad(!page_is_comp(page) == !dict_table_is_comp(index->table));
ut_ad(index->is_primary());
ut_ad(!index->is_instant());
Expand Down Expand Up @@ -5441,22 +5445,22 @@ btr_cur_optimistic_delete_func(
ut_ad(flags == 0 || flags == BTR_CREATE_FLAG);
ut_ad(mtr_memo_contains(mtr, btr_cur_get_block(cursor),
MTR_MEMO_PAGE_X_FIX));
ut_ad(mtr_memo_contains(mtr, btr_cur_get_block(cursor),
MTR_MEMO_PAGE_X_FIX));
ut_ad(mtr->is_named_space(cursor->index->table->space));
ut_ad(!cursor->index->is_dummy);

/* This is intended only for leaf page deletions */

block = btr_cur_get_block(cursor);

ut_ad(block->page.id.space() == cursor->index->table->space->id);
ut_ad(page_is_leaf(buf_block_get_frame(block)));
ut_ad(!dict_index_is_online_ddl(cursor->index)
|| dict_index_is_clust(cursor->index)
|| (flags & BTR_CREATE_FLAG));

rec = btr_cur_get_rec(cursor);

if (UNIV_UNLIKELY(page_is_root(block->frame)
if (UNIV_UNLIKELY(block->page.id.page_no() == cursor->index->page
&& page_get_n_recs(block->frame) == 1
+ (cursor->index->is_instant()
&& !rec_is_metadata(rec, cursor->index)))) {
Expand Down Expand Up @@ -5635,6 +5639,8 @@ btr_cur_pessimistic_delete(
| MTR_MEMO_SX_LOCK));
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
ut_ad(mtr->is_named_space(index->table->space));
ut_ad(!index->is_dummy);
ut_ad(block->page.id.space() == index->table->space->id);

if (!has_reserved_extents) {
/* First reserve enough free space for the file segments
Expand Down Expand Up @@ -5688,7 +5694,7 @@ btr_cur_pessimistic_delete(
lock_update_delete(block, rec);
}

if (!page_is_root(page)) {
if (block->page.id.page_no() != index->page) {
if (page_get_n_recs(page) < 2) {
goto discard_page;
}
Expand Down
Loading

0 comments on commit c3a6c68

Please sign in to comment.