From 7128fefa4ce4746ad04158846242f0aec6cf8271 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sat, 23 Sep 2017 23:23:05 +0200 Subject: [PATCH 1/3] Fix compile with -DWITHOUT_DYNAMIC_PLUGINS on Unix --- sql/CMakeLists.txt | 13 ++----------- storage/mroonga/CMakeLists.txt | 3 +++ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 846df00498f..2e63dac6f02 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -322,18 +322,9 @@ ADD_CUSTOM_TARGET( SET_TARGET_PROPERTIES(GenServerSource PROPERTIES EXCLUDE_FROM_ALL TRUE) IF(WIN32 OR HAVE_DLOPEN AND NOT DISABLE_SHARED) - ADD_LIBRARY(udf_example MODULE udf_example.c) + ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def) SET_TARGET_PROPERTIES(udf_example PROPERTIES PREFIX "") - # udf_example depends on strings - IF(WIN32) - IF(MSVC) - SET_TARGET_PROPERTIES(udf_example PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/udf_example.def") - ENDIF() - TARGET_LINK_LIBRARIES(udf_example strings) - ELSE() - # udf_example is using safemutex exported by mysqld - TARGET_LINK_LIBRARIES(udf_example mysqld) - ENDIF() + TARGET_LINK_LIBRARIES(udf_example strings) ENDIF() FOREACH(tool glibtoolize libtoolize aclocal autoconf autoheader automake gtar diff --git a/storage/mroonga/CMakeLists.txt b/storage/mroonga/CMakeLists.txt index f728c944bbf..dc88be51184 100644 --- a/storage/mroonga/CMakeLists.txt +++ b/storage/mroonga/CMakeLists.txt @@ -326,6 +326,9 @@ if(MRN_BUNDLED) STORAGE_ENGINE MODULE_ONLY RECOMPILE_FOR_EMBEDDED LINK_LIBRARIES ${MRN_LIBRARIES}) + if(NOT TARGET mroonga) + return() + endif() else() add_library(mroonga MODULE ${MRN_ALL_SOURCES}) From 78b63425a3f17214b67891f44399fa5f084965e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Sun, 24 Sep 2017 10:11:16 +0300 Subject: [PATCH 2/3] MDEV-13899 IMPORT TABLESPACE may corrupt ROW_FORMAT=REDUNDANT tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ALTER TABLE…IMPORT TABLESPACE adjustment code that was introduced by WL#5522 in MySQL 5.6 is incorrectly invoking rec_get_status() on a ROW_FORMAT=REDUNDANT record to determine if a record is a leaf page record. The function rec_get_status(rec) is only to be called on ROW_FORMAT=COMPACT, DYNAMIC or COMPRESSED records. --- storage/innobase/row/row0import.cc | 12 ++++-------- storage/xtradb/row/row0import.cc | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index 1337496b897..ca287b2d0d9 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -1819,16 +1819,12 @@ PageConverter::update_records( m_rec_iter.open(block); + if (!page_is_leaf(block->frame)) { + return DB_SUCCESS; + } + while (!m_rec_iter.end()) { - rec_t* rec = m_rec_iter.current(); - - /* FIXME: Move out of the loop */ - - if (rec_get_status(rec) == REC_STATUS_NODE_PTR) { - break; - } - ibool deleted = rec_get_deleted_flag(rec, comp); /* For the clustered index we have to adjust the BLOB diff --git a/storage/xtradb/row/row0import.cc b/storage/xtradb/row/row0import.cc index bc7b5206a64..572892172c4 100644 --- a/storage/xtradb/row/row0import.cc +++ b/storage/xtradb/row/row0import.cc @@ -1819,16 +1819,12 @@ PageConverter::update_records( m_rec_iter.open(block); + if (!page_is_leaf(block->frame)) { + return DB_SUCCESS; + } + while (!m_rec_iter.end()) { - rec_t* rec = m_rec_iter.current(); - - /* FIXME: Move out of the loop */ - - if (rec_get_status(rec) == REC_STATUS_NODE_PTR) { - break; - } - ibool deleted = rec_get_deleted_flag(rec, comp); /* For the clustered index we have to adjust the BLOB From 19d21b9366c1eb5c1c1e822a09969e9a23bfe2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 25 Sep 2017 09:29:27 +0300 Subject: [PATCH 3/3] Cherry-pick the MDEV-13898 test changes from 10.2 to 10.0 --- mysql-test/suite/innodb/r/innodb-table-online.result | 8 +++++++- mysql-test/suite/innodb/t/innodb-table-online.test | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb-table-online.result b/mysql-test/suite/innodb/r/innodb-table-online.result index 5440df0bb9c..eb55ba57e36 100644 --- a/mysql-test/suite/innodb/r/innodb-table-online.result +++ b/mysql-test/suite/innodb/r/innodb-table-online.result @@ -143,7 +143,8 @@ ROLLBACK; # session con1 KILL QUERY @id; ERROR 70100: Query execution was interrupted -SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt WAIT_FOR kill_done'; +SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt WAIT_FOR dml_done'; +SET DEBUG_SYNC = 'row_log_table_apply2_before SIGNAL applied WAIT_FOR kill_done'; ALTER TABLE t1 ROW_FORMAT=REDUNDANT; # session default SET DEBUG_SYNC = 'now WAIT_FOR rebuilt'; @@ -153,6 +154,10 @@ ddl_background_drop_indexes 0 ddl_background_drop_tables 0 ddl_online_create_index 1 ddl_pending_alter_table 1 +BEGIN; +INSERT INTO t1 VALUES(7,4,2); +ROLLBACK; +SET DEBUG_SYNC = 'now SIGNAL dml_done WAIT_FOR applied'; KILL QUERY @id; SET DEBUG_SYNC = 'now SIGNAL kill_done'; # session con1 @@ -186,6 +191,7 @@ t1 CREATE TABLE `t1` ( `c3` text NOT NULL, PRIMARY KEY (`c1`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT +ALTER TABLE t1 ROW_FORMAT=REDUNDANT; SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt2 WAIT_FOR dml2_done'; SET lock_wait_timeout = 10; ALTER TABLE t1 ROW_FORMAT=COMPACT, ALGORITHM = INPLACE; diff --git a/mysql-test/suite/innodb/t/innodb-table-online.test b/mysql-test/suite/innodb/t/innodb-table-online.test index 4dce8e4d65f..4e9f2f13344 100644 --- a/mysql-test/suite/innodb/t/innodb-table-online.test +++ b/mysql-test/suite/innodb/t/innodb-table-online.test @@ -157,7 +157,8 @@ let $ID= `SELECT @id := CONNECTION_ID()`; --error ER_QUERY_INTERRUPTED KILL QUERY @id; -SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt WAIT_FOR kill_done'; +SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt WAIT_FOR dml_done'; +SET DEBUG_SYNC = 'row_log_table_apply2_before SIGNAL applied WAIT_FOR kill_done'; --send ALTER TABLE t1 ROW_FORMAT=REDUNDANT; @@ -165,6 +166,10 @@ ALTER TABLE t1 ROW_FORMAT=REDUNDANT; connection default; SET DEBUG_SYNC = 'now WAIT_FOR rebuilt'; eval $innodb_metrics_select; +BEGIN; +INSERT INTO t1 VALUES(7,4,2); +ROLLBACK; +SET DEBUG_SYNC = 'now SIGNAL dml_done WAIT_FOR applied'; let $ignore= `SELECT @id := $ID`; KILL QUERY @id; SET DEBUG_SYNC = 'now SIGNAL kill_done'; @@ -190,6 +195,7 @@ ANALYZE TABLE t1; --echo # session con1 connection con1; SHOW CREATE TABLE t1; +ALTER TABLE t1 ROW_FORMAT=REDUNDANT; # Exceed the configured innodb_online_alter_log_max_size. # The actual limit is a multiple of innodb_sort_buf_size,