summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-07-18 13:10:09 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-07-18 13:10:09 +0300
commit69628551858825bebc3f1653882920e4f6555cbb (patch)
treed744f4354c81c93ac76bf6530eefde17eb093177
parent26b594e4110b4f7e6f2bcfbdb4c87aef65652bc0 (diff)
parent10ebdb7f1d7a3f6aa6a91b40a9d90f482da08e58 (diff)
downloadmariadb-git-69628551858825bebc3f1653882920e4f6555cbb.tar.gz
Merge 10.1 into 10.2
-rw-r--r--client/mysqlbinlog.cc1
-rw-r--r--mysql-test/r/mysqld--help.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_stop_never.result16
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_stop_never.test66
-rw-r--r--mysql-test/suite/rpl/r/mdev_17588.result36
-rw-r--r--mysql-test/suite/rpl/t/mdev_17588-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/mdev_17588.test39
-rw-r--r--mysql-test/t/mysqld--help.test2
-rw-r--r--sql/log_event.cc2
-rw-r--r--sql/table.cc6
-rw-r--r--storage/connect/CMakeLists.txt9
-rw-r--r--storage/innobase/buf/buf0buf.cc32
-rw-r--r--storage/xtradb/buf/buf0buf.cc29
-rw-r--r--support-files/rpm/server-postin.sh2
-rw-r--r--zlib/CMakeLists.txt5
15 files changed, 199 insertions, 49 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 1516e08284b..acccf0a3411 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -1534,6 +1534,7 @@ end:
{
my_fwrite(result_file, (const uchar *) tmp_str.str, tmp_str.length,
MYF(MY_NABP));
+ fflush(result_file);
my_free(tmp_str.str);
}
}
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result
index 51ece335908..8bdf994f908 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -1,4 +1,4 @@
-Windows bug: happens when a new line is exactly at the right offset.
+Windows bug: new line disappears when it is exactly at the right offset.
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit.
--no-defaults Don't read default options from any option file.
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_stop_never.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_stop_never.result
new file mode 100644
index 00000000000..e94f17b9489
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_stop_never.result
@@ -0,0 +1,16 @@
+RESET MASTER;
+include/stop_dump_threads.inc
+# Step-1: Execute some dummy statements.
+CREATE TABLE t1(i int);
+INSERT INTO t1 values (1);
+# Step-2: Disable binary log temporarily and drop the table 't1'.
+set @@SESSION.SQL_LOG_BIN = 0;
+DROP TABLE t1;
+set @@SESSION.SQL_LOG_BIN = 1;
+# Step-3: Execute MYSQL_BINLOG with --stop-never and source it to mysql client.
+# Step-4: Wait till dump thread transfer is completed.
+# Step-5: Check that the data is there.
+# Step-6: Cleanup
+# kill the dump thread serving the mysqlbinlog --stop-never process
+include/stop_dump_threads.inc
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_stop_never.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_stop_never.test
new file mode 100644
index 00000000000..d73e453ce96
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_stop_never.test
@@ -0,0 +1,66 @@
+# ==== Purpose ====
+#
+# Test verifies that continuous streaming of binary log content using the
+# "mysqlbinlog --stop-never" option and sourcing it to mysql client works
+# fine.
+#
+# ==== Implementation ====
+#
+# Steps:
+# 1 - Create a table on a server on which binary log is enabled and insert
+# a row.
+# 2 - Disable the binary log on the server and drop the table.
+# 3 - Capture the binary log output using "mysqlbinlog --stop_never" option
+# and source it to mysql client.
+# 4 - Query the PROCESSLIST table to ensure that the dump thread which is
+# serving "stop_never" option has read entire binlog.
+# 5 - Verify that the table is populated on the server.
+# 6 - Cleanup.
+#
+# ==== References ====
+#
+# MDEV-11154: Write_on_release_cache(log_event.cc) function will not write
+# "COMMIT", if use "mysqlbinlog ... | mysql ..."
+
+--source include/not_windows.inc
+
+# Test is not specific to any binlog format. Hence Running only for 'row'.
+--source include/have_binlog_format_row.inc
+
+# binlog file name is needed in the test. To use master-bin.000001,
+# RESET MASTER is needed.
+RESET MASTER;
+# kill the dump threads if there any dump threads (may be from previous test)
+--source include/stop_dump_threads.inc
+
+--echo # Step-1: Execute some dummy statements.
+CREATE TABLE t1(i int);
+INSERT INTO t1 values (1);
+
+--echo # Step-2: Disable binary log temporarily and drop the table 't1'.
+set @@SESSION.SQL_LOG_BIN = 0;
+DROP TABLE t1;
+set @@SESSION.SQL_LOG_BIN = 1;
+
+--echo # Step-3: Execute MYSQL_BINLOG with --stop-never and source it to mysql client.
+--write_file $MYSQL_TMP_DIR/mysqlbinlog_stop_never.sh
+(`$MYSQL_BINLOG --read-from-remote-server --stop-never --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 | $MYSQL --user=root --protocol=tcp --host=127.0.0.1 --port=$MASTER_MYPORT`) < /dev/null > /dev/null 2>&1 &
+EOF
+--exec /bin/bash $MYSQL_TMP_DIR/mysqlbinlog_stop_never.sh
+
+--echo # Step-4: Wait till dump thread transfer is completed.
+let $wait_condition= SELECT id from information_schema.processlist where processlist.command like '%Binlog%' and state like '%Master has sent%';
+--source include/wait_condition.inc
+
+--echo # Step-5: Check that the data is there.
+let $count= 1;
+let $table= test.t1;
+source include/wait_until_rows_count.inc;
+
+--echo # Step-6: Cleanup
+--echo # kill the dump thread serving the mysqlbinlog --stop-never process
+--source include/stop_dump_threads.inc
+
+DROP TABLE t1;
+--remove_file $MYSQL_TMP_DIR/mysqlbinlog_stop_never.sh
+
diff --git a/mysql-test/suite/rpl/r/mdev_17588.result b/mysql-test/suite/rpl/r/mdev_17588.result
new file mode 100644
index 00000000000..f6b4728bd88
--- /dev/null
+++ b/mysql-test/suite/rpl/r/mdev_17588.result
@@ -0,0 +1,36 @@
+include/master-slave.inc
+[connection master]
+connection master;
+create table t1 (a int) engine=innodb;
+create table t2 (a int);
+create table t3 (a int) engine=innodb;
+include/save_master_gtid.inc
+connection slave;
+include/wait_for_slave_sql_error.inc [errno=1286]
+Last_Error = 'Error 'Unknown storage engine 'innodb'' on query. Default database: 'test'. Query: 'create table t1 (a int) engine=innodb''
+STOP SLAVE IO_THREAD;
+include/wait_for_slave_to_stop.inc
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+show tables;
+Tables_in_test
+t2
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show create table t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+show create table t3;
+ERROR 42S02: Table 'test.t3' doesn't exist
+connection master;
+drop table if exists t1;
+drop table if exists t2;
+drop table if exists t3;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+CALL mtr.add_suppression('Slave: Unknown storage engine .* Error_code: 1286');
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/mdev_17588-slave.opt b/mysql-test/suite/rpl/t/mdev_17588-slave.opt
new file mode 100644
index 00000000000..d73dbeca51a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/mdev_17588-slave.opt
@@ -0,0 +1 @@
+--loose-disable-innodb --replicate-ignore-table=test.t3
diff --git a/mysql-test/suite/rpl/t/mdev_17588.test b/mysql-test/suite/rpl/t/mdev_17588.test
new file mode 100644
index 00000000000..e9a340cbd25
--- /dev/null
+++ b/mysql-test/suite/rpl/t/mdev_17588.test
@@ -0,0 +1,39 @@
+--source include/master-slave.inc
+--source include/have_innodb.inc
+
+--connection master
+create table t1 (a int) engine=innodb;
+create table t2 (a int);
+create table t3 (a int) engine=innodb;
+--source include/save_master_gtid.inc
+
+--connection slave
+# Using ER_UNKNOWN_STORAGE_ENGINE wont work
+let $slave_sql_errno= 1286;
+--source include/wait_for_slave_sql_error.inc
+--let $status_items= Last_Error
+--source include/show_slave_status.inc
+STOP SLAVE IO_THREAD;
+source include/wait_for_slave_to_stop.inc;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+show tables;
+show create table t2;
+--error ER_NO_SUCH_TABLE
+show create table t1;
+--error ER_NO_SUCH_TABLE
+show create table t3;
+
+--connection master
+drop table if exists t1;
+drop table if exists t2;
+drop table if exists t3;
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/sync_with_master_gtid.inc
+
+
+CALL mtr.add_suppression('Slave: Unknown storage engine .* Error_code: 1286');
+--source include/rpl_end.inc
diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test
index a9c20257c04..6eb0dc7bb81 100644
--- a/mysql-test/t/mysqld--help.test
+++ b/mysql-test/t/mysqld--help.test
@@ -42,7 +42,7 @@ perl;
$re2=join('|', @plugins);
$skip=0;
open(F, '<', "$ENV{MYSQL_TMP_DIR}/mysqld--help.txt") or die;
- print "Windows bug: happens when a new line is exactly at the right offset.\n";
+ print "Windows bug: new line disappears when it is exactly at the right offset.\n";
while (<F>) {
next if 1../The following groups are read/;
# formatting, skip line consisting entirely of dashes and blanks
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 01f31aceff7..0e0d69b515c 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -296,7 +296,7 @@ class Write_on_release_cache
public:
enum flag
{
- FLUSH_F
+ FLUSH_F= 1
};
typedef unsigned short flag_set;
diff --git a/sql/table.cc b/sql/table.cc
index f5b5bad99cc..d3b4cf3a3c0 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -564,14 +564,14 @@ inline bool is_system_table_name(const char *name, uint length)
SYNOPSIS
open_table_def()
- thd Thread handler
+ thd Thread handler
share Fill this with table definition
- db_flags Bit mask of the following flags: OPEN_VIEW
+ flags Bit mask of the following flags: OPEN_VIEW
NOTES
This function is called when the table definition is not cached in
table definition cache
- The data is returned in 'share', which is alloced by
+ The data is returned in 'share', which is allocated by
alloc_table_share().. The code assumes that share is initialized.
*/
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt
index 1d98d321486..0493e05a810 100644
--- a/storage/connect/CMakeLists.txt
+++ b/storage/connect/CMakeLists.txt
@@ -114,7 +114,6 @@ IF(CONNECT_WITH_LIBXML2)
FIND_PACKAGE(LibXml2)
IF (LIBXML2_FOUND)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
- SET(ZLIB_LIBRARY "z") # see ZLIB_INCLUDE_DIR below
SET(XML_LIBRARY ${LIBXML2_LIBRARIES})
SET(CONNECT_SOURCES ${CONNECT_SOURCES} libdoc.cpp libdoc.h)
add_definitions(-DLIBXML2_SUPPORT)
@@ -333,14 +332,6 @@ IF(NOT TARGET connect)
RETURN()
ENDIF()
-# Don't link with bundled zlib and systel libxml2 at the same time.
-# System libxml2 uses system zlib, might conflict with the bundled one.
-IF (XML_LIBRARY AND BUILD_BUNDLED_ZLIB)
- GET_PROPERTY(INCS TARGET connect PROPERTY INCLUDE_DIRECTORIES)
- LIST(REMOVE_ITEM INCS ${ZLIB_INCLUDE_DIR})
- SET_PROPERTY(TARGET connect PROPERTY INCLUDE_DIRECTORIES ${INCS})
-ENDIF()
-
IF(WIN32)
IF (libmongoc-1.0_FOUND)
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index cb1e9818d87..806c5a6a1d4 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -1113,26 +1113,26 @@ buf_page_is_corrupted(
the first page of each file of the system tablespace.
Ignore it for the system tablespace. */
if (!checksum_field1 && !checksum_field2) {
- ulint i = 0;
- do {
- if (read_buf[i]) {
- return true;
- }
- } while (++i < FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
-
+ /* Checksum fields can have valid value as zero.
+ If the page is not empty then do the checksum
+ calculation for the page. */
+ bool all_zeroes = true;
+ for (size_t i = 0; i < srv_page_size; i++) {
#ifndef UNIV_INNOCHECKSUM
- if (!space || !space->id) {
- /* Skip FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
- in the system tablespace. */
- i += 8;
- }
+ if (i == FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
+ && (!space || !space->id)) {
+ i += 8;
+ }
#endif
- do {
if (read_buf[i]) {
- return true;
+ all_zeroes = false;
+ break;
}
- } while (++i < srv_page_size);
- return false;
+ }
+
+ if (all_zeroes) {
+ return false;
+ }
}
switch (curr_algo) {
diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc
index ab72c15b541..9815e4ba56a 100644
--- a/storage/xtradb/buf/buf0buf.cc
+++ b/storage/xtradb/buf/buf0buf.cc
@@ -950,24 +950,25 @@ buf_page_is_corrupted(
the first page of each file of the system tablespace.
Ignore it for the system tablespace. */
if (!checksum_field1 && !checksum_field2) {
- ulint i = 0;
- do {
- if (read_buf[i]) {
- return true;
+ /* Checksum fields can have valid value as zero.
+ If the page is not empty then do the checksum
+ calculation for the page. */
+ bool all_zeroes = true;
+ for (size_t i = 0; i < srv_page_size; i++) {
+ if (i == FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
+ && (!space || space->id)) {
+ i += 8;
}
- } while (++i < FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
- if (!space || !space->id) {
- /* Skip FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
- in the system tablespace. */
- i += 8;
- }
- do {
if (read_buf[i]) {
- return true;
+ all_zeroes = false;
+ break;
}
- } while (++i < srv_page_size);
- return false;
+ }
+
+ if (all_zeroes) {
+ return false;
+ }
}
switch (curr_algo) {
diff --git a/support-files/rpm/server-postin.sh b/support-files/rpm/server-postin.sh
index 0a5bac73f0b..deb27c98ac1 100644
--- a/support-files/rpm/server-postin.sh
+++ b/support-files/rpm/server-postin.sh
@@ -50,7 +50,7 @@ if [ $1 = 1 ] ; then
# Change permissions so that the user that will run the MySQL daemon
# owns all database files.
- chown -R %{mysqld_user}:%{mysqld_group} $datadir
+ chown -R -f %{mysqld_user}:%{mysqld_group} $datadir
if [ ! -e $datadir/mysql ]; then
# Create data directory
diff --git a/zlib/CMakeLists.txt b/zlib/CMakeLists.txt
index 5d58f9a42b6..f654f98bfc4 100644
--- a/zlib/CMakeLists.txt
+++ b/zlib/CMakeLists.txt
@@ -124,6 +124,8 @@ string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
ADD_CONVENIENCE_LIBRARY(zlib STATIC
${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
+RESTRICT_SYMBOL_EXPORTS(zlib)
+
if(NOT CYGWIN)
# This property causes shared libraries on Linux to have the full version
@@ -142,7 +144,4 @@ if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
elseif(UNIX)
# On unix-like platforms the library is almost always called libz
set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
- if(NOT APPLE)
- set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
- endif()
endif()