Skip to content

Commit 79bc654

Browse files
committed
Merge 10.6 into 10.7
2 parents af87186 + 9b8d9a1 commit 79bc654

25 files changed

+286
-56
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,12 @@ fedora-clang:
172172

173173
centos8:
174174
stage: build
175-
image: centos:8
175+
image: quay.io/centos/centos:stream8 # CentOS 8 is deprecated, use this Stream8 instead
176176
variables:
177177
GIT_STRATEGY: fetch
178178
GIT_SUBMODULE_STRATEGY: normal
179179
script:
180-
- yum install -y yum-utils rpm-build openssl-devel
180+
- yum install -y yum-utils rpm-build openssl-devel pcre2-devel
181181
- yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
182182
# dnf --enablerepo=powertools install Judy-devel #--> not found
183183
- dnf config-manager --set-enabled powertools
@@ -186,7 +186,7 @@ centos8:
186186
# - package Judy-devel-1.0.5-18.module_el8.3.0+757+d382997d.i686 is filtered out by modular filtering
187187
# - package Judy-devel-1.0.5-18.module_el8.3.0+757+d382997d.x86_64 is filtered out by modular filtering
188188
# Solution: install Judy-devel directly from downloaded rpm file:
189-
- yum install -y http://mirror.centos.org/centos/8/PowerTools/x86_64/os/Packages/Judy-devel-1.0.5-18.module_el8.3.0+757+d382997d.x86_64.rpm
189+
- yum install -y http://vault.centos.org/centos/8/PowerTools/x86_64/os/Packages/Judy-devel-1.0.5-18.module_el8.3.0+757+d382997d.x86_64.rpm
190190
# Use eatmydata to speed up build
191191
- yum install -y https://github.com/stewartsmith/libeatmydata/releases/download/v129/libeatmydata-129-1.fc33.x86_64.rpm
192192
- yum install -y ccache # From EPEL
@@ -226,7 +226,7 @@ centos7:
226226
# This repository does not have any .spec files, so install dependencies based on Fedora spec file
227227
- yum-builddep -y mariadb-server
228228
# ..with a few extra ones, as CentOS 7 is very old and these are added in newer MariaDB releases
229-
- yum install -y yum-utils rpm-build gcc gcc-c++ bison libxml2-devel libevent-devel openssl-devel
229+
- yum install -y yum-utils rpm-build gcc gcc-c++ bison libxml2-devel libevent-devel openssl-devel pcre2-devel
230230
- mkdir builddir; cd builddir
231231
- cmake -DRPM=$CI_JOB_NAME $CMAKE_FLAGS .. 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log
232232
- make package -j 2 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2006, 2017, Oracle and/or its affiliates.
2-
# Copyright (c) 2008, 2021, MariaDB Corporation.
2+
# Copyright (c) 2008, 2022, MariaDB Corporation.
33
#
44
# This program is free software; you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -80,9 +80,11 @@ SET(MYSQL_PROJECT_NAME_DOCSTRING "MySQL project name")
8080

8181
IF(CMAKE_VERSION VERSION_LESS "3.1")
8282
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
83+
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
8384
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
8485
ENDIF()
8586
ELSE()
87+
SET(CMAKE_C_STANDARD 99)
8688
SET(CMAKE_CXX_STANDARD 11)
8789
ENDIF()
8890

debian/autobake-deb.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ set -e
1313

1414
source ./VERSION
1515

16+
CODENAME="$(lsb_release -sc)"
17+
case "${CODENAME}" in
18+
stretch)
19+
# MDEV-28022 libzstd-dev-1.1.3 minimum version
20+
sed -i -e '/libzstd-dev/d' debian/control
21+
;;
22+
esac
23+
1624
# This file is invoked from Buildbot and Travis-CI to build deb packages.
1725
# As both of those CI systems have many parallel jobs that include different
1826
# parts of the test suite, we don't need to run the mysql-test-run at all when
@@ -106,7 +114,6 @@ echo "Incrementing changelog and starting build scripts"
106114
UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}"
107115
PATCHLEVEL="+maria"
108116
LOGSTRING="MariaDB build"
109-
CODENAME="$(lsb_release -sc)"
110117
EPOCH="1:"
111118
VERSION="${EPOCH}${UPSTREAM}${PATCHLEVEL}~${CODENAME}"
112119

mysql-test/main/create_or_replace.result

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ drop table test.t1;
353353
#
354354
create table t1 (i int);
355355
lock table t1 write;
356-
select * from information_schema.metadata_lock_info;
356+
select * from information_schema.metadata_lock_info
357+
where table_schema!='mysql' or table_name not like 'innodb_%_stats';
357358
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
358359
# MDL_BACKUP_DDL NULL Backup lock
359360
# MDL_BACKUP_DML NULL Backup lock
@@ -364,7 +365,8 @@ ERROR 22001: Data too long for column 'a' at row 1
364365
show tables;
365366
Tables_in_test
366367
t2
367-
select * from information_schema.metadata_lock_info;
368+
select * from information_schema.metadata_lock_info
369+
where table_schema!='mysql' or table_name not like 'innodb_%_stats';
368370
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
369371
create table t1 (i int);
370372
drop table t1;

mysql-test/main/create_or_replace.test

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,15 @@ create table t1 (i int);
285285
lock table t1 write;
286286
--replace_column 1 #
287287
--sorted_result
288-
select * from information_schema.metadata_lock_info;
288+
select * from information_schema.metadata_lock_info
289+
where table_schema!='mysql' or table_name not like 'innodb_%_stats';
289290
--error ER_DATA_TOO_LONG
290291
create or replace table t1 (a char(1)) engine=Innodb select 'foo' as a;
291292
show tables;
292293
--replace_column 1 #
293294
--sorted_result
294-
select * from information_schema.metadata_lock_info;
295+
select * from information_schema.metadata_lock_info
296+
where table_schema!='mysql' or table_name not like 'innodb_%_stats';
295297
create table t1 (i int);
296298
drop table t1;
297299

mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,17 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc
104104
SHOW WARNINGS;
105105
Level Code Message
106106
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly
107+
CREATE TABLE t3 (a INT(11) DEFAULT NULL);
108+
INSERT INTO t3 VALUES (1);
109+
CREATE TABLE t4 (a INT(11) DEFAULT NULL, b BIGINT(20) DEFAULT uuid_short()) SELECT * FROM t3;
110+
Warnings:
111+
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave
112+
SHOW WARNINGS;
113+
Level Code Message
114+
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave
115+
CREATE OR REPLACE TABLE t4 (a INT(11) DEFAULT NULL) SELECT * FROM t3;
116+
SHOW WARNINGS;
117+
Level Code Message
107118
DROP FUNCTION sf_bug50192;
108119
DROP TRIGGER tr_bug50192;
109-
DROP TABLE t1, t2;
120+
DROP TABLE t1, t2, t3, t4;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
2+
select @@innodb_autoinc_lock_mode;
3+
@@innodb_autoinc_lock_mode
4+
2
5+
select @@binlog_format;
6+
@@binlog_format
7+
MIXED
8+
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=InnoDB;
9+
insert into t1 values (NULL,1);
10+
include/show_binlog_events.inc
11+
Log_name Pos Event_type Server_id End_log_pos Info
12+
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
13+
master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT' COLLATE 'latin1_swedish_ci'))
14+
master-bin.000001 # Query # # COMMIT
15+
master-bin.000001 # Gtid # # GTID #-#-#
16+
master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment,b int, primary key (a)) engine=InnoDB
17+
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
18+
master-bin.000001 # Annotate_rows # # insert into t1 values (NULL,1)
19+
master-bin.000001 # Table_map # # table_id: # (test.t1)
20+
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
21+
master-bin.000001 # Xid # # COMMIT /* XID */
22+
set global binlog_format=STATEMENT;
23+
connect con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
24+
insert into t1 values (NULL,1);
25+
Warnings:
26+
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
27+
insert into t1 values (NULL,1);
28+
Warnings:
29+
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system variable that may have a different value on the slave
30+
disconnect con1;
31+
connection default;
32+
set global binlog_format=MIXED;
33+
DROP TABLE t1;

mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,20 @@ SHOW WARNINGS;
189189
SELECT sf_bug50192();
190190
SHOW WARNINGS;
191191

192+
# The test proves MDEV-24617 fixes leave in force
193+
# unsafe warnings in non-deterministic CREATE..SELECT cases.
194+
# Below an inserted default value to `b` of the target table is replication
195+
# unsafe. A warning must be out.
196+
CREATE TABLE t3 (a INT(11) DEFAULT NULL);
197+
INSERT INTO t3 VALUES (1);
198+
CREATE TABLE t4 (a INT(11) DEFAULT NULL, b BIGINT(20) DEFAULT uuid_short()) SELECT * FROM t3;
199+
SHOW WARNINGS;
200+
# no warning out of a deterministic "rhs" of SELECT
201+
CREATE OR REPLACE TABLE t4 (a INT(11) DEFAULT NULL) SELECT * FROM t3;
202+
SHOW WARNINGS;
203+
192204
# cleanup
193205

194206
DROP FUNCTION sf_bug50192;
195207
DROP TRIGGER tr_bug50192;
196-
DROP TABLE t1, t2;
208+
DROP TABLE t1, t2, t3, t4;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--innodb_autoinc_lock_mode=2
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--source include/have_innodb.inc
2+
--source include/have_binlog_format_mixed.inc
3+
4+
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
5+
6+
select @@innodb_autoinc_lock_mode;
7+
select @@binlog_format;
8+
9+
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=InnoDB;
10+
insert into t1 values (NULL,1);
11+
--source include/show_binlog_events.inc
12+
13+
set global binlog_format=STATEMENT;
14+
--connect (con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK)
15+
insert into t1 values (NULL,1);
16+
insert into t1 values (NULL,1);
17+
--disconnect con1
18+
--connection default
19+
20+
set global binlog_format=MIXED;
21+
DROP TABLE t1;

0 commit comments

Comments
 (0)