From a794db9ade4d6e2d7802c84b05dcc25bb40ed681 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 22 Mar 2019 13:29:06 +0100 Subject: [PATCH 1/9] cmake: remove unused variable --- cmake/build_configurations/mysql_release.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index 65ae04fcab1..657fa7eefed 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -96,18 +96,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) From 07c3e902100a92351977fc6fe08c3233ef92218c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 17 Mar 2019 17:18:46 +0100 Subject: [PATCH 2/9] MDEV-18954 numa dynamic dependency don't link with libnuma in release builds --- cmake/build_configurations/mysql_release.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index 657fa7eefed..7753366add3 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -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 "") From 2d6e627a9f5f5d901dc02161d4cca8a6e72c0116 Mon Sep 17 00:00:00 2001 From: Chris Calender Date: Thu, 7 Feb 2019 01:23:28 -0500 Subject: [PATCH 3/9] Fix for MDEV-18276, typo in error message + all other occurrences of refering --- mysql-test/r/default.result | 16 ++++++++-------- .../gcol/r/gcol_column_def_options_innodb.result | 6 +++--- .../gcol/r/gcol_column_def_options_myisam.result | 6 +++--- mysql-test/suite/vcol/r/vcol_misc.result | 2 +- sql/item.cc | 2 +- sql/share/errmsg-utf8.txt | 2 +- sql/table.cc | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result index 8fa88066f7c..c2de5a578f1 100644 --- a/mysql-test/r/default.result +++ b/mysql-test/r/default.result @@ -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 # @@ -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 # @@ -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(*)); @@ -3378,7 +3378,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)' # diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result index e93d3bf025a..3bc5348b20a 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_innodb.result @@ -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 @@ -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 # diff --git a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result index 563883adce0..56d048f1d7a 100644 --- a/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_column_def_options_myisam.result @@ -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 @@ -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 # diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 62ae344365c..1de5fe8a0c1 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -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 diff --git a/sql/item.cc b/sql/item.cc index 6c605dba776..f7092eb6c86 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1006,7 +1006,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. diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 8e54fa10ac5..333d7ee93ac 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -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 розділ" diff --git a/sql/table.cc b/sql/table.cc index 7c5410aed84..2cf21c889e2 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1129,7 +1129,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; From 0e56eba9d510a92bc6344987502ed023b55e9dbe Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Fri, 22 Mar 2019 20:46:09 +0200 Subject: [PATCH 4/9] Updated list of unstable tests for 10.2.23 --- mysql-test/unstable-tests | 117 ++++++++++++++++++++++---------------- 1 file changed, 68 insertions(+), 49 deletions(-) diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index 798294d7db1..290daa54671 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,27 +23,28 @@ # ############################################################################## -# Based on 10.2 65f22b8fd44c08ea190ed473b7e12b666b1fe60d +# Based on bb-10.2-release 07c3e902100a92351977fc6fe08c3233ef92218c main.alter_table : Modified in 10.2.22 main.alter_table_errors : Modified in 10.2.22 main.alter_table_trans : MDEV-12084 - timeout +main.analyze_stmt : Modified in 10.2.23 main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result main.auth_named_pipe : MDEV-14724 - System error 2 -main.bigint : Modified in 10.2.20 main.check : Modified in 10.2.22 -main.check_constraint : Modified in 10.2.22 +main.check_constraint : Modified in 10.2.23 main.check_constraint_innodb : Modified in 10.2.22 main.connect : MDEV-17282 - Wrong result; modified in 10.2.22 main.connect2 : MDEV-13885 - Server crash main.count_distinct2 : MDEV-11768 - timeout main.create_delayed : MDEV-10605 - failed with timeout main.create_drop_event : MDEV-16271 - Wrong result -main.cte_recursive : Modified in 10.2.20 +main.create_drop_role : Modified in 10.2.23 main.ctype_ucs : MDEV-17681 - Data too long for column main.ctype_upgrade : MDEV-16945 - Error upon mysql_upgrade main.ctype_utf16 : MDEV-10675: timeout or extra warnings main.debug_sync : MDEV-10607 - internal error +main.derived_cond_pushdown : Modified in 10.2.23 main.derived_opt : MDEV-11768 - timeout main.distinct : MDEV-14194 - Crash main.drop_bad_db_type : MDEV-15676 - Wrong result @@ -52,22 +53,26 @@ main.events_2 : MDEV-13277 - Crash main.events_bugs : MDEV-12892 - Crash main.events_restart : MDEV-12236 - Server shutdown problem main.events_slowlog : MDEV-12821 - Wrong result -main.func_default : Modified in 10.2.20 main.func_group_innodb : Modified in 10.2.22 +main.func_json : Modified in 10.2.23 +main.func_math : Modified in 10.2.23 main.func_misc : Modified in 10.2.22 -main.func_time : Modified in 10.2.20 +main.func_str : Modified in 10.2.23 +main.func_time : Modified in 10.2.23 main.gis : MDEV-13411 - wrong result on P8; modified in 10.2.22 -main.grant5 : Modified in 10.2.20 +main.gis-loaddata : Added in 10.2.23 main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown main.huge_frm-6224 : Modified in 10.2.22 main.index_intersect_innodb : MDEV-10643 - failed with timeout main.index_merge_innodb : MDEV-7142 - Plan mismatch -main.information_schema : Modified in 10.2.20 main.information_schema-big : Modified in 10.2.22 main.innodb_mysql_lock : MDEV-7861 - Wrong result main.kill-2 : MDEV-13257 - Wrong result main.kill_processlist-6619 : MDEV-10793 - Wrong result -main.log_slow : MDEV-13263 - Wrong result +main.loaddata : Modified in 10.2.23 +main.loadxml : Modified in 10.2.23 +main.log_slow : MDEV-13263 - Wrong result; modified in 10.2.23 +main.log_slow_debug : Added in 10.2.23 main.log_tables-big : MDEV-13408 - wrong result main.lowercase_table : Modified in 10.2.22 main.mdev-504 : MDEV-15171 - warning @@ -79,6 +84,7 @@ main.mysql_client_test_nonblock : CONC-208 - Error on Power; MDEV-15096 - exe main.mysql_upgrade_noengine : MDEV-14355 - Wrong result main.mysql_upgrade_ssl : MDEV-13492 - Unknown SSL error main.mysqlbinlog_row_minimal : Modified in 10.2.22 +main.mysqld--help : Modified in 10.2.23 main.mysqld_option_err : Modified in 10.2.22 main.mysqldump : MDEV-14800 - Stack smashing detected; modified in 10.2.22 main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug @@ -87,15 +93,13 @@ main.mysqltest : MDEV-9269 - fails on Alpha; MDEV-13887 - Wr main.openssl_1 : MDEV-13492 - Unknown SSL error; modified in 10.2.22 main.openssl_6975 : MDEV-17184 - Failures with OpenSSL 1.1.1 main.order_by_optimizer_innodb : MDEV-10683 - Wrong result -main.partition : Modified in 10.2.20 -main.partition_alter : Modified in 10.2.20 +main.partition : Modified in 10.2.23 main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock -main.partition_innodb : Modified in 10.2.20 main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings main.ps : MDEV-11017 - Wrong result -main.ps_error : Added in 10.2.20 main.range_innodb : Modified in 10.2.22 main.read_only : Modified in 10.2.22 +main.reopen_temp_table : Modified in 10.2.23 main.reset_connection : Modified in 10.2.22 main.row-checksum : Modified in 10.2.22 main.query_cache : MDEV-16180 - Wrong result @@ -104,30 +108,37 @@ main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away main.set_statement : MDEV-13183 - Wrong result main.shm : MDEV-12727 - Mismatch, ERROR 2013 main.show_explain : MDEV-10674 - Wrong result code -main.sp : MDEV-7866 - Mismatch -main.sp_notembedded : MDEV-10607 - internal error +main.show_explain_ps : Modified in 10.2.23 +main.sp : MDEV-7866 - Mismatch; modified in 10.2.23 +main.sp_notembedded : MDEV-10607 - internal error; modified in 10.2.23 main.sp-security : MDEV-10607 - sporadic "can't connect" +main.sp_trans : Modified in 10.2.23 +main.sp-ucs2 : Modified in 10.2.23 main.ssl : MDEV-17184 - Failures with OpenSSL 1.1.1; modified in 10.2.22 main.ssl_ca : MDEV-10895 - SSL connection error on Power -main.ssl_cert_verify : MDEV-13735 - Server crash; modified in 10.2.22 main.ssl_cipher : MDEV-17184 - Failures with OpenSSL 1.1.1; modified in 10.2.22 main.ssl_connect : MDEV-13492 - Unknown SSL error +main.ssl_crl : Modified in 10.2.23 +main.ssl_crl_clients : Modified in 10.2.23 main.ssl_timeout : MDEV-11244 - Crash -main.stat_tables : Modified in 10.2.20 main.stat_tables_par : MDEV-13266 - Wrong result main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding main.status : MDEV-13255 - Wrong result main.subselect2 : Modified in 10.2.22 main.subselect_innodb : MDEV-10614 - Sporadic wrong results main.subselect_mat : Modified in 10.2.22 +main.subselect_sj : Modified in 10.2.23 +main.subselect_sj_mat : Modified in 10.2.23 main.tc_heuristic_recover : MDEV-14189 - Wrong result main.type_blob : MDEV-15195 - Wrong result main.type_datetime_hires : MDEV-10687 - Timeout -main.type_newdecimal : Modified in 10.2.20 -main.udf : Modified in 10.2.20 +main.type_year : Modified in 10.2.23 main.union : Modified in 10.2.22 -main.userstat : MDEV-12904 - SSL errors -main.win : Modified in 10.2.20 +main.update : Modified in 10.2.23 +main.userstat : MDEV-12904 - SSL errors; modified in 10.2.23 +main.view : Modified in 10.2.23 +main.wait_timeout : MDEV-19023 - Lost connection to MySQL server during query +main.win : Modified in 10.2.23 main.xa : MDEV-11769 - lock wait timeout #---------------------------------------------------------------- @@ -181,17 +192,17 @@ encryption.create_or_replace : MDEV-12694 - Timeout; MDEV-16 encryption.debug_key_management : MDEV-13841 - Timeout encryption.encrypt_and_grep : MDEV-13765 - Wrong result encryption.innochecksum : MDEV-13644 - Assertion failure -encryption.innodb-checksum-algorithm : MDEV-12898 - Deadlock of threads; MDEV-16896 - Server crash; modified in 10.2.20 +encryption.innodb-checksum-algorithm : MDEV-12898 - Deadlock of threads; MDEV-16896 - Server crash encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate encryption.innodb_encrypt_log : MDEV-13725 - Wrong result encryption.innodb_encryption : MDEV-15675 - Timeout -encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout; modified in 10.2.22 +encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout; modified in 10.2.23 encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure encryption.innodb_encryption_row_compressed : MDEV-16113 - Crash encryption.innodb_first_page : MDEV-10689 - Crash encryption.innodb-first-page-read : MDEV-14356 - Timeout in wait condition -encryption.innodb-force-corrupt : MDEV-17286 - SSL error; modified in 10.2.20 +encryption.innodb-force-corrupt : MDEV-17286 - SSL error encryption.innodb_lotoftables : MDEV-16111 - Wrong result encryption.innodb_onlinealter_encryption : MDEV-17287 - SIGABRT on server restart encryption.innodb-page_encryption : MDEV-10641 - mutex problem @@ -254,22 +265,25 @@ innodb.101_compatibility : MDEV-13891 - Wrong result innodb.add_constraint : Modified in 10.2.22 innodb.alter_candidate_key : Added in 10.2.22 innodb.alter_copy : MDEV-16181 - Assertion failure -innodb.alter_crash : MDEV-16944 - The process cannot access the file +innodb.alter_crash : MDEV-16944 - The process cannot access the file; modified in 10.2.23 +innodb.alter_kill : Modified in 10.2.23 innodb.alter_inplace_perfschema : Modified in 10.2.22 +innodb.alter_table : Modified in 10.2.23 innodb.alter_varchar_change : Modified in 10.2.22 innodb.autoinc_persist : MDEV-15282 - Assertion failure innodb.binlog_consistent : MDEV-10618 - Server fails to start -innodb.data_types : Modified in 10.2.20 -innodb.default_row_format_create : Modified in 10.2.20 -innodb.doublewrite : MDEV-12905 - Server crash -innodb.foreign_key : Modified in 10.2.22 +innodb.doublewrite : MDEV-12905 - Server crash; modified in 10.2.23 +innodb.foreign_key : Modified in 10.2.23 +innodb.foreign-keys : Modified in 10.2.23 innodb.group_commit_crash : MDEV-14191 - InnoDB registration failed innodb.group_commit_crash_no_optimize_thread : MDEV-13830 - Assertion failure +innodb.ibuf_not_empty : MDEV-19021 - Wrong result innodb.innodb_28867993 : Added in 10.2.22 innodb.innodb-32k-crash : MDEV-16953 - Corrupt log record found innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup innodb.innodb-alter : Modified in 10.2.22 innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS; modified in 10.2.22 +innodb.innodb-alter-nullable : Modified in 10.2.23 innodb.innodb-alter-table : MDEV-10619 - Testcase timeout innodb.innodb-alter-tempfile : MDEV-15285 - Table already exists innodb.innodb-blob : MDEV-12053 - Client crash @@ -279,12 +293,13 @@ innodb.innodb_bug30423 : MDEV-7311 - Wrong result innodb.innodb_bug48024 : MDEV-14352 - Assertion failure innodb.innodb_bug59641 : MDEV-13830 - Assertion failure innodb.innodb_bulk_create_index_replication : MDEV-15273 - Slave failed to start +innodb.innodb-corrupted-table : Modified in 10.2.23 innodb.innodb_defrag_stats_many_tables : MDEV-14198 - Table is full innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown; modified in 10.2.22 innodb.innodb-fk-warnings : Modified in 10.2.22 innodb.innodb_force_recovery : Modified in 10.2.22 innodb.innodb-get-fk : MDEV-13276 - Server crash -innodb.innodb-index : Modified in 10.2.22 +innodb.innodb-index : Modified in 10.2.23 innodb.innodb-index-online : MDEV-14809 - Cannot save statistics; modified in 10.2.22 innodb.innodb_information_schema : MDEV-8851 - Wrong result innodb.innodb_max_recordsize_32k : MDEV-14801 - Operation failed @@ -304,25 +319,25 @@ innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find free blocks innodb.log_corruption : MDEV-13251 - Wrong result innodb.log_data_file_size : MDEV-14204 - Server failed to start -innodb.log_file_name : MDEV-14193 - Exception +innodb.log_file_name : MDEV-14193 - Exception; modified in 10.2.23 innodb.log_file_size : MDEV-15668 - Not found pattern innodb.monitor : MDEV-16179 - Wrong result innodb.purge_secondary : MDEV-15681 - Wrong result innodb.purge_thread_shutdown : MDEV-13792 - Wrong result innodb.read_only_recovery : MDEV-13886 - Server crash -innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile +innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile; modified in 10.2.23 +innodb.restart : Modified in 10.2.23 innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace innodb.table_definition_cache_debug : MDEV-14206 - Extra warning -innodb.table_flags : MDEV-13572 - Wrong result; modified in 10.2.20 +innodb.table_flags : MDEV-13572 - Wrong result innodb.temp_table_savepoint : MDEV-16182 - Wrong result innodb.temporary_table : MDEV-13265 - Wrong result -innodb.truncate : Modified in 10.2.20 innodb.update_time : MDEV-14804 - Wrong result innodb.undo_truncate : MDEV-17340 - Server hung -innodb.undo_truncate_recover : MDEV-17679 - MySQL server has gone away +innodb.undo_truncate_recover : MDEV-17679 - MySQL server has gone away; modified in 10.2.23 innodb.xa_recovery : MDEV-15279 - mysqld got exception -innodb_fts.create : Modified in 10.2.20 +innodb_fts.fulltext3 : Modified in 10.2.23 innodb_fts.innodb-fts-fic : MDEV-14154 - Assertion failure innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning innodb_fts.innodb_fts_plugin : MDEV-13888 - Errors in server log @@ -331,15 +346,16 @@ innodb_fts.sync : MDEV-14808 - Wrong result innodb_gis.kill_server : MDEV-16941 - Checksum mismatch innodb_gis.point_basic : Modified in 10.2.22 +innodb_gis.rtree_compress2 : MDEV-13942 - ASAN use-after-poison innodb_gis.rtree_concurrent_srch : MDEV-15284 - Wrong result with embedded innodb_gis.rtree_purge : MDEV-15275 - Timeout innodb_gis.rtree_recovery : MDEV-15274 - Error on check +innodb_gis.rtree_rollback1 : MDEV-13942 - ASAN use-after-poison innodb_gis.rtree_split : MDEV-14208 - Too many arguments innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file innodb_gis.types : MDEV-15679 - Table is marked as crashed innodb_zip.cmp_per_index : MDEV-14490 - Table is marked as crashed -innodb_zip.innochecksum : Modified in 10.2.20 innodb_zip.innochecksum_3 : MDEV-13279 - Extra warnings innodb_zip.wl6470_1 : MDEV-14240 - Assertion failure innodb_zip.wl6501_1 : MDEV-10891 - Can't create UNIX socket @@ -351,26 +367,25 @@ innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error maria.insert_select : MDEV-12757 - Timeout maria.insert_select-7314 : MDEV-16492 - Timeout maria.maria : MDEV-14430 - Extra warning +maria.maria-recovery : Modified in 10.2.23 #---------------------------------------------------------------- mariabackup.absolute_ibdata_paths : MDEV-14192 - Assertion failure mariabackup.apply-log-only : MDEV-14192 - Assertion failure mariabackup.apply-log-only-incr : MDEV-14192 - Assertion failure -mariabackup.backup_grants : Added in 10.2.20 mariabackup.backup_ssl : MDEV-14192 - Assertion failure mariabackup.data_directory : MDEV-15270 - Error on exec -mariabackup.drop_table_during_backup : Modified in 10.2.22 -mariabackup.encrypted_page_compressed : Added in 10.2.20 -mariabackup.encrypted_page_corruption : Added in 10.2.20 -mariabackup.unencrypted_page_compressed : Added in 10.2.20 +mariabackup.drop_table_during_backup : MDEV-14192 - Assertion failure; modified in 10.2.22 mariabackup.full_backup : MDEV-16571 - Wrong result mariabackup.huge_lsn : MDEV-15662 - Sequence number is in the future; opt file modified in 10.2.22 mariabackup.incremental_backup : MDEV-14192 - Assertion failure mariabackup.incremental_ddl_before_backup : Added in 10.2.22 mariabackup.incremental_encrypted : MDEV-15667 - Timeout; MDEV-14192 - Assertion failure +mariabackup.incremental_rocksdb : Added in 10.2.23 mariabackup.innodb_log_optimize_ddl : MDEV-14192 - Assertion failure mariabackup.mdev-14447 : MDEV-15201 - Timeout; modified in 10.2.22 +mariabackup.page_compression_level : Added in 10.2.23 mariabackup.partial_exclude : MDEV-15270 - Error on exec mariabackup.partition_partial : Opt file added in 10.2.22 mariabackup.rename_during_backup : MDEV-14192 - Assertion failure; modified in 10.2.22 @@ -385,6 +400,7 @@ mroonga/storage.column_datetime_32bit_2038 : Wrong resul mroonga/storage.column_datetime_32bit_before_unix_epoch : Wrong result on Alpha mroonga/storage.column_datetime_32bit_max : Wrong result on Alpha mroonga/storage.column_datetime_32bit_out_of_range : Wrong result on Alpha +mroonga/storage.column_generated_stored_add_column : Modified in 10.2.23 mroonga/storage.index_multiple_column_unique_date_32bit_equal : Wrong result on Alpha mroonga/storage.index_multiple_column_unique_date_order_32bit_desc : Wrong result on Alpha mroonga/storage.index_multiple_column_unique_datetime_index_read : MDEV-8643 - Valgrind @@ -406,6 +422,7 @@ multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_ parts.partition_alter2_2_maria : MDEV-14364 - Lost connection to MySQL server during query parts.partition_auto_increment_archive : MDEV-16491 - Marked as crashed and should be repaired parts.partition_auto_increment_maria : MDEV-14430 - Extra warning +parts.partition_auto_increment_max : Added in 10.2.23 parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket; MDEV-15095 - Table doesn't exist parts.partition_exch_qa_10 : MDEV-11765 - wrong result parts.partition_innodb_status_file : MDEV-12901 - Valgrind @@ -429,7 +446,6 @@ perfschema.hostcache_ipv6_addrinfo_bad_allow : MDEV-13260 - Crash perfschema.hostcache_ipv6_ssl : MDEV-10696 - Crash perfschema.privilege_table_io : MDEV-13184 - Extra lines perfschema.rpl_gtid_func : MDEV-16897 - Wrong result -perfschema.socket_connect : Modified in 10.2.20 perfschema.socket_summary_by_event_name_func : MDEV-10622 - Wrong result perfschema.stage_mdl_global : MDEV-11803 - wrong result on slow builders perfschema.stage_mdl_procedure : MDEV-11545 - Missing row @@ -476,7 +492,6 @@ rocksdb.ttl_secondary_read_filtering : MDEV-16560 - Wrong result rocksdb.unique_check : MDEV-16576 - Wrong errno rocksdb.use_direct_reads_writes : MDEV-16646 - Server crash rocksdb.write_sync : MDEV-16965 - WRong result -rocksdb.xa : Added in 10.2.20 rocksdb_rpl.mdev12179 : MDEV-16632 - Server crash rocksdb_rpl.rpl_binlog_xid_count : MDEV-16644 - Server crash @@ -487,7 +502,6 @@ rocksdb_sys_vars.rocksdb_update_cf_options : MDEV-16955 - Bytes lost #---------------------------------------------------------------- roles.create_and_grant_role : MDEV-11772 - wrong result -roles.flush_roles-17898 : Added in 10.2.20 #---------------------------------------------------------------- @@ -605,7 +619,6 @@ stress.ddl_innodb : MDEV-10635 - Testcase timeout #---------------------------------------------------------------- -sys_vars.aria_used_for_temp_tables_basic : Modified in 10.2.20 sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x sys_vars.delayed_insert_limit_func : MDEV-17683 - Wrong result sys_vars.innodb_buffer_pool_dump_at_shutdown_basic : MDEV-14280 - Unexpected error @@ -613,10 +626,13 @@ sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash sys_vars.rpl_init_slave_func : MDEV-10149 - Test assertion sys_vars.slow_query_log_func : MDEV-14273 - Wrong result -sys_vars.sysvars_aria : Modified in 10.2.20 -sys_vars.table_definition_cache_basic : Modified in 10.2.22 +sys_vars.sql_buffer_result_func : Modified in 10.2.23 +sys_vars.sysvars_server_embedded : Include file modified in 10.2.23 +sys_vars.sysvars_server_notembedded : Include file modified in 10.2.23 sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result +sys_vars.thread_stack_basic : Modified in 10.2.23 sys_vars.tmp_disk_table_size_func : Modified in 10.2.22 +sys_vars.transaction_prealloc_size_bug27322 : MDEV-19024 - Wrong result sys_vars.wait_timeout_func : MDEV-12896 - Wrong result sys_vars.wsrep_sst_method_basic : Modified in 10.2.22 @@ -666,6 +682,7 @@ rpl-tokudb.* : MDEV-14354 - Tests fail with tcmalloc #---------------------------------------------------------------- unit.conc_basic-t : MDEV-15286 - not ok 7 - test_reconnect_maxpackage +unit.conc_errors : MDEV-18634 - ASAN global-buffer-overflow unit.conc_misc : MDEV-14811 - not ok 12 - test_conc49 unit.conc_ps_bugs : MDEV-13252 - not ok 44 test_bug4236 unit.lf : MDEV-18416 - object was probably modified after being freed @@ -675,15 +692,17 @@ unit.my_atomic : MDEV-18472 - Signal 11 thrown #---------------------------------------------------------------- vcol.not_supported : MDEV-10639 - Testcase timeout -vcol.upgrade : Modified in 10.2.20 vcol.vcol_keys : Modified in 10.2.22 vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout +vcol.vcol_keys_myisam : Modified in 10.2.23 vcol.vcol_misc : MDEV-16651 - Wrong error message +vcol.wrong_arena : Modified in 10.2.23 #---------------------------------------------------------------- wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node wsrep.mdev_6832 : MDEV-14195 - Check testcase failed +wsrep.pool_of_threads : MDEV-17345 - WSREP has not yet prepared node for application use wsrep.variables : MDEV-14311 - Wrong result; MDEV-17585 - Deadlock wsrep.wsrep-recover-v25 : Added in 10.2.22 From 77e2aca3f0795884e8221b30973709b62119fade Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 23 Mar 2019 11:27:30 +0100 Subject: [PATCH 5/9] cmake 3.14 new location for CPackRPM.cmake --- CMakeLists.txt | 3 ++- cmake/{ => Internal/CPack}/CPackRPM.cmake | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) rename cmake/{ => Internal/CPack}/CPackRPM.cmake (94%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93392056cf5..73263535240 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,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) diff --git a/cmake/CPackRPM.cmake b/cmake/Internal/CPack/CPackRPM.cmake similarity index 94% rename from cmake/CPackRPM.cmake rename to cmake/Internal/CPack/CPackRPM.cmake index 326013f06b3..2729667e319 100644 --- a/cmake/CPackRPM.cmake +++ b/cmake/Internal/CPack/CPackRPM.cmake @@ -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) From 71c781bfe758c1296095f99fa529276442b3a1ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 25 Mar 2019 10:29:25 +0200 Subject: [PATCH 6/9] MDEV-18090 Assertion failures due to virtual columns after upgrading to 10.2 MariaDB before MDEV-5800 in version 10.2.2 did not support indexed virtual columns. Non-persistent virtual columns were hidden from storage engines. Only starting with MDEV-5800, InnoDB would create internal metadata on virtual columns. Similar to what was done in MDEV-18084 and MDEV-18960, we adjust two more code paths for the old tables. ha_innobase::build_template(): Do not invoke dict_index_contains_col_or_prefix() for virtual columns if InnoDB does not store the metadata. innobase_build_col_map(): Relax an assertion about the number of columns. ha_innobase::omits_virtual_cols(): Renamed from omits_virtual_cols(). --- storage/innobase/handler/ha_innodb.cc | 18 +++++++----------- storage/innobase/handler/ha_innodb.h | 12 ++++++++++-- storage/innobase/handler/handler0alter.cc | 3 ++- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 9366b2db30b..b448f71d6d0 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -275,12 +275,6 @@ void set_my_errno(int err) errno = err; } -static uint omits_virtual_cols(const TABLE_SHARE &share) -{ - return share.frm_version < FRM_VER_EXPRESSSIONS && - share.virtual_fields; -} - /** Checks whether the file name belongs to a partition of a table. @param[in] file_name file name @return pointer to the end of the table name part of the file name, or NULL */ @@ -7475,7 +7469,8 @@ build_template_needs_field( { const Field* field = table->field[i]; - if (!field->stored_in_db() && omits_virtual_cols(*table->s)) { + if (!field->stored_in_db() + && ha_innobase::omits_virtual_cols(*table->s)) { return NULL; } @@ -7632,7 +7627,7 @@ build_template_field( &templ->rec_prefix_field_no); } } else { - ut_ad(!omits_virtual_cols(*table->s)); + DBUG_ASSERT(!ha_innobase::omits_virtual_cols(*table->s)); col = &dict_table_get_nth_v_col(index->table, v_no)->m_col; templ->clust_rec_field_no = v_no; templ->rec_prefix_field_no = ULINT_UNDEFINED; @@ -8019,7 +8014,8 @@ no_icp: contain = dict_index_contains_col_or_prefix( index, i - num_v, false); - } else if (dict_index_is_clust(index)) { + } else if (skip_virtual + || dict_index_is_clust(index)) { num_v++; continue; } else { @@ -8521,7 +8517,7 @@ calc_row_difference( trx_t* const trx = prebuilt->trx; doc_id_t doc_id = FTS_NULL_DOC_ID; ulint num_v = 0; - const bool skip_virtual = omits_virtual_cols(*table->s); + const bool skip_virtual = ha_innobase::omits_virtual_cols(*table->s); ut_ad(!srv_read_only_mode); @@ -11063,7 +11059,7 @@ create_table_info_t::create_table_def() /* Find out the number of virtual columns. */ ulint num_v = 0; - const bool omit_virtual = omits_virtual_cols(*m_form->s); + const bool omit_virtual = ha_innobase::omits_virtual_cols(*m_form->s); const ulint n_cols = omit_virtual ? m_form->s->stored_fields : m_form->s->fields; diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 76a9b08c4c6..9311056bde5 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -22,6 +22,8 @@ this program; if not, write to the Free Software Foundation, Inc., # include "../../../wsrep/wsrep_api.h" #endif /* WITH_WSREP */ +#include "table.h" + /* The InnoDB handler: the interface between MySQL and InnoDB. */ /** "GEN_CLUST_INDEX" is the name reserved for InnoDB default @@ -412,8 +414,15 @@ public: Item* idx_cond_push(uint keyno, Item* idx_cond); /* @} */ -protected: + /** Check if InnoDB is not storing virtual column metadata for a table. + @param s table definition (based on .frm file) + @return whether InnoDB will omit virtual column metadata */ + static bool omits_virtual_cols(const TABLE_SHARE& s) + { + return s.frm_version= altered_table->s->fields + DATA_N_SYS_COLS); DBUG_ASSERT(dict_table_get_n_cols(old_table) + dict_table_get_n_v_cols(old_table) - >= table->s->fields + DATA_N_SYS_COLS); + >= table->s->fields + DATA_N_SYS_COLS + || ha_innobase::omits_virtual_cols(*table->s)); DBUG_ASSERT(!!add_cols == !!(ha_alter_info->handler_flags & Alter_inplace_info::ADD_COLUMN)); DBUG_ASSERT(!add_cols || dtuple_get_n_fields(add_cols) From b59d4846962f516c3026788407a4e4c6af857dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 22 Mar 2019 19:16:45 +0200 Subject: [PATCH 7/9] MDEV-14126: Remove page_is_root() The predicate page_is_root(), which was added in MariaDB Server 10.2.2, is based on a wrong assumption. Under some circumstances, InnoDB can transform B-trees into a degenerate state where a non-leaf page has no sibling pages. Because of this, we cannot assume that a page that has no siblings is the root page. This bug will be tracked as MDEV-19022. Because of the bug that may affect many InnoDB data files, we must remove and replace the wrong predicate. Using the wrong predicate can cause corruption. A leaf page is not allowed to be empty except if it is the root page, and the entire table is empty. --- storage/innobase/btr/btr0btr.cc | 41 +++++++++++++++----------- storage/innobase/btr/btr0cur.cc | 10 ++++--- storage/innobase/btr/btr0defragment.cc | 5 ++-- storage/innobase/include/page0page.h | 21 ++++++++----- storage/innobase/include/page0page.ic | 30 ++----------------- storage/innobase/page/page0cur.cc | 5 +++- storage/innobase/page/page0page.cc | 6 ++-- storage/innobase/page/page0zip.cc | 4 +-- storage/innobase/row/row0import.cc | 6 ++-- 9 files changed, 62 insertions(+), 66 deletions(-) diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index d06568535e6..5b1e7e1b853 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -2,7 +2,7 @@ Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2014, 2017, 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 @@ -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)) { @@ -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; } @@ -1358,7 +1357,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); @@ -1430,7 +1430,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(page_id.space()); btr_free_root(root, mtr); @@ -1453,8 +1452,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); } @@ -1614,12 +1611,17 @@ btr_page_reorganize_low( ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table)); 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->space); + 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); @@ -1677,7 +1679,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.*/ @@ -1894,6 +1896,8 @@ btr_page_empty( ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table)); ut_ad(page_zip == buf_block_get_page_zip(block)); + ut_ad(!index->is_dummy); + ut_ad(index->space == block->page.id.space()); #ifdef UNIV_ZIP_DEBUG ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ @@ -1906,7 +1910,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; @@ -4225,6 +4230,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)); @@ -4235,11 +4242,10 @@ btr_discard_only_page_on_level( ut_a(page_get_n_recs(page) == 1); ut_a(page_level == btr_page_get_level(page, mtr)); - ut_a(btr_page_get_prev(page, mtr) == FIL_NULL); - ut_a(btr_page_get_next(page, mtr) == FIL_NULL); - - ut_ad(mtr_is_block_fix( - mtr, block, MTR_MEMO_PAGE_X_FIX, index->table)); + ut_a(!page_has_siblings(page)); + ut_ad(fil_page_index_page_check(page)); + ut_ad(block->page.id.space() == index->space); + ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); btr_search_drop_page_hash_index(block); if (dict_index_is_spatial(index)) { @@ -4265,6 +4271,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_has_siblings(block->frame)); #ifdef UNIV_BTR_DEBUG if (!dict_index_is_ibuf(index)) { diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index f1ecaca3b54..37372af4b44 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -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 @@ -5113,14 +5113,14 @@ 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_is_block_fix(mtr, btr_cur_get_block(cursor), - MTR_MEMO_PAGE_X_FIX, cursor->index->table)); ut_ad(mtr->is_named_space(cursor->index->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->space); 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) @@ -5242,8 +5242,10 @@ btr_cur_pessimistic_delete( ut_ad(mtr_memo_contains_flagged(mtr, dict_index_get_lock(index), MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK)); - ut_ad(mtr_is_block_fix(mtr, block, MTR_MEMO_PAGE_X_FIX, index->table)); + ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); ut_ad(mtr->is_named_space(index->space)); + ut_ad(!index->is_dummy); + ut_ad(block->page.id.space() == index->space); if (!has_reserved_extents) { /* First reserve enough free space for the file segments diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc index 036e2ea776c..077cf8a1c73 100644 --- a/storage/innobase/btr/btr0defragment.cc +++ b/storage/innobase/btr/btr0defragment.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (C) 2013, 2014 Facebook, Inc. All Rights Reserved. -Copyright (C) 2014, 2017, 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 @@ -181,7 +181,8 @@ btr_defragment_add_index( return NULL; } - ut_ad(page_is_root(page)); + ut_ad(fil_page_index_page_check(page)); + ut_ad(!page_has_siblings(page)); if (page_is_leaf(page)) { // Index root is a leaf page, no need to defragment. diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h index 832e3d2170f..18c536c05e9 100644 --- a/storage/innobase/include/page0page.h +++ b/storage/innobase/include/page0page.h @@ -1,6 +1,6 @@ /***************************************************************************** Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2018, MariaDB Corporation. +Copyright (c) 2013, 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 @@ -684,14 +684,19 @@ ulint page_rec_get_heap_no( /*=================*/ const rec_t* rec); /*!< in: the physical record */ -/** Determine whether a page is an index root page. + +/** Determine whether a page has any siblings. @param[in] page page frame -@return true if the page is a root page of an index */ -UNIV_INLINE -bool -page_is_root( - const page_t* page) - MY_ATTRIBUTE((warn_unused_result)); +@return true if the page has any siblings */ +inline bool page_has_siblings(const page_t* page) +{ + compile_time_assert(!(FIL_PAGE_PREV % 8)); + compile_time_assert(FIL_PAGE_NEXT == FIL_PAGE_PREV + 4); + compile_time_assert(FIL_NULL == 0xffffffff); + return *reinterpret_cast(page + FIL_PAGE_PREV) + != ~uint64_t(0); +} + /************************************************************//** Gets the pointer to the next record on the page. @return pointer to next record */ diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index 0062db56bfa..d1efca1d244 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2017, MariaDB Corporation. +Copyright (c) 2016, 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 @@ -91,7 +91,8 @@ UNIV_INLINE ib_uint64_t page_get_autoinc(const page_t* page) { - ut_ad(page_is_root(page)); + ut_ad(fil_page_index_page_check(page)); + ut_ad(!page_has_siblings(page)); return(mach_read_from_8(PAGE_HEADER + PAGE_ROOT_AUTO_INC + page)); } @@ -277,31 +278,6 @@ page_rec_get_heap_no( } } -/** Determine whether a page is an index root page. -@param[in] page page frame -@return true if the page is a root page of an index */ -UNIV_INLINE -bool -page_is_root( - const page_t* page) -{ -#if FIL_PAGE_PREV % 8 -# error FIL_PAGE_PREV must be 64-bit aligned -#endif -#if FIL_PAGE_NEXT != FIL_PAGE_PREV + 4 -# error FIL_PAGE_NEXT must be adjacent to FIL_PAGE_PREV -#endif -#if FIL_NULL != 0xffffffff -# error FIL_NULL != 0xffffffff -#endif - /* Check that this is an index page and both the PREV and NEXT - pointers are FIL_NULL, because the root page does not have any - siblings. */ - return(fil_page_index_page_check(page) - && *reinterpret_cast(page + FIL_PAGE_PREV) - == IB_UINT64_MAX); -} - /** Determine whether an index page record is a user record. @param[in] rec record in an index page @return true if a user record */ diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index 2327d11f1fa..ae46d1e71ce 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -2,7 +2,7 @@ Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2018, MariaDB Corporation. +Copyright (c) 2018, 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 @@ -1990,6 +1990,8 @@ page_parse_copy_rec_list_to_created_page( return(rec_end); } + ut_ad(fil_page_index_page_check(block->frame)); + while (ptr < rec_end) { ptr = page_cur_parse_insert_rec(TRUE, ptr, end_ptr, block, index, mtr); @@ -2045,6 +2047,7 @@ page_copy_rec_list_end_to_created_page( ut_ad(page_dir_get_n_heap(new_page) == PAGE_HEAP_NO_USER_LOW); ut_ad(page_align(rec) != new_page); ut_ad(page_rec_is_comp(rec) == page_is_comp(new_page)); + ut_ad(fil_page_index_page_check(new_page)); if (page_rec_is_infimum(rec)) { diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc index cb2a545e6e2..be426ec4927 100644 --- a/storage/innobase/page/page0page.cc +++ b/storage/innobase/page/page0page.cc @@ -2,7 +2,7 @@ Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2017, 2018, MariaDB Corporation. +Copyright (c) 2017, 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 @@ -526,6 +526,8 @@ page_create_empty( page_zip_des_t* page_zip= buf_block_get_page_zip(block); ut_ad(fil_page_index_page_check(page)); + ut_ad(!index->is_dummy); + ut_ad(block->page.id.space() == index->space); /* Multiple transactions cannot simultaneously operate on the same temp-table in parallel. @@ -536,7 +538,7 @@ page_create_empty( && page_is_leaf(page)) { max_trx_id = page_get_max_trx_id(page); ut_ad(max_trx_id); - } else if (page_is_root(page)) { + } else if (block->page.id.page_no() == index->page) { /* Preserve PAGE_ROOT_AUTO_INC. */ max_trx_id = page_get_max_trx_id(page); } else { diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 50e22059e7d..811b5d88947 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -2,7 +2,7 @@ Copyright (c) 2005, 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 @@ -4727,7 +4727,7 @@ page_zip_reorganize( clustered index root pages. */ ut_ad(page_get_max_trx_id(page) == 0 || (dict_index_is_clust(index) - ? page_is_root(temp_page) + ? !page_has_siblings(temp_page) : page_is_leaf(temp_page))); /* Restore logging. */ diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index b9c18ca6a4e..159535fba19 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -668,7 +668,7 @@ dberr_t FetchIndexRootPages::operator()(buf_block_t* block) UNIV_NOTHROW return set_current_xdes(block->page.id.page_no(), page); } else if (fil_page_index_page_check(page) && !is_free(block->page.id.page_no()) - && page_is_root(page)) { + && !page_has_siblings(page)) { index_id_t id = btr_page_get_index_id(page); @@ -1834,7 +1834,7 @@ PageConverter::update_index_page( page, m_page_zip_ptr, m_index->m_srv_index->id, 0); if (dict_index_is_clust(m_index->m_srv_index)) { - if (page_is_root(page)) { + if (block->page.id.page_no() == m_index->m_srv_index->page) { /* Preserve the PAGE_ROOT_AUTO_INC. */ } else { /* Clear PAGE_MAX_TRX_ID so that it can be @@ -1854,7 +1854,7 @@ PageConverter::update_index_page( if (page_is_empty(page)) { /* Only a root page can be empty. */ - if (!page_is_root(page)) { + if (page_has_siblings(page)) { // TODO: We should relax this and skip secondary // indexes. Mark them as corrupt because they can // always be rebuilt. From a4d0d6828bb46c1a1b0049ebfd9c5c136a7a7862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 22 Mar 2019 19:19:34 +0200 Subject: [PATCH 8/9] MDEV-14126: Improve assertions in btr_pcur_store_position() --- storage/innobase/btr/btr0pcur.cc | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc index 2b85c764a3b..7948c0031c8 100644 --- a/storage/innobase/btr/btr0pcur.cc +++ b/storage/innobase/btr/btr0pcur.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2017, MariaDB Corporation. +Copyright (c) 2016, 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 @@ -100,7 +100,6 @@ btr_pcur_store_position( buf_block_t* block; rec_t* rec; dict_index_t* index; - page_t* page; ulint offs; ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED); @@ -112,9 +111,8 @@ btr_pcur_store_position( page_cursor = btr_pcur_get_page_cur(cursor); rec = page_cur_get_rec(page_cursor); - page = page_align(rec); - offs = page_offset(rec); - + offs = rec - block->frame; + ut_ad(block->page.id.page_no() == page_get_page_no(block->frame)); ut_ad(block->page.buf_fix_count); /* For spatial index, when we do positioning on parent buffer if necessary, it might not hold latches, but the @@ -127,17 +125,16 @@ btr_pcur_store_position( mtr, dict_index_get_lock(index), MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK))); - if (page_is_empty(page)) { + cursor->old_stored = true; + + if (page_is_empty(block->frame)) { /* It must be an empty index tree; NOTE that in this case we do not store the modify_clock, but always do a search if we restore the cursor 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 = true; + ut_a(!page_has_siblings(block->frame)); + ut_ad(page_is_leaf(block->frame)); + ut_ad(block->page.id.page_no() == index->page); if (page_rec_is_supremum_low(offs)) { @@ -164,7 +161,6 @@ btr_pcur_store_position( cursor->rel_pos = BTR_PCUR_ON; } - cursor->old_stored = true; cursor->old_rec = dict_index_copy_rec_order_prefix( index, rec, &cursor->old_n_fields, &cursor->old_rec_buf, &cursor->buf_size); From 72b934e3f7d5f0c717cb98b718c9529c74741b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 22 Mar 2019 19:21:07 +0200 Subject: [PATCH 9/9] MDEV-14126: Detect unexpected emptying of B-tree pages If an index page becomes empty, btr_page_empty() should be called. --- storage/innobase/include/page0page.ic | 5 +++-- storage/innobase/page/page0cur.cc | 2 ++ storage/innobase/page/page0page.cc | 1 + storage/innobase/page/page0zip.cc | 6 ++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index d1efca1d244..11d5e2d1854 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -173,8 +173,9 @@ page_header_set_field( { ut_ad(page); ut_ad(field <= PAGE_N_RECS); - ut_ad(field == PAGE_N_HEAP || val < UNIV_PAGE_SIZE); - ut_ad(field != PAGE_N_HEAP || (val & 0x7fff) < UNIV_PAGE_SIZE); + ut_ad(field != PAGE_N_RECS || val); + ut_ad(field == PAGE_N_HEAP || val < srv_page_size); + ut_ad(field != PAGE_N_HEAP || (val & 0x7fff) < srv_page_size); mach_write_to_2(page + PAGE_HEADER + field, val); if (page_zip) { diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index ae46d1e71ce..561f053710f 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -2140,6 +2140,8 @@ page_copy_rec_list_end_to_created_page( rec = page_rec_get_next(rec); } while (!page_rec_is_supremum(rec)); + ut_ad(n_recs); + if ((slot_index > 0) && (count + 1 + (PAGE_DIR_SLOT_MAX_N_OWNED + 1) / 2 <= PAGE_DIR_SLOT_MAX_N_OWNED)) { diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc index be426ec4927..2f3879dda08 100644 --- a/storage/innobase/page/page0page.cc +++ b/storage/innobase/page/page0page.cc @@ -1231,6 +1231,7 @@ delete_all: page_header_set_field(page, NULL, PAGE_GARBAGE, size + page_header_get_field(page, PAGE_GARBAGE)); + ut_ad(page_get_n_recs(page) > n_recs); page_header_set_field(page, NULL, PAGE_N_RECS, (ulint)(page_get_n_recs(page) - n_recs)); } diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 811b5d88947..001d33662d1 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -4448,10 +4448,12 @@ page_zip_dir_delete( slot_rec = page_zip_dir_find(page_zip, page_offset(rec)); ut_a(slot_rec); - + uint16_t n_recs = page_get_n_recs(page); + ut_ad(n_recs); + ut_ad(n_recs > 1 || page_get_page_no(page) == index->page); /* This could not be done before page_zip_dir_find(). */ page_header_set_field(page, page_zip, PAGE_N_RECS, - (ulint)(page_get_n_recs(page) - 1)); + n_recs - 1); if (UNIV_UNLIKELY(!free)) { /* Make the last slot the start of the free list. */