Skip to content

Commit a27bfb2

Browse files
committed
Merge 10.9 into 10.10
2 parents 9e65287 + 3ba8828 commit a27bfb2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+586
-342
lines changed

.gitlab-ci.yml

+104-4
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,39 @@ fedora-clang:
172172
- dependencies.dot
173173
- dependencies.png
174174

175+
fedora-sanitizer:
176+
stage: build
177+
variables:
178+
GIT_STRATEGY: fetch
179+
GIT_SUBMODULE_STRATEGY: normal
180+
script:
181+
- yum install -y yum-utils rpm-build openssl-devel clang
182+
- yum install -y /usr/lib64/libasan.so.6.0.0 /usr/lib64/libtsan.so.0.0.0 /usr/lib64/libubsan.so.1.0.0
183+
# This repository does not have any .spec files, so install dependencies based on Fedora spec file
184+
- yum-builddep -y mariadb-server
185+
- mkdir builddir; cd builddir
186+
- export CXX=${CXX:-clang++}
187+
- export CC=${CC:-clang}
188+
- export CXX_FOR_BUILD=${CXX_FOR_BUILD:-clang++}
189+
- export CC_FOR_BUILD=${CC_FOR_BUILD:-clang}
190+
- export CFLAGS='-Wno-unused-command-line-argument'
191+
- export CXXFLAGS='-Wno-unused-command-line-argument'
192+
- cmake -DRPM=$CI_JOB_NAME $CMAKE_FLAGS $SANITIZER .. 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log
193+
# @TODO: the build will fail consistently at 24% when trying to make using eatmydata
194+
- make package -j 2 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log
195+
- *rpm_listfiles
196+
- mkdir ../rpm; mv *.rpm ../rpm
197+
artifacts:
198+
when: always # Must be able to see logs
199+
paths:
200+
- build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log
201+
- rpmlist-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log
202+
- rpm
203+
- builddir/_CPack_Packages/Linux/RPM/SPECS/
204+
parallel:
205+
matrix:
206+
- SANITIZER: [-DWITH_ASAN=YES, -DWITH_TSAN=YES, -DWITH_UBSAN=YES, -DWITH_MSAN=YES]
207+
175208
centos8:
176209
stage: build
177210
image: quay.io/centos/centos:stream8 # CentOS 8 is deprecated, use this Stream8 instead
@@ -246,10 +279,8 @@ centos7:
246279
- rpm
247280
- builddir/_CPack_Packages/Linux/RPM/SPECS/
248281

249-
mysql-test-run:
282+
.mysql-test-run: &mysql-test-run-def
250283
stage: test
251-
dependencies:
252-
- fedora
253284
script:
254285
# Install packages so tests and the dependencies install
255286
# @TODO: RPM missing 'patch' and 'diff' as dependency, so installing it manually for now
@@ -265,7 +296,76 @@ mysql-test-run:
265296
main.flush_logs_not_windows : query 'flush logs' succeeded - should have failed with error ER_CANT_CREATE_FILE (1004)
266297
main.mysql_upgrade_noengine : upgrade output order does not match the expected
267298
" > skiplist
268-
- ./mtr --suite=main --force --parallel=auto --xml-report=$CI_PROJECT_DIR/junit.xml --skip-test-list=skiplist
299+
- ./mtr --suite=main --force --parallel=auto --xml-report=$CI_PROJECT_DIR/junit.xml --skip-test-list=skiplist $RESTART_POLICY
300+
301+
mysql-test-run:
302+
stage: test
303+
dependencies:
304+
- fedora
305+
<<: *mysql-test-run-def
306+
artifacts:
307+
when: always # Also show results when tests fail
308+
reports:
309+
junit:
310+
- junit.xml
311+
312+
# Duplicate of the above jobs, except we use sanitizer build jobs as a dependency. This is so we can keep
313+
# sanitizer errors separate from functional test failures. Currently, there is no way to run the same
314+
# job for different dependencies.
315+
#
316+
# Additionally, for each sanitizer MTR job, we enable --force-restart so that
317+
# sanitizer errors can be traced to individual tests. The difference in test
318+
# suite runtime as a result of this flag is negligable (~30s for the entire test suite).
319+
# (see https://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_MYSQL_TEST_RUN_PL.html)
320+
mysql-test-run-asan:
321+
stage: test
322+
variables:
323+
RESTART_POLICY: "--force-restart"
324+
dependencies:
325+
- "fedora-sanitizer: [-DWITH_ASAN=YES]"
326+
<<: *mysql-test-run-def
327+
artifacts:
328+
when: always # Also show results when tests fail
329+
reports:
330+
junit:
331+
- junit.xml
332+
333+
mysql-test-run-tsan:
334+
stage: test
335+
variables:
336+
RESTART_POLICY: "--force-restart"
337+
dependencies:
338+
- "fedora-sanitizer: [-DWITH_TSAN=YES]"
339+
<<: *mysql-test-run-def
340+
allow_failure: true
341+
artifacts:
342+
when: always # Also show results when tests fail
343+
reports:
344+
junit:
345+
- junit.xml
346+
347+
mysql-test-run-ubsan:
348+
stage: test
349+
variables:
350+
RESTART_POLICY: "--force-restart"
351+
dependencies:
352+
- "fedora-sanitizer: [-DWITH_UBSAN=YES]"
353+
<<: *mysql-test-run-def
354+
allow_failure: true
355+
artifacts:
356+
when: always # Also show results when tests fail
357+
reports:
358+
junit:
359+
- junit.xml
360+
361+
mysql-test-run-msan:
362+
stage: test
363+
variables:
364+
RESTART_POLICY: "--force-restart"
365+
dependencies:
366+
- "fedora-sanitizer: [-DWITH_MSAN=YES]"
367+
<<: *mysql-test-run-def
368+
allow_failure: true
269369
artifacts:
270370
when: always # Also show results when tests fail
271371
reports:

CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,10 @@ INSTALL_DOCUMENTATION(README.md CREDITS COPYING THIRDPARTY COMPONENT Readme)
541541
# ${CMAKE_BINARY_DIR}/Docs/INFO_BIN)
542542

543543
IF(UNIX)
544-
INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY Docs/README-wsrep COMPONENT Readme)
544+
INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY COMPONENT Readme)
545+
IF(WITH_WSREP)
546+
INSTALL_DOCUMENTATION(Docs/README-wsrep COMPONENT Readme)
547+
ENDIF()
545548
ENDIF()
546549

547550
INCLUDE(build_depends)

cmake/install_macros.cmake

+6
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

+4-1
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")

extra/mariabackup/backup_copy.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,8 @@ datafile_read(datafile_cur_t *cursor)
561561
}
562562

563563
if (os_file_read(IORequestRead,
564-
cursor->file, cursor->buf, cursor->buf_offset,
565-
to_read) != DB_SUCCESS) {
564+
cursor->file, cursor->buf, cursor->buf_offset,
565+
to_read, nullptr) != DB_SUCCESS) {
566566
return(XB_FIL_CUR_ERROR);
567567
}
568568

extra/mariabackup/changed_page_bitmap.cc

+4-7
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,15 @@ log_online_read_bitmap_page(
188188
{
189189
ulint checksum;
190190
ulint actual_checksum;
191-
ibool success;
192191

193192
ut_a(bitmap_file->size >= MODIFIED_PAGE_BLOCK_SIZE);
194193
ut_a(bitmap_file->offset
195194
<= bitmap_file->size - MODIFIED_PAGE_BLOCK_SIZE);
196195
ut_a(bitmap_file->offset % MODIFIED_PAGE_BLOCK_SIZE == 0);
197-
success = os_file_read(IORequestRead,
198-
bitmap_file->file, page, bitmap_file->offset,
199-
MODIFIED_PAGE_BLOCK_SIZE) == DB_SUCCESS;
200-
201-
if (UNIV_UNLIKELY(!success)) {
202-
196+
if (DB_SUCCESS !=
197+
os_file_read(IORequestRead, bitmap_file->file, page,
198+
bitmap_file->offset, MODIFIED_PAGE_BLOCK_SIZE,
199+
nullptr)) {
203200
/* The following call prints an error message */
204201
os_file_get_last_error(TRUE);
205202
msg("InnoDB: Warning: failed reading changed page bitmap "

extra/mariabackup/fil_cur.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ xb_fil_cur_open(
223223
if (!node->space->crypt_data
224224
&& os_file_read(IORequestRead,
225225
node->handle, cursor->buf, 0,
226-
cursor->page_size) == DB_SUCCESS) {
226+
cursor->page_size, nullptr) == DB_SUCCESS) {
227227
mysql_mutex_lock(&fil_system.mutex);
228228
if (!node->space->crypt_data) {
229229
node->space->crypt_data = fil_space_read_crypt_data(
@@ -415,12 +415,12 @@ xb_fil_cur_result_t xb_fil_cur_read(xb_fil_cur_t* cursor,
415415
cursor->buf_page_no = static_cast<unsigned>(offset / page_size);
416416

417417
if (os_file_read(IORequestRead, cursor->file, cursor->buf, offset,
418-
(ulint) to_read) != DB_SUCCESS) {
418+
(ulint) to_read, nullptr) != DB_SUCCESS) {
419419
ret = XB_FIL_CUR_ERROR;
420420
goto func_exit;
421421
}
422422

423-
defer = space->is_deferred();
423+
defer = UT_LIST_GET_FIRST(space->chain)->deferred;
424424
/* check pages for corruption and re-read if necessary. i.e. in case of
425425
partially written pages */
426426
for (page = cursor->buf, i = 0; i < npages;

extra/mariabackup/xtrabackup.cc

+5-4
Original file line numberDiff line numberDiff line change
@@ -3857,7 +3857,7 @@ static dberr_t xb_assign_undo_space_start()
38573857
byte* page = static_cast<byte*>
38583858
(aligned_malloc(srv_page_size, srv_page_size));
38593859

3860-
if (os_file_read(IORequestRead, file, page, 0, srv_page_size)
3860+
if (os_file_read(IORequestRead, file, page, 0, srv_page_size, nullptr)
38613861
!= DB_SUCCESS) {
38623862
msg("Reading first page failed.\n");
38633863
error = DB_ERROR;
@@ -3869,7 +3869,7 @@ static dberr_t xb_assign_undo_space_start()
38693869
retry:
38703870
if (os_file_read(IORequestRead, file, page,
38713871
TRX_SYS_PAGE_NO << srv_page_size_shift,
3872-
srv_page_size) != DB_SUCCESS) {
3872+
srv_page_size, nullptr) != DB_SUCCESS) {
38733873
msg("Reading TRX_SYS page failed.");
38743874
error = DB_ERROR;
38753875
goto func_exit;
@@ -5315,7 +5315,8 @@ xtrabackup_apply_delta(
53155315
offset = ((incremental_buffers * (page_size / 4))
53165316
<< page_size_shift);
53175317
if (os_file_read(IORequestRead, src_file,
5318-
incremental_buffer, offset, page_size)
5318+
incremental_buffer, offset, page_size,
5319+
nullptr)
53195320
!= DB_SUCCESS) {
53205321
goto error;
53215322
}
@@ -5348,7 +5349,7 @@ xtrabackup_apply_delta(
53485349
/* read whole of the cluster */
53495350
if (os_file_read(IORequestRead, src_file,
53505351
incremental_buffer,
5351-
offset, page_in_buffer * page_size)
5352+
offset, page_in_buffer * page_size, nullptr)
53525353
!= DB_SUCCESS) {
53535354
goto error;
53545355
}

include/CMakeLists.txt

+10-1
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

+6-4
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--- encrypt_and_grep.result 2022-09-02 22:36:21.669650278 +0530
2+
+++ encrypt_and_grep.reject 2022-11-29 19:01:22.080027528 +0530
3+
@@ -14,6 +14,9 @@
4+
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
5+
NAME
6+
innodb_system
7+
+innodb_undo001
8+
+innodb_undo002
9+
+innodb_undo003
10+
mysql/innodb_index_stats
11+
mysql/innodb_table_stats
12+
mysql/transaction_registry
13+
@@ -35,6 +38,9 @@
14+
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
15+
NAME
16+
innodb_system
17+
+innodb_undo001
18+
+innodb_undo002
19+
+innodb_undo003
20+
mysql/innodb_index_stats
21+
mysql/innodb_table_stats
22+
mysql/transaction_registry
23+
@@ -62,6 +68,9 @@
24+
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
25+
NAME
26+
innodb_system
27+
+innodb_undo001
28+
+innodb_undo002
29+
+innodb_undo003
30+
mysql/innodb_index_stats
31+
mysql/innodb_table_stats
32+
mysql/transaction_registry
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--- innodb-remove-encryption.result 2022-09-02 20:44:59.960430396 +0530
2+
+++ innodb-remove-encryption,undo3.reject 2022-11-29 19:02:24.813094277 +0530
3+
@@ -13,6 +13,9 @@
4+
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
5+
NAME
6+
innodb_system
7+
+innodb_undo001
8+
+innodb_undo002
9+
+innodb_undo003
10+
mysql/innodb_index_stats
11+
mysql/innodb_table_stats
12+
mysql/transaction_registry
13+
@@ -24,6 +27,9 @@
14+
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
15+
NAME
16+
innodb_system
17+
+innodb_undo001
18+
+innodb_undo002
19+
+innodb_undo003
20+
mysql/innodb_index_stats
21+
mysql/innodb_table_stats
22+
mysql/transaction_registry
23+
@@ -36,6 +42,9 @@
24+
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
25+
NAME
26+
innodb_system
27+
+innodb_undo001
28+
+innodb_undo002
29+
+innodb_undo003
30+
mysql/innodb_index_stats
31+
mysql/innodb_table_stats
32+
mysql/transaction_registry

0 commit comments

Comments
 (0)