From 155a8a5215ee98051fb28a138d21009d59d25ce4 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 3 Dec 2019 22:21:05 +0100 Subject: [PATCH 01/20] .clang-format - do *not* sort include files It is C++, not Java, the order of includes is often important. --- .clang-format | 1 - 1 file changed, 1 deletion(-) diff --git a/.clang-format b/.clang-format index 1ad93ead80a3d..725e4c67e024a 100644 --- a/.clang-format +++ b/.clang-format @@ -90,7 +90,6 @@ PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Right ReflowComments: true -SortIncludes: true SortUsingDeclarations: true SpaceAfterCStyleCast: true SpaceAfterLogicalNot: false From 05e72a33331bd9ad96ebbe4c844b94f0a5fb7390 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 3 Dec 2019 22:22:23 +0100 Subject: [PATCH 02/20] .clang-format - do not sort include files. It is C++, not Java, the order of includes is often important. --- .clang-format | 1 + 1 file changed, 1 insertion(+) diff --git a/.clang-format b/.clang-format index 725e4c67e024a..5fc6ab2362209 100644 --- a/.clang-format +++ b/.clang-format @@ -90,6 +90,7 @@ PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Right ReflowComments: true +SortIncludes: false SortUsingDeclarations: true SpaceAfterCStyleCast: true SpaceAfterLogicalNot: false From c5dafca87e8684749500708c6b83e9e2dae5b429 Mon Sep 17 00:00:00 2001 From: Axel Schwenke Date: Wed, 4 Dec 2019 14:28:13 +0100 Subject: [PATCH 03/20] MDEV-17571 Make systemd timeout behavior more compatible with long Galera SSTs Set an explicit start and stop timeout of 900 seconds for the MariaDB Server systemd service --- support-files/mariadb.service.in | 7 +++++++ support-files/mariadb@.service.in | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in index ef9fa5c2a22d3..ede97c041120a 100644 --- a/support-files/mariadb.service.in +++ b/support-files/mariadb.service.in @@ -120,6 +120,13 @@ UMask=007 # LOAD DATA INFILE you can enable PrivateTmp=true for a little more security. PrivateTmp=false +# Set an explicit Start and Stop timeout of 900 seconds (15 minutes!) +# this is the same value as used in SysV init scripts in the past +# Galera might need a longer timeout, check the KB if you want to change this: +# https://mariadb.com/kb/en/library/systemd/#configuring-the-systemd-service-timeout +TimeoutStartSec=900 +TimeoutStopSec=900 + ## ## Options previously available to be set via [mysqld_safe] ## that now needs to be set by systemd config files as mysqld_safe diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in index 8afae3bd09bf2..1f84b582e4e22 100644 --- a/support-files/mariadb@.service.in +++ b/support-files/mariadb@.service.in @@ -141,6 +141,13 @@ UMask=007 # LOAD DATA INFILE you can enable PrivateTmp=true for a little more security. PrivateTmp=false +# Set an explicit Start and Stop timeout of 900 seconds (15 minutes!) +# this is the same value as used in SysV init scripts in the past +# if you need a longer timeout, check the KB: +# https://mariadb.com/kb/en/library/systemd/#configuring-the-systemd-service-timeout +TimeoutStartSec=900 +TimeoutStopSec=900 + ## ## Options previously available to be set via [mysqld_safe] ## that now needs to be set by systemd config files as mysqld_safe From 3efbb5a16961a53299145075ad8312a514302afa Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Wed, 4 Dec 2019 23:40:33 +0200 Subject: [PATCH 04/20] List of unstable tests - intermediate update --- mysql-test/unstable-tests | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index c7b402361278d..6ed67cdba946e 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,7 +23,7 @@ # ############################################################################## # -# Based on 10.1 1bb857089fdcd3a08cb166cb6d75f3e1dbb76f27 +# Based on 10.1 05e72a33331bd9ad96ebbe4c844b94f0a5fb7390 main.alter_table_trans : MDEV-12084 - timeout main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result @@ -83,6 +83,7 @@ main.mysqlhotcopy_myisam : MDEV-10995 - test hangs on debug build main.mysqlslap : MDEV-11801 - timeout main.mysqltest : MDEV-9269 - fails on Alpha main.old-mode : MDEV-19373 - Wrong result +main.order_by : Modified in 10.1.44 main.order_by_innodb : Modified in 10.1.42 main.order_by_optimizer_innodb : MDEV-10683 - wrong execution plan main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock; modified in 10.1.42 @@ -97,7 +98,7 @@ main.query_cache : MDEV-12895 - Wrong result main.query_cache_debug : MDEV-15281 - Resize or similar command in progress main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away main.repair_symlink-5543 : Modified in 10.1.41 -main.selectivity : Modified in 10.1.42 +main.selectivity : Modified in 10.1.44 main.set_statement : MDEV-13183 - Wrong result main.show_explain : MDEV-10674 - sporadic failure main.sp : Modified in 10.1.42 @@ -151,6 +152,7 @@ binlog.load_data_stm_view : MDEV-16948 - Wrong result binlog_encryption.binlog_xa_recover : MDEV-12908 - Extra checkpoint binlog_encryption.encrypted_master : MDEV-12906 - Failed to sync +binlog_encryption.rpl_corruption : Include file modified in 10.1.44 binlog_encryption.rpl_parallel : MDEV-10653 - Timeout binlog_encryption.rpl_parallel_ignored_errors : Added in 10.1.42 binlog_encryption.rpl_relayrotate : MDEV-15194 - Timeout @@ -276,7 +278,7 @@ innodb.xa_recovery : MDEV-15279 - mysqld got exception innodb_fts.concurrent_insert : Modified in 10.1.42 innodb_fts.crash_recovery : Modified in 10.1.42 innodb_fts.innodb_ft_aux_table : Added in 10.1.41 -innodb_fts.innodb_fts_misc : Modified in 10.1.42 +innodb_fts.innodb_fts_misc : Modified in 10.1.44 innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning #----------------------------------------------------------------------- @@ -337,6 +339,7 @@ perfschema.connect_attrs : MDEV-17283 - Wrong result perfschema.func_file_io : MDEV-5708 - fails for s390x perfschema.func_mutex : MDEV-5708 - fails for s390x perfschema.hostcache_ipv6_ssl : MDEV-10696 - crash on shutdown +perfschema.misc : Modified in 10.1.44 perfschema.privilege_table_io : MDEV-13184 - Extra lines perfschema.rpl_gtid_func : MDEV-16897 - Wrong result perfschema.socket_summary_by_event_name_func : MDEV-10622 - Socket summary tables do not match @@ -376,6 +379,7 @@ rpl.rpl_binlog_index : MDEV-9501 - Warning: failed registerin rpl.rpl_blackhole : Modified in 10.1.41 rpl.rpl_blackhole_row_annotate : Added in 10.1.41 rpl.rpl_colSize : MDEV-16112 - Server crash +rpl.rpl_corruption : Include file modified in 10.1.44 rpl.rpl_create_or_replace_fail : Added in 10.1.42 rpl.rpl_ddl : MDEV-10417 - Fails on Mips rpl.rpl_domain_id_filter_io_crash : MDEV-14357 - Wrong result @@ -429,6 +433,7 @@ rpl.rpl_semi_sync : MDEV-11220 - Wrong result rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings +rpl.rpl_semi_sync_gtid_reconnect : Added in 10.1.44 rpl.rpl_semi_sync_skip_repl : Modified in 10.1.41 rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Wrong plugin status; modified in 10.1.41 rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition From d78f02d73d5b2f962c0ea6a1198e932c7355adc2 Mon Sep 17 00:00:00 2001 From: Axel Schwenke Date: Wed, 4 Dec 2019 14:28:13 +0100 Subject: [PATCH 05/20] MDEV-17571 Make systemd timeout behavior more compatible with long Galera SSTs Set an explicit start and stop timeout of 900 seconds for the MariaDB Server systemd service --- support-files/mariadb.service.in | 7 +++++++ support-files/mariadb@.service.in | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in index ef9fa5c2a22d3..ede97c041120a 100644 --- a/support-files/mariadb.service.in +++ b/support-files/mariadb.service.in @@ -120,6 +120,13 @@ UMask=007 # LOAD DATA INFILE you can enable PrivateTmp=true for a little more security. PrivateTmp=false +# Set an explicit Start and Stop timeout of 900 seconds (15 minutes!) +# this is the same value as used in SysV init scripts in the past +# Galera might need a longer timeout, check the KB if you want to change this: +# https://mariadb.com/kb/en/library/systemd/#configuring-the-systemd-service-timeout +TimeoutStartSec=900 +TimeoutStopSec=900 + ## ## Options previously available to be set via [mysqld_safe] ## that now needs to be set by systemd config files as mysqld_safe diff --git a/support-files/mariadb@.service.in b/support-files/mariadb@.service.in index 8afae3bd09bf2..1f84b582e4e22 100644 --- a/support-files/mariadb@.service.in +++ b/support-files/mariadb@.service.in @@ -141,6 +141,13 @@ UMask=007 # LOAD DATA INFILE you can enable PrivateTmp=true for a little more security. PrivateTmp=false +# Set an explicit Start and Stop timeout of 900 seconds (15 minutes!) +# this is the same value as used in SysV init scripts in the past +# if you need a longer timeout, check the KB: +# https://mariadb.com/kb/en/library/systemd/#configuring-the-systemd-service-timeout +TimeoutStartSec=900 +TimeoutStopSec=900 + ## ## Options previously available to be set via [mysqld_safe] ## that now needs to be set by systemd config files as mysqld_safe From 2b7e461cc06ea5ca167e16ff643f0b597aba118d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 5 Dec 2019 12:39:04 +0200 Subject: [PATCH 06/20] MDEV-21209 : mysql_tzinfo_to_sql's Galera checks do not work wsrep_on parameter can be visible even when wsrep_on is set OFF so we need to check variable_value from I_S also. --- .../r/mysql_tzinfo_to_sql_symlink.result | 20 +++++++++---------- .../r/mysql_tzinfo_to_sql_symlink.result | 16 +++++++-------- .../r/mysql_tzinfo_to_sql_symlink_skip.result | 8 ++++---- .../wsrep/t/mysql_tzinfo_to_sql_symlink.opt | 3 +++ .../wsrep/t/mysql_tzinfo_to_sql_symlink.test | 1 + .../t/mysql_tzinfo_to_sql_symlink_skip.opt | 3 +++ .../t/mysql_tzinfo_to_sql_symlink_skip.test | 1 + sql/tztime.cc | 10 +++++----- 8 files changed, 35 insertions(+), 27 deletions(-) create mode 100644 mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.opt create mode 100644 mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.opt diff --git a/mysql-test/r/mysql_tzinfo_to_sql_symlink.result b/mysql-test/r/mysql_tzinfo_to_sql_symlink.result index e33a519e8979f..fc9ddce08b149 100644 --- a/mysql-test/r/mysql_tzinfo_to_sql_symlink.result +++ b/mysql-test/r/mysql_tzinfo_to_sql_symlink.result @@ -4,7 +4,7 @@ # Verbose run \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; @@ -36,7 +36,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=MyISAM; ALTER TABLE time_zone_name ENGINE=MyISAM; ALTER TABLE time_zone_transition ENGINE=MyISAM; @@ -46,7 +46,7 @@ END IF| # Silent run \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; @@ -75,7 +75,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=MyISAM; ALTER TABLE time_zone_name ENGINE=MyISAM; ALTER TABLE time_zone_transition ENGINE=MyISAM; @@ -93,7 +93,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, ; \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=MyISAM; ALTER TABLE time_zone_name ENGINE=MyISAM; ALTER TABLE time_zone_transition ENGINE=MyISAM; @@ -105,21 +105,21 @@ END IF| # \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone_leap_second ENGINE=InnoDB; END IF| \d ; TRUNCATE TABLE time_zone_leap_second; \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone_leap_second ENGINE=MyISAM; END IF| \d ; ALTER TABLE time_zone_leap_second ORDER BY Transition_time; \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=MyISAM; ALTER TABLE time_zone_name ENGINE=MyISAM; ALTER TABLE time_zone_transition ENGINE=MyISAM; @@ -131,7 +131,7 @@ END IF| # \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; @@ -146,7 +146,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=MyISAM; ALTER TABLE time_zone_name ENGINE=MyISAM; ALTER TABLE time_zone_transition ENGINE=MyISAM; diff --git a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result index 9a0abd4460aeb..1e6ebbbd34d09 100644 --- a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result +++ b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink.result @@ -4,7 +4,7 @@ # Verbose run \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; @@ -36,7 +36,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=MyISAM; ALTER TABLE time_zone_name ENGINE=MyISAM; ALTER TABLE time_zone_transition ENGINE=MyISAM; @@ -46,7 +46,7 @@ END IF| # Silent run \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=InnoDB; ALTER TABLE time_zone_name ENGINE=InnoDB; ALTER TABLE time_zone_transition ENGINE=InnoDB; @@ -75,7 +75,7 @@ ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=MyISAM; ALTER TABLE time_zone_name ENGINE=MyISAM; ALTER TABLE time_zone_transition ENGINE=MyISAM; @@ -93,7 +93,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, ; \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=MyISAM; ALTER TABLE time_zone_name ENGINE=MyISAM; ALTER TABLE time_zone_transition ENGINE=MyISAM; @@ -105,21 +105,21 @@ END IF| # \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone_leap_second ENGINE=InnoDB; END IF| \d ; TRUNCATE TABLE time_zone_leap_second; \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone_leap_second ENGINE=MyISAM; END IF| \d ; ALTER TABLE time_zone_leap_second ORDER BY Transition_time; \d | IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on') = 1 THEN +variable_name='wsrep_on' and variable_value='ON') = 1 THEN ALTER TABLE time_zone ENGINE=MyISAM; ALTER TABLE time_zone_name ENGINE=MyISAM; ALTER TABLE time_zone_transition ENGINE=MyISAM; diff --git a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result index 4ce57c641b34c..85c4d858be296 100644 --- a/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result +++ b/mysql-test/suite/wsrep/r/mysql_tzinfo_to_sql_symlink_skip.result @@ -2,7 +2,7 @@ # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above # # Verbose run -set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); +set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); prepare set_wsrep_write_binlog from @prep1; set @toggle=0; execute set_wsrep_write_binlog using @toggle; TRUNCATE TABLE time_zone; @@ -29,7 +29,7 @@ Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid in ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; # Silent run -set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); +set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); prepare set_wsrep_write_binlog from @prep1; set @toggle=0; execute set_wsrep_write_binlog using @toggle; TRUNCATE TABLE time_zone; @@ -55,7 +55,7 @@ ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; # # Testing with explicit timezonefile # -set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); +set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); prepare set_wsrep_write_binlog from @prep1; set @toggle=0; execute set_wsrep_write_binlog using @toggle; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); @@ -67,7 +67,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, # # Testing --leap # -set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); +set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); prepare set_wsrep_write_binlog from @prep1; set @toggle=0; execute set_wsrep_write_binlog using @toggle; TRUNCATE TABLE time_zone_leap_second; diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.opt b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.opt new file mode 100644 index 0000000000000..864f7342cc7f2 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.opt @@ -0,0 +1,3 @@ +--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1 --binlog_format=ROW + + diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test index 100e09d3afba3..875546356662a 100644 --- a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test +++ b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test @@ -1,6 +1,7 @@ --source include/have_wsrep.inc --source include/have_symlink.inc --source include/not_windows.inc +--source include/have_innodb.inc --echo # --echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.opt b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.opt new file mode 100644 index 0000000000000..864f7342cc7f2 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.opt @@ -0,0 +1,3 @@ +--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1 --binlog_format=ROW + + diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test index bb3009bd43215..ab1f94cc1cf74 100644 --- a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test +++ b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test @@ -1,6 +1,7 @@ --source include/have_wsrep.inc --source include/have_symlink.inc --source include/not_windows.inc +--source include/have_innodb.inc --echo # --echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above diff --git a/sql/tztime.cc b/sql/tztime.cc index 8f66dfa0c9e79..960dde38237c5 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -2443,7 +2443,7 @@ print_tz_leaps_as_sql(const TIME_ZONE_INFO *sp) if (!opt_skip_write_binlog) printf("\\d |\n" "IF (select count(*) from information_schema.global_variables where\n" - "variable_name='wsrep_on') = 1 THEN\n" + "variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n" "ALTER TABLE time_zone_leap_second ENGINE=InnoDB;\n" "END IF|\n" "\\d ;\n"); @@ -2463,7 +2463,7 @@ print_tz_leaps_as_sql(const TIME_ZONE_INFO *sp) if (!opt_skip_write_binlog) printf("\\d |\n" "IF (select count(*) from information_schema.global_variables where\n" - "variable_name='wsrep_on') = 1 THEN\n" + "variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n" "ALTER TABLE time_zone_leap_second ENGINE=MyISAM;\n" "END IF|\n" "\\d ;\n"); @@ -2719,7 +2719,7 @@ main(int argc, char **argv) sql_log_bin and wsrep_on to avoid Galera replicating below truncate table clauses. This will allow user to set different time zones to nodes in Galera cluster. */ - printf("set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');\n" + printf("set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');\n" "prepare set_wsrep_write_binlog from @prep1;\n" "set @toggle=0; execute set_wsrep_write_binlog using @toggle;\n"); @@ -2735,7 +2735,7 @@ main(int argc, char **argv) // to allow changes to them to replicate with Galera printf("\\d |\n" "IF (select count(*) from information_schema.global_variables where\n" - "variable_name='wsrep_on') = 1 THEN\n" + "variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n" "ALTER TABLE time_zone ENGINE=InnoDB;\n" "ALTER TABLE time_zone_name ENGINE=InnoDB;\n" "ALTER TABLE time_zone_transition ENGINE=InnoDB;\n" @@ -2790,7 +2790,7 @@ main(int argc, char **argv) // Fall back to MyISAM printf("\\d |\n" "IF (select count(*) from information_schema.global_variables where\n" - "variable_name='wsrep_on') = 1 THEN\n" + "variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n" "ALTER TABLE time_zone ENGINE=MyISAM;\n" "ALTER TABLE time_zone_name ENGINE=MyISAM;\n" "ALTER TABLE time_zone_transition ENGINE=MyISAM;\n" From 42bad56aab25db4a05c676ba99290949ad4e1c34 Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Wed, 4 Dec 2019 22:29:33 +0700 Subject: [PATCH 07/20] MDEV-21014 MTR does not detect {A,M,T,L,UB}SAN errors which happen upon server shutdown Let MTR check for error existence after running a test and return it back to user. Error reporting itset might be much better, but first of all we need to see that something went wrong. --- mysql-test/mysql-test-run.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index a44dbe92a3d01..77c307727a611 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4401,6 +4401,8 @@ ($$) qr/missing DBUG_RETURN/, qr/Attempting backtrace/, qr/Assertion .* failed/, + qr/Sanitizer/, + qr/runtime error:/, ); # These are taken from the include/mtr_warnings.sql global suppression # list. They occur delayed, so they can be parsed during shutdown rather From e949b2d4abac99ffbc68bfd8c39a74e30caa3902 Mon Sep 17 00:00:00 2001 From: Sujatha Date: Fri, 6 Dec 2019 19:56:23 +0530 Subject: [PATCH 08/20] MDEV-20959: binlog.binlog_parallel_replication_marks_row fails in buildbot with wrong result Problem: ======= Test "binlog.binlog_parallel_replication_marks_row" fails sporadically due to result length mismatch. Analysis: ========= Test generates a binary log and it looks for certain words within the binary log file and prints them. For example word like "GTID,BEGIN,COMMIT ...". Binary log output contains base64 encoded characters. Occasionally the encoded characters match with the above words and results in test failure. +XwoFWxMBAAAALgAAAGEDAAAAAB8AAAAAAAEABHRlc3QAAnQxAAIDAwACFGTIDQ== +AAAAAAAAAAAEEwQADQgICAoKCgGTIDw9 Fix: === Improve the regular expression to match exact words. --- mysql-test/include/binlog_parallel_replication_marks.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/include/binlog_parallel_replication_marks.test b/mysql-test/include/binlog_parallel_replication_marks.test index 4e673bd30c321..6e22c7dd75ec7 100644 --- a/mysql-test/include/binlog_parallel_replication_marks.test +++ b/mysql-test/include/binlog_parallel_replication_marks.test @@ -79,7 +79,7 @@ while () { s/end_log_pos \d+/end_log_pos #/; s/table id \d+/table id #/; s/mapped to number \d+/mapped to number #/; - print if /GTID|BEGIN|COMMIT|Table_map|Write_rows|Update_rows|Delete_rows|generated by server|40005 TEMPORARY/; + print if /\b(GTID|BEGIN|COMMIT|Table_map|Write_rows|Update_rows|Delete_rows|generated by server|40005 TEMPORARY)\b/; } close F; EOF From 8d2f6d3ca5f9a4c07cced6204c7a36028fd9a544 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 11 Dec 2019 16:57:59 +0100 Subject: [PATCH 09/20] Fix overly chatty connect cmake, once again --- storage/connect/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index 7fc73bce59eb2..4ff9afd486be0 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -322,10 +322,8 @@ ENDIF(CONNECT_WITH_MONGO) OPTION(CONNECT_WITH_REST "Compile CONNECT storage engine with REST support" ON) IF(CONNECT_WITH_REST) - MESSAGE(STATUS "=====> REST support is ON") - FIND_PACKAGE(cpprestsdk) + FIND_PACKAGE(cpprestsdk QUIET) IF (cpprestsdk_FOUND) - MESSAGE(STATUS "=====> cpprestsdk found") IF(UNIX) # INCLUDE_DIRECTORIES(${CPPRESTSDK_INCLUDE_DIR}) # If needed edit next line to set the path to libcpprest.so @@ -334,8 +332,6 @@ IF(CONNECT_WITH_REST) ENDIF(UNIX) SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp restget.cpp tabrest.h) add_definitions(-DREST_SUPPORT) - ELSE(NOT cpprestsdk_FOUND) - MESSAGE(STATUS "=====> cpprestsdk package not found") ENDIF (cpprestsdk_FOUND) ENDIF(CONNECT_WITH_REST) From a3a8360d577b44131577c5d40336c632d35487ae Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 12 Dec 2019 00:05:55 +0100 Subject: [PATCH 10/20] CMake,Windows - cleanup data directory prior to bootstrap for nitial_database target --- sql/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 6362ed2c561f0..3f6b3e694d1fd 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -401,9 +401,11 @@ IF(WIN32 AND MYSQLD_EXECUTABLE) MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/data) ADD_CUSTOM_COMMAND( OUTPUT initdb.dep - COMMAND ${CMAKE_COMMAND} + COMMAND ${CMAKE_COMMAND} -E remove_directory data + COMMAND ${CMAKE_COMMAND} -E make_directory data + COMMAND ${CMAKE_COMMAND} -E chdir data ${CMAKE_COMMAND} ${CONFIG_PARAM} -P ${CMAKE_CURRENT_BINARY_DIR}/create_initial_db.cmake - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ DEPENDS mysqld ) ADD_CUSTOM_TARGET(initial_database From 91c3d99804e4154b87440712f8c6a5fee04c3dd0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 13 Dec 2019 11:23:04 +0100 Subject: [PATCH 11/20] tokudb: fix to compile with gcc 9.2.0 --- storage/tokudb/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index 9bff7d4729f14..ed8023075192c 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -30,6 +30,12 @@ IF (HAVE_WVLA) SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wno-vla") ENDIF() +CHECK_C_COMPILER_FLAG("-Wno-address-of-packed-member" HAVE_NO_ADDRESS_PACKED) +IF(HAVE_NO_ADDRESS_PACKED) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-address-of-packed-member") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-address-of-packed-member") +ENDIF() + ############################################ SET(TOKUDB_VERSION "tokudb-7.5.7") SET(TOKUDB_DEB_FILES "usr/lib/mysql/plugin/ha_tokudb.so\netc/mysql/conf.d/tokudb.cnf\nusr/bin/tokuftdump\nusr/share/doc/mariadb-server-5.5/README-TOKUDB\nusr/share/doc/mariadb-server-5.5/README.md" PARENT_SCOPE) From 794911a27a14ea83eda054cf34d94b43191aa19e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 13 Dec 2019 11:23:29 +0100 Subject: [PATCH 12/20] tokudb: disable check_huge_pages_in_practice() crashes on Debian 10 --- storage/tokudb/ft-index/portability/huge_page_detection.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/tokudb/ft-index/portability/huge_page_detection.cc b/storage/tokudb/ft-index/portability/huge_page_detection.cc index ca42898748699..ea0eb568e4cd4 100644 --- a/storage/tokudb/ft-index/portability/huge_page_detection.cc +++ b/storage/tokudb/ft-index/portability/huge_page_detection.cc @@ -120,6 +120,7 @@ static bool check_huge_pages_config_file(const char *fname) static bool check_huge_pages_in_practice(void) // Effect: Return true if huge pages appear to be defined in practice. { + return false; // disabled, doesn't seem to work on newest distros #ifdef HAVE_MINCORE #ifdef HAVE_MAP_ANONYMOUS const int map_anonymous = MAP_ANONYMOUS; From fc860d3fa3bc854fbe6aab9179d7a4aaf6eb9edf Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 16 Dec 2019 12:57:08 +0400 Subject: [PATCH 13/20] MDEV-21065 UNIQUE constraint causes a query with string comparison to omit a row in the result set --- mysql-test/r/type_int.result | 13 +++++++++++++ mysql-test/t/type_int.test | 12 ++++++++++++ strings/ctype-simple.c | 3 ++- strings/my_strtoll10.c | 17 ++++++++++++----- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/type_int.result b/mysql-test/r/type_int.result index aaf3569030650..c8b7749010249 100644 --- a/mysql-test/r/type_int.result +++ b/mysql-test/r/type_int.result @@ -20,5 +20,18 @@ COALESCE(@a) 1 DROP TABLE t1; # +# MDEV-21065 UNIQUE constraint causes a query with string comparison to omit a row in the result set +# +CREATE TABLE t1 (c0 INT UNIQUE); +INSERT INTO t1 VALUES (NULL), (NULL), (NULL), (NULL), (1), (0); +SELECT * FROM t1 WHERE c0 < '\n2'; +c0 +0 +1 +DROP TABLE t1; +SELECT CAST('\n2' AS INT); +CAST('\n2' AS INT) +2 +# # End of 5.5 tests # diff --git a/mysql-test/t/type_int.test b/mysql-test/t/type_int.test index 52be12bf49403..cc8b386aebe66 100644 --- a/mysql-test/t/type_int.test +++ b/mysql-test/t/type_int.test @@ -14,6 +14,18 @@ SELECT COALESCE(@a:=1) FROM t1 ORDER BY STRCMP(STDDEV_SAMP(a), 'bar'); SELECT COALESCE(@a) FROM t1 ORDER BY STRCMP(STDDEV_SAMP(a), 'bar'); DROP TABLE t1; +--echo # +--echo # MDEV-21065 UNIQUE constraint causes a query with string comparison to omit a row in the result set +--echo # + +CREATE TABLE t1 (c0 INT UNIQUE); +INSERT INTO t1 VALUES (NULL), (NULL), (NULL), (NULL), (1), (0); +SELECT * FROM t1 WHERE c0 < '\n2'; +DROP TABLE t1; + +SELECT CAST('\n2' AS INT); + + --echo # --echo # End of 5.5 tests --echo # diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index ba446a7df547b..e5a1471cf63b0 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -1399,7 +1399,8 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)), int shift= 0, digits= 0, negative, addon; /* Skip leading spaces and tabs */ - for ( ; str < end && (*str == ' ' || *str == '\t') ; str++); + for ( ; str < end && my_isspace(&my_charset_latin1, *str) ; ) + str++; if (str >= end) goto ret_edom; diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c index 89450f15c9fa2..01c3697dcdf8c 100644 --- a/strings/my_strtoll10.c +++ b/strings/my_strtoll10.c @@ -98,18 +98,25 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error) if (endptr) { end= *endptr; - while (s != end && (*s == ' ' || *s == '\t')) + /* Skip leading spaces */ + for ( ; s < end && my_isspace(&my_charset_latin1, *s) ; ) s++; + if (s == end) goto no_conv; } else { endptr= &dummy; /* Easier end test */ - while (*s == ' ' || *s == '\t') - s++; - if (!*s) - goto no_conv; + /* Skip leading spaces */ + for ( ; ; s++) + { + if (!*s) + goto no_conv; + if (!my_isspace(&my_charset_latin1, *s)) + break; + } + /* This number must be big to guard against a lot of pre-zeros */ end= s+65535; /* Can't be longer than this */ } From 0ac0bc8cb6ac1f9b2611da63d9e06095571422fe Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 18 Dec 2019 12:34:14 +0300 Subject: [PATCH 14/20] MDEV-21341: Fix optimizer-related UBSAN failures, part #1: Fix wrong typecast --- sql/sql_select.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ca53852fa91a9..40941294013a7 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -14157,7 +14157,7 @@ static COND* substitute_for_best_equal_field(THD *thd, JOIN_TAB *context_tab, } } else if (cond->type() == Item::FUNC_ITEM && - ((Item_cond*) cond)->functype() == Item_func::MULT_EQUAL_FUNC) + ((Item_func*) cond)->functype() == Item_func::MULT_EQUAL_FUNC) { item_equal= (Item_equal *) cond; item_equal->sort(&compare_fields_by_table_order, table_join_idx); From 8b9db11718af0c61e8d3cdbb634cf273b8998f98 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 18 Dec 2019 12:56:54 +0300 Subject: [PATCH 15/20] MDEV-21341: Fix optimizer-related UBSAN failures, part #2 Remove Query_tables_list::lock_tables_state - it is not used and it causes errors like this: sql_lex.h:1675:7: runtime error: load of value 2779096485, which is not a valid value for type 'enum_lock_tables_state' --- sql/sql_lex.h | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 4462d541e5ff2..cdf80daa928cb 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1190,28 +1190,6 @@ class Query_tables_list Sroutine_hash_entry **sroutines_list_own_last; uint sroutines_list_own_elements; - /** - Locking state of tables in this particular statement. - - If we under LOCK TABLES or in prelocked mode we consider tables - for the statement to be "locked" if there was a call to lock_tables() - (which called handler::start_stmt()) for tables of this statement - and there was no matching close_thread_tables() call. - - As result this state may differ significantly from one represented - by Open_tables_state::lock/locked_tables_mode more, which are always - "on" under LOCK TABLES or in prelocked mode. - */ - enum enum_lock_tables_state { - LTS_NOT_LOCKED = 0, - LTS_LOCKED - }; - enum_lock_tables_state lock_tables_state; - bool is_query_tables_locked() - { - return (lock_tables_state == LTS_LOCKED); - } - /** Number of tables which were open by open_tables() and to be locked by lock_tables(). From 984b3c15449e0b5c7b3d66047a3c490c7be40faf Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 18 Dec 2019 13:11:07 +0300 Subject: [PATCH 16/20] MDEV-21341: Fix UBSAN failures, part #3 One may not call memcpy(dst, src=NULL, size), even if size==0. --- sql/unireg.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/unireg.cc b/sql/unireg.cc index b9abe3da1b9ab..b116218b60e1c 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -297,7 +297,8 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table, pos+= reclength; int2store(pos, create_info->connect_string.length); pos+= 2; - memcpy(pos, create_info->connect_string.str, create_info->connect_string.length); + if (create_info->connect_string.length) + memcpy(pos, create_info->connect_string.str, create_info->connect_string.length); pos+= create_info->connect_string.length; int2store(pos, str_db_type.length); pos+= 2; From 3d3d8f10120dd2311ef8195d19389c4a1e85786b Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Tue, 17 Dec 2019 21:50:58 +0800 Subject: [PATCH 17/20] MDEV-21337 fix aligned_malloc() do not fallback to malloc(), always return properly aligned buffer --- storage/innobase/CMakeLists.txt | 5 ----- storage/innobase/buf/buf0buf.cc | 17 +++++++---------- storage/xtradb/CMakeLists.txt | 5 ----- storage/xtradb/buf/buf0buf.cc | 9 +++------ 4 files changed, 10 insertions(+), 26 deletions(-) diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 44db4552e7416..6558c3ae0dc47 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -94,11 +94,6 @@ IF(NOT MSVC) SET_SOURCE_FILES_PROPERTIES(trx/trx0rec.cc PROPERTIES COMPILE_FLAGS -O1) ENDIF() - CHECK_FUNCTION_EXISTS(posix_memalign HAVE_POSIX_MEMALIGN) - IF(HAVE_POSIX_MEMALIGN) - ADD_DEFINITIONS(-DHAVE_POSIX_MEMALIGN) - ENDIF() - # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not # workaround for old gcc on x86, gcc atomic ops only work under -march=i686 IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 4d5b3f29f8272..b6aab663f3cb6 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -82,19 +82,16 @@ Created 11/5/1995 Heikki Tuuri #include "snappy-c.h" #endif -inline void* aligned_malloc(size_t size, size_t align) { - void *result; +static void *aligned_malloc(size_t size, size_t align) +{ #ifdef _MSC_VER - result = _aligned_malloc(size, align); -#elif defined (HAVE_POSIX_MEMALIGN) - if(posix_memalign(&result, align, size)) { - result = 0; - } + return _aligned_malloc(size, align); #else - /* Use unaligned malloc as fallback */ - result = malloc(size); + void *result; + if (posix_memalign(&result, align, size)) + result= NULL; #endif - return result; + return result; } inline void aligned_free(void *ptr) { diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt index cc269b442014a..465d93eafc5ae 100644 --- a/storage/xtradb/CMakeLists.txt +++ b/storage/xtradb/CMakeLists.txt @@ -93,11 +93,6 @@ MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-class-memaccess") IF(NOT MSVC) - CHECK_FUNCTION_EXISTS(posix_memalign HAVE_POSIX_MEMALIGN) - IF(HAVE_POSIX_MEMALIGN) - ADD_DEFINITIONS(-DHAVE_POSIX_MEMALIGN) - ENDIF() - # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not # workaround for old gcc on x86, gcc atomic ops only work under -march=i686 IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc index 6ddcc3521daca..398e1e84994b1 100644 --- a/storage/xtradb/buf/buf0buf.cc +++ b/storage/xtradb/buf/buf0buf.cc @@ -92,17 +92,14 @@ buf_mark_space_corrupt( /* prototypes for new functions added to ha_innodb.cc */ trx_t* innobase_get_trx(); -inline void* aligned_malloc(size_t size, size_t align) { +static void* aligned_malloc(size_t size, size_t align) { void *result; #ifdef _MSC_VER result = _aligned_malloc(size, align); -#elif defined (HAVE_POSIX_MEMALIGN) +#else if(posix_memalign(&result, align, size)) { - result = 0; + result = NULL; } -#else - /* Use unaligned malloc as fallback */ - result = malloc(size); #endif return result; } From a5a433e256d29f00b6b51babcf0aac49e95c7e82 Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Wed, 18 Dec 2019 23:35:33 +0800 Subject: [PATCH 18/20] fix windows compilation --- storage/innobase/buf/buf0buf.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index b6aab663f3cb6..136d46b702722 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -90,8 +90,8 @@ static void *aligned_malloc(size_t size, size_t align) void *result; if (posix_memalign(&result, align, size)) result= NULL; -#endif return result; +#endif } inline void aligned_free(void *ptr) { From 1f1e3ce8a18ab548f9641ea10295372abbd147ad Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 19 Dec 2019 14:03:54 +0400 Subject: [PATCH 19/20] MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, but 1 result in 10.1.41 Item_ref::val_(datetime|time)_packed() erroneously called (*ref)->val_(datetime|time)_packed(). - Fixing to call (*ref)->val_(datetime|time)_packed_result(). - Backporting Item::val_(datetime|time)_packed_result() from 10.3. - Fixing Item_field::get_date_result() to handle null_value in the same way how Item_field::get_date() does. --- mysql-test/r/type_datetime.result | 81 +++++++++++++++++++++++++++++++ mysql-test/r/type_time.result | 66 +++++++++++++++++++++++++ mysql-test/t/type_datetime.test | 43 ++++++++++++++++ mysql-test/t/type_time.test | 34 +++++++++++++ sql/item.cc | 24 +++++++-- sql/item.h | 7 +++ 6 files changed, 250 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 591df19a9c660..3468ff67b533c 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -1198,5 +1198,86 @@ Warning 1292 Incorrect datetime value: '2' for column 'pk' at row 2 DROP VIEW v1; DROP TABLE t1; # +# MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, but 1 result in 10.1.41 +# +CREATE TABLE t1 +( +id INT NOT NULL PRIMARY KEY, +id2 INT, +k TINYINT, +j INT, +t DATETIME, +KEY k1 (id2,k,j,t) +); +INSERT INTO t1 VALUES +(53,54,1,0,'2019-12-13 10:09:59'), +(54,54,1,0,'2019-12-13 16:28:41'), +(55,54,1,0,'2019-12-13 16:29:10'), +(56,54,1,0,'2019-12-13 16:29:43'), +(57,54,1,0,'2019-12-13 16:30:16'), +(58,54,1,0,'2019-12-13 16:30:49'), +(59,54,1,0,'2019-12-13 16:31:23'), +(60,54,1,0,'2019-12-13 16:31:55'), +(61,54,1,0,'2019-12-13 16:32:28'), +(62,54,1,0,'2019-12-13 16:33:01'), +(63,54,1,0,'2019-12-13 16:33:34'), +(64,54,1,0,'2019-12-13 16:34:07'), +(65,54,1,0,'2019-12-13 16:34:40'), +(66,54,1,0,'2019-12-13 16:35:13'), +(67,54,1,0,'2019-12-13 16:35:46'), +(68,54,1,0,'2019-12-13 16:36:19'); +SELECT t FROM t1 GROUP BY t HAVING t=max(t); +t +2019-12-13 10:09:59 +2019-12-13 16:28:41 +2019-12-13 16:29:10 +2019-12-13 16:29:43 +2019-12-13 16:30:16 +2019-12-13 16:30:49 +2019-12-13 16:31:23 +2019-12-13 16:31:55 +2019-12-13 16:32:28 +2019-12-13 16:33:01 +2019-12-13 16:33:34 +2019-12-13 16:34:07 +2019-12-13 16:34:40 +2019-12-13 16:35:13 +2019-12-13 16:35:46 +2019-12-13 16:36:19 +SELECT t FROM t1 WHERE id2=54 and j=0 and k=1 GROUP BY t HAVING t=max(t); +t +2019-12-13 10:09:59 +2019-12-13 16:28:41 +2019-12-13 16:29:10 +2019-12-13 16:29:43 +2019-12-13 16:30:16 +2019-12-13 16:30:49 +2019-12-13 16:31:23 +2019-12-13 16:31:55 +2019-12-13 16:32:28 +2019-12-13 16:33:01 +2019-12-13 16:33:34 +2019-12-13 16:34:07 +2019-12-13 16:34:40 +2019-12-13 16:35:13 +2019-12-13 16:35:46 +2019-12-13 16:36:19 +DROP TABLE t1; +CREATE TABLE t1 (pk INT); +CREATE VIEW v1 AS SELECT * FROM t1; +INSERT INTO t1 VALUES (1); +SELECT pkis_null() || result_field->get_date(ltime,fuzzydate)) + if ((null_value= result_field->is_null()) || + result_field->get_date(ltime, fuzzydate)) { bzero((char*) ltime,sizeof(*ltime)); - return (null_value= 1); + return true; } - return (null_value= 0); + return false; } @@ -7313,7 +7327,7 @@ bool Item_ref::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate) longlong Item_ref::val_datetime_packed() { DBUG_ASSERT(fixed); - longlong tmp= (*ref)->val_datetime_packed(); + longlong tmp= (*ref)->val_datetime_packed_result(); null_value= (*ref)->null_value; return tmp; } @@ -7322,7 +7336,7 @@ longlong Item_ref::val_datetime_packed() longlong Item_ref::val_time_packed() { DBUG_ASSERT(fixed); - longlong tmp= (*ref)->val_time_packed(); + longlong tmp= (*ref)->val_time_packed_result(); null_value= (*ref)->null_value; return tmp; } diff --git a/sql/item.h b/sql/item.h index fb11064f1224e..bea09620ef8cc 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1302,6 +1302,13 @@ class Item: public Value_source, uint fuzzydate= TIME_FUZZY_DATES | TIME_INVALID_DATES | TIME_TIME_ONLY; return get_date(<ime, fuzzydate) ? 0 : pack_time(<ime); } + longlong val_datetime_packed_result(); + longlong val_time_packed_result() + { + MYSQL_TIME ltime; + uint fuzzydate= TIME_TIME_ONLY | TIME_INVALID_DATES | TIME_FUZZY_DATES; + return get_date_result(<ime, fuzzydate) ? 0 : pack_time(<ime); + } // Get a temporal value in packed DATE/DATETIME or TIME format longlong val_temporal_packed(enum_field_types f_type) { From aade6e53d398dd287ca7e771191c9975099b4fa1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 20 Dec 2019 19:47:31 +0100 Subject: [PATCH 20/20] fix a bad merge in 10.1+ one should use MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-address-of-packed-member") and it's already done in storage/tokudb/PerconaFT/CMakeLists.txt --- storage/tokudb/CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index 7313a4dcce49f..618d257be29e6 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -49,12 +49,6 @@ MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-vla" DEBUG) MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-implicit-fallthrough") MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-cpp" DEBUG) -CHECK_C_COMPILER_FLAG("-Wno-address-of-packed-member" HAVE_NO_ADDRESS_PACKED) -IF(HAVE_NO_ADDRESS_PACKED) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-address-of-packed-member") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-address-of-packed-member") -ENDIF() - ############################################ SET(TOKUDB_DEB_FILES "usr/lib/mysql/plugin/ha_tokudb.so\netc/mysql/conf.d/tokudb.cnf\nusr/bin/tokuftdump" PARENT_SCOPE) MARK_AS_ADVANCED(BUILDNAME)