Skip to content

Commit c59985f

Browse files
committed
Merge 10.5 into 10.6
2 parents bb29712 + 846112c commit c59985f

File tree

12 files changed

+180
-63
lines changed

12 files changed

+180
-63
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,10 @@ INSTALL_DOCUMENTATION(README.md CREDITS COPYING THIRDPARTY COMPONENT Readme)
538538
# ${CMAKE_BINARY_DIR}/Docs/INFO_BIN)
539539

540540
IF(UNIX)
541-
INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY Docs/README-wsrep COMPONENT Readme)
541+
INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY COMPONENT Readme)
542+
IF(WITH_WSREP)
543+
INSTALL_DOCUMENTATION(Docs/README-wsrep COMPONENT Readme)
544+
ENDIF()
542545
ENDIF()
543546

544547
INCLUDE(build_depends)

cmake/install_macros.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,11 @@ SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug
265265

266266
FUNCTION(INSTALL_MYSQL_TEST from to)
267267
IF(INSTALL_MYSQLTESTDIR)
268+
IF(NOT WITH_WSREP)
269+
SET(EXCL_GALERA "(suite/(galera|wsrep|sys_vars/[rt]/(sysvars_)?wsrep).*|include/((w.*)?wsrep.*|.*galera.*)\\.inc|std_data/(galera|wsrep).*)")
270+
ELSE()
271+
SET(EXCL_GALERA "^DOES_NOT_EXIST$")
272+
ENDIF()
268273
INSTALL(
269274
DIRECTORY ${from}
270275
DESTINATION "${INSTALL_MYSQLTESTDIR}/${to}"
@@ -286,6 +291,7 @@ FUNCTION(INSTALL_MYSQL_TEST from to)
286291
PATTERN "*.vcxproj.user" EXCLUDE
287292
PATTERN "CTest*" EXCLUDE
288293
PATTERN "*~" EXCLUDE
294+
REGEX "${EXCL_GALERA}" EXCLUDE
289295
)
290296
ENDIF()
291297
ENDFUNCTION()

cmake/systemd.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ MACRO(CHECK_SYSTEMD)
4545
IF(HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS
4646
AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF)
4747
SET(HAVE_SYSTEMD TRUE)
48-
SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster galera_recovery)
48+
SET(SYSTEMD_SCRIPTS mariadb-service-convert)
49+
IF(WITH_WSREP)
50+
SET(SYSTEMD_SCRIPTS ${SYSTEMD_SCRIPTS} galera_new_cluster galera_recovery)
51+
ENDIF()
4952
IF(DEB)
5053
SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld")
5154
SET(SYSTEMD_EXECSTARTPOST "ExecStartPost=/etc/mysql/debian-start")

include/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,15 @@ FOREACH(f ${HEADERS_GEN_CONFIGURE})
7474
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f}
7575
DESTINATION ${INSTALL_INCLUDEDIR}/server COMPONENT Development)
7676
ENDFOREACH(f)
77-
INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR}/server/mysql COMPONENT Development FILES_MATCHING PATTERN "*.h")
77+
IF(NOT WITH_WSREP)
78+
SET(EXCL_SERVICE_WSREP "service_wsrep.h")
79+
SET(EXCL_WSREP "wsrep.h")
80+
ENDIF()
81+
INSTALL(DIRECTORY mysql/
82+
DESTINATION ${INSTALL_INCLUDEDIR}/server/mysql COMPONENT Development
83+
FILES_MATCHING PATTERN "*.h"
84+
PATTERN "${EXCL_SERVICE_WSREP}" EXCLUDE
85+
)
7886

7987
STRING(REPLACE "." "\\." EXCL_RE "${HEADERS};${HEADERS_GEN_CONFIGURE}")
8088
STRING(REPLACE ";" "|" EXCL_RE "${EXCL_RE}")
@@ -85,6 +93,7 @@ MACRO(INSTALL_PRIVATE DIR)
8593
FILES_MATCHING PATTERN "*.h"
8694
PATTERN CMakeFiles EXCLUDE
8795
PATTERN mysql EXCLUDE
96+
PATTERN "${EXCL_WSREP}" EXCLUDE
8897
REGEX "\\./(${EXCL_RE}$)" EXCLUDE)
8998
ENDMACRO()
9099

man/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
# You should have received a copy of the GNU General Public License
1313
# along with this program; if not, write to the Free Software
1414
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
15+
1516
SET(MAN1_WSREP wsrep_sst_rsync.1 wsrep_sst_common.1 wsrep_sst_mariabackup.1
16-
wsrep_sst_rsync_wan.1)
17+
wsrep_sst_mysqldump.1 wsrep_sst_rsync_wan.1 galera_recovery.1 galera_new_cluster.1)
1718
SET(MAN1_SERVER innochecksum.1 myisam_ftdump.1 myisamchk.1
1819
aria_chk.1 aria_dump_log.1 aria_ftdump.1 aria_pack.1 aria_read_log.1
1920
aria_s3_copy.1
@@ -24,10 +25,11 @@ SET(MAN1_SERVER innochecksum.1 myisam_ftdump.1 myisamchk.1
2425
mysqld_multi.1 mysqld_safe.1
2526
resolveip.1 mariadb-service-convert.1
2627
mysqld_safe_helper.1
27-
wsrep_sst_mysqldump.1
28-
galera_recovery.1 galera_new_cluster.1
2928
mysql_ldb.1 myrocks_hotbackup.1
30-
mbstream.1 mariabackup.1 ${MAN1_WSREP})
29+
mbstream.1 mariabackup.1)
30+
IF(WITH_WSREP)
31+
SET(MAN1_SERVER ${MAN1_SERVER} ${MAN1_WSREP})
32+
ENDIF()
3133
SET(MAN8_SERVER mysqld.8)
3234
SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1
3335
mysqldumpslow.1

mysql-test/suite/encryption/r/innodb_encrypt_log_corruption.result

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
6969
COUNT(*)
7070
1
7171
FOUND 3 /InnoDB: Upgrading redo log:/ in mysqld.1.err
72-
# Empty large multi-file redo log from after MariaDB 10.2.2
73-
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
74-
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
75-
WHERE engine = 'innodb'
76-
AND support IN ('YES', 'DEFAULT', 'ENABLED');
77-
COUNT(*)
78-
1
79-
FOUND 4 /InnoDB: Upgrading redo log:/ in mysqld.1.err
8072
# redo log from "after" MariaDB 10.2.2, but with invalid header checksum
8173
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
8274
SELECT * FROM INFORMATION_SCHEMA.ENGINES
@@ -187,7 +179,7 @@ WHERE engine = 'innodb'
187179
AND support IN ('YES', 'DEFAULT', 'ENABLED');
188180
COUNT(*)
189181
1
190-
FOUND 6 /InnoDB: Upgrading redo log:/ in mysqld.1.err
182+
FOUND 5 /InnoDB: Upgrading redo log:/ in mysqld.1.err
191183
# Minimal MariaDB 10.1.21 encrypted redo log
192184
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
193185
SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'

mysql-test/suite/innodb/r/log_corruption.result

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
6969
COUNT(*)
7070
1
7171
FOUND 3 /InnoDB: Upgrading redo log:/ in mysqld.1.err
72-
# Empty large multi-file redo log from after MariaDB 10.2.2
73-
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
74-
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
75-
WHERE engine = 'innodb'
76-
AND support IN ('YES', 'DEFAULT', 'ENABLED');
77-
COUNT(*)
78-
1
79-
FOUND 4 /InnoDB: Upgrading redo log:/ in mysqld.1.err
8072
# redo log from "after" MariaDB 10.2.2, but with invalid header checksum
8173
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption
8274
SELECT * FROM INFORMATION_SCHEMA.ENGINES
@@ -187,7 +179,7 @@ WHERE engine = 'innodb'
187179
AND support IN ('YES', 'DEFAULT', 'ENABLED');
188180
COUNT(*)
189181
1
190-
FOUND 6 /InnoDB: Upgrading redo log:/ in mysqld.1.err
182+
FOUND 5 /InnoDB: Upgrading redo log:/ in mysqld.1.err
191183
# Minimal MariaDB 10.1.21 encrypted redo log
192184
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
193185
SELECT * FROM INFORMATION_SCHEMA.ENGINES
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
call mtr.add_suppression("InnoDB: The change buffer is corrupted");
2+
#
3+
# MDEV-24412 InnoDB: Upgrade after a crash is not supported
4+
#
5+
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-force-recovery=5 --innodb-log-file-size=4m
6+
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
7+
WHERE engine = 'innodb'
8+
AND support IN ('YES', 'DEFAULT', 'ENABLED');
9+
COUNT(*)
10+
1
11+
FOUND 1 /InnoDB: Upgrading redo log:/ in mysqld.1.err
12+
ib_buffer_pool
13+
ib_logfile0
14+
ibdata1
15+
# restart
16+
# End of 10.5 tests

mysql-test/suite/innodb/t/log_corruption.test

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -298,42 +298,6 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
298298
--source include/search_pattern_in_file.inc
299299
--let $restart_parameters= $dirs
300300

301-
--echo # Empty large multi-file redo log from after MariaDB 10.2.2
302-
perl;
303-
do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl";
304-
my $polynomial = 0x82f63b78; # CRC-32C
305-
306-
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
307-
binmode OUT;
308-
$_= pack("Nx[5]nx[5]", 1, 0x1286) . "BogoDB 4.3.2.1" . chr(0) x 478;
309-
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
310-
# checkpoint page 1 and all-zero checkpoint 2
311-
$_= pack("x[13]nCNNx[484]", 0x1286, 12, 2, 0x80c);
312-
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
313-
print OUT chr(0) x 1024;
314-
die unless seek(OUT, 0x1FFFFFFFF, 0);
315-
print OUT chr(0);
316-
close OUT or die;
317-
die unless open OUT, ">", "$ENV{bugdir}/ib_logfile1";
318-
binmode OUT;
319-
die unless seek(OUT, 0x800, 0); # the first 2048 bytes are unused!
320-
$_= pack("Nnnx[500]", 0x80000944, 12, 12);
321-
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
322-
die unless seek(OUT, 0x1FFFFFFFF, 0);
323-
print OUT chr(0);
324-
close OUT or die;
325-
EOF
326-
327-
--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=2m
328-
--source include/start_mysqld.inc
329-
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
330-
WHERE engine = 'innodb'
331-
AND support IN ('YES', 'DEFAULT', 'ENABLED');
332-
--source include/shutdown_mysqld.inc
333-
--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
334-
--source include/search_pattern_in_file.inc
335-
--let $restart_parameters= $dirs
336-
337301
--remove_file $bugdir/ib_logfile0
338302
--move_file $bugdir/ib_logfile $bugdir/ib_logfile0
339303

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
--source include/have_innodb.inc
2+
--source include/have_innodb_16k.inc
3+
# Some operating systems or file systems do not support sparse files.
4+
# For example, tmpfs on FreeBSD does not support them.
5+
# On Microsoft Windows, sparse files have to be created in a special way.
6+
--source include/big_test.inc
7+
8+
call mtr.add_suppression("InnoDB: The change buffer is corrupted");
9+
10+
--source include/shutdown_mysqld.inc
11+
12+
let bugdir= $MYSQLTEST_VARDIR/tmp/log_upgrade;
13+
--mkdir $bugdir
14+
--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
15+
16+
--let $dirs= --innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir
17+
18+
--echo #
19+
--echo # MDEV-24412 InnoDB: Upgrade after a crash is not supported
20+
--echo #
21+
22+
perl;
23+
do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl";
24+
my $polynomial = 0x82f63b78; # CRC-32C
25+
26+
# Create a dummy system tablespace file using the default innodb_page_size=16k
27+
die unless open OUT, ">", "$ENV{bugdir}/ibdata1";
28+
binmode OUT;
29+
30+
# We calculate innodb_checksum_algorithm=crc32 for the pages.
31+
# The following bytes are excluded:
32+
# bytes 0..3 (the checksum is stored there)
33+
# bytes 26..37 (encryption key version, post-encryption checksum, tablespace id)
34+
# bytes $page_size-8..$page_size-1 (checksum, LSB of FIL_PAGE_LSN)
35+
36+
# Tablespace header page with valid FSP_SIZE=768 pages.
37+
# Also, write a dummy FSEG_MAGIC_N at offset 60 to keep fseg_inode_try_get()
38+
# happy when fseg_n_reserved_pages() is following an invalid pointer
39+
# from the all-zero change buffer header page (page 3).
40+
## FIL_PAGE_OFFSET
41+
my $head = pack("Nx[18]", 0);
42+
## FSP_PAGE_SIZE, # FSEG_MAGIC_N
43+
my $body = pack("x[8]Nx[10]Nx[16312]", 768, 97937874);
44+
my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
45+
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
46+
# Dummy pages 1..6.
47+
print OUT chr(0) x (6 * 16384);
48+
# Dictionary header page (page 7).
49+
## FIL_PAGE_OFFSET
50+
$head = pack("Nx[18]", 7);
51+
## DICT_HDR_TABLES,DICT_HDR_INDEXES
52+
$body = pack("x[32]Nx[8]Nx[16290]", 8, 9);
53+
$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
54+
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
55+
56+
# Empty SYS_TABLES page (page 8).
57+
## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT, FIL_PAGE_TYPE
58+
$head = pack("NNNx[8]n", 8, ~0, ~0, 17855);
59+
## PAGE_N_DIR_SLOTS, PAGE_HEAP_TOP, PAGE_INDEX_ID == DICT_TABLES_ID
60+
$body = pack("nnx[31]Cx[20]", 2, 124, 1);
61+
$body .= pack("nxnn", 0x801, 3, 116) . "infimum";
62+
$body .= pack("xnxnxx", 0x901, 0x803) . "supremum";
63+
$body .= pack("x[16248]nn", 116, 101);
64+
$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
65+
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
66+
67+
# Empty SYS_INDEXES page (page 9).
68+
## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT, FIL_PAGE_TYPE
69+
$head = pack("NNNx[8]n", 9, ~0, ~0, 17855);
70+
## PAGE_N_DIR_SLOTS, PAGE_HEAP_TOP, PAGE_INDEX_ID == DICT_INDEXES_ID
71+
$body = pack("nnx[31]Cx[20]", 2, 124, 3);
72+
$body .= pack("nxnn", 0x801, 3, 116) . "infimum";
73+
$body .= pack("xnxnxx", 0x901, 0x803) . "supremum";
74+
$body .= pack("x[16248]nn", 116, 101);
75+
$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
76+
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
77+
78+
die unless seek(OUT, 768 * 16384 - 1, 0);
79+
print OUT chr(0);
80+
close OUT or die;
81+
82+
die unless open OUT, ">", "$ENV{bugdir}/ib_logfile0";
83+
binmode OUT;
84+
$_= pack("Nx[5]nx[5]", 1, 0x1286) . "BogoDB 4.3.2.1" . chr(0) x 478;
85+
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
86+
# checkpoint page 1 and all-zero checkpoint 2
87+
$_= pack("x[13]nCNNx[484]", 0x1286, 12, 2, 0x80c);
88+
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
89+
die unless seek(OUT, 0x1FFFFFFFF, 0);
90+
print OUT chr(0);
91+
close OUT or die;
92+
die unless open OUT, ">", "$ENV{bugdir}/ib_logfile1";
93+
binmode OUT;
94+
die unless seek(OUT, 0x800, 0); # the first 2048 bytes are unused!
95+
$_= pack("Nnnx[500]", 0x80000944, 12, 12);
96+
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
97+
die unless seek(OUT, 0x1FFFFFFFF, 0);
98+
print OUT chr(0);
99+
close OUT or die;
100+
EOF
101+
102+
--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m
103+
--source include/start_mysqld.inc
104+
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
105+
WHERE engine = 'innodb'
106+
AND support IN ('YES', 'DEFAULT', 'ENABLED');
107+
--source include/shutdown_mysqld.inc
108+
--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
109+
--source include/search_pattern_in_file.inc
110+
--let $restart_parameters= $dirs
111+
112+
--list_files $bugdir
113+
--remove_files_wildcard $bugdir
114+
--rmdir $bugdir
115+
--let $restart_parameters=
116+
--source include/start_mysqld.inc
117+
118+
--echo # End of 10.5 tests

0 commit comments

Comments
 (0)