Skip to content

Commit

Permalink
Merge 10.9 into 10.10
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Dec 7, 2022
2 parents a27bfb2 + 23f705f commit 3ff4eb0
Show file tree
Hide file tree
Showing 68 changed files with 926 additions and 365 deletions.
19 changes: 11 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ stages:
- test
- Salsa-CI

# Base image for builds and tests unless otherwise defined
# @TODO: Fedora 34 is latest, but fails to start on Gitlab.com with error "shell not found"
image: fedora:33
default:
# Base image for builds and tests unless otherwise defined
image: fedora:latest
# Extend build jobs to have longer timeout as the default GitLab
# timeout (1h) is often not enough
timeout: 3h

# Define common CMAKE_FLAGS for all builds. Skim down build by omitting all
# submodules (a commit in this repo does not affect their builds anyway) and
Expand Down Expand Up @@ -427,14 +430,14 @@ fedora upgrade:
dependencies:
- fedora
script:
- yum install -y mariadb-server
- dnf install -y mariadb-server
# Fedora does not support running services in Docker (like Debian packages do) so start it manually
- /usr/libexec/mysql-check-socket
- /usr/libexec/mysql-prepare-db-dir
- sudo -u mysql /usr/libexec/mysqld --basedir=/usr & sleep 10
- /usr/libexec/mariadb-check-socket
- /usr/libexec/mariadb-prepare-db-dir
- sudo -u mysql /usr/libexec/mariadbd --basedir=/usr & sleep 10
# Dump database contents in installed state
- mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > old-installed-database.sql
- /usr/libexec/mysql-check-upgrade
- /usr/libexec/mariadb-check-upgrade
# Dump database contents in upgraded state
- mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > old-upgraded-database.sql
- mariadb --skip-column-names -e "SELECT @@version, @@version_comment" # Show version
Expand Down
3 changes: 3 additions & 0 deletions client/mysqlcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,10 @@ static int dbConnect(char *host, char *user, char *passwd)
opt_ssl_capath, opt_ssl_cipher);
mysql_options(&mysql_connection, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(&mysql_connection, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
mysql_options(&mysql_connection, MARIADB_OPT_TLS_VERSION, opt_tls_version);
}
mysql_options(&mysql_connection, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif
if (opt_protocol)
mysql_options(&mysql_connection,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
Expand Down
3 changes: 3 additions & 0 deletions client/mysqlslap.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@ void set_mysql_connect_options(MYSQL *mysql)
opt_ssl_capath, opt_ssl_cipher);
mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
mysql_options(mysql, MARIADB_OPT_TLS_VERSION, opt_tls_version);
}
mysql_options(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif
if (opt_protocol)
mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
Expand Down
1 change: 1 addition & 0 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9870,6 +9870,7 @@ int main(int argc, char **argv)
opt_ssl_capath, opt_ssl_cipher);
mysql_options(con->mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(con->mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
mysql_options(con->mysql, MARIADB_OPT_TLS_VERSION, opt_tls_version);
mysql_options(con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert);
}
Expand Down
19 changes: 19 additions & 0 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3910,6 +3910,21 @@ static dberr_t xb_assign_undo_space_start()
return error;
}

/** Close all undo tablespaces while applying incremental delta */
static void xb_close_undo_tablespaces()
{
if (srv_undo_space_id_start == 0)
return;
for (uint32_t space_id= srv_undo_space_id_start;
space_id < srv_undo_space_id_start + srv_undo_tablespaces_open;
space_id++)
{
fil_space_t *space= fil_space_get(space_id);
ut_ad(space);
space->close();
}
}

/****************************************************************************
Populates the tablespace memory cache by scanning for and opening data files.
@returns DB_SUCCESS or error code.*/
Expand Down Expand Up @@ -3971,6 +3986,10 @@ xb_load_tablespaces()
return(err);
}

if (srv_operation == SRV_OPERATION_RESTORE_DELTA) {
xb_close_undo_tablespaces();
}

DBUG_MARIABACKUP_EVENT("after_load_tablespaces", {});
return(DB_SUCCESS);
}
Expand Down
4 changes: 2 additions & 2 deletions include/sslopt-longopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
&opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-crl", OPT_SSL_KEY, "Certificate revocation list (implies --ssl).",
{"ssl-crl", OPT_SSL_CRL, "Certificate revocation list (implies --ssl).",
&opt_ssl_crl, &opt_ssl_crl, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
{"ssl-crlpath", OPT_SSL_KEY,
{"ssl-crlpath", OPT_SSL_CRLPATH,
"Certificate revocation list path (implies --ssl).",
&opt_ssl_crlpath, &opt_ssl_crlpath, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
Expand Down
25 changes: 25 additions & 0 deletions mysql-test/main/ctype_tis620.result
Original file line number Diff line number Diff line change
Expand Up @@ -4472,3 +4472,28 @@ HEX(WEIGHT_STRING(_tis620 'a\0b' COLLATE tis620_thai_nopad_ci))
#
# End of 10.2 tests
#
#
# Start of 10.4 tests
#
#
# MDEV-27670 Assertion `(cs->state & 0x20000) == 0' failed in my_strnncollsp_nchars_generic_8bit
#
CREATE OR REPLACE TABLE t1
(
a VARCHAR(250) COLLATE tis620_thai_nopad_ci,
UNIQUE KEY(a(100)) USING HASH
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('a'),('A');
ERROR 23000: Duplicate entry 'A' for key 'a'
DROP TABLE t1;
CREATE OR REPLACE TABLE t1
(
a CHAR(250) COLLATE tis620_thai_nopad_ci,
UNIQUE KEY(a(100)) USING HASH
) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('a'),('A');
ERROR 23000: Duplicate entry 'A' for key 'a'
DROP TABLE t1;
#
# End of 10.4 tests
#
31 changes: 31 additions & 0 deletions mysql-test/main/ctype_tis620.test
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,34 @@ SELECT HEX(WEIGHT_STRING(_tis620 'a\0b' COLLATE tis620_thai_nopad_ci));
--echo #
--echo # End of 10.2 tests
--echo #

--echo #
--echo # Start of 10.4 tests
--echo #

--echo #
--echo # MDEV-27670 Assertion `(cs->state & 0x20000) == 0' failed in my_strnncollsp_nchars_generic_8bit
--echo #

CREATE OR REPLACE TABLE t1
(
a VARCHAR(250) COLLATE tis620_thai_nopad_ci,
UNIQUE KEY(a(100)) USING HASH
) ENGINE=MyISAM;
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES ('a'),('A');
DROP TABLE t1;

CREATE OR REPLACE TABLE t1

(
a CHAR(250) COLLATE tis620_thai_nopad_ci,
UNIQUE KEY(a(100)) USING HASH
) ENGINE=MyISAM;
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES ('a'),('A');
DROP TABLE t1;

--echo #
--echo # End of 10.4 tests
--echo #
2 changes: 1 addition & 1 deletion mysql-test/main/derived_view.result
Original file line number Diff line number Diff line change
Expand Up @@ -2772,7 +2772,7 @@ ON p.id = g.p_random
ORDER BY gallery_name ASC
;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 10 Using temporary; Using filesort
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 10 Using filesort
1 PRIMARY p eq_ref PRIMARY PRIMARY 4 g.p_random 1 Using where
2 DERIVED gal ALL NULL NULL NULL NULL 10
3 DEPENDENT SUBQUERY pi ref gallery_id gallery_id 4 test.gal.id 4 Using temporary; Using filesort
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/main/having.result
Original file line number Diff line number Diff line change
Expand Up @@ -834,13 +834,13 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
explain SELECT t, next_seq_value() r FROM t1 FORCE INDEX(t) GROUP BY t HAVING r = 1 ORDER BY t1.u;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort
1 SIMPLE t1 index NULL t 5 NULL 8 Using temporary; Using filesort
SELECT t, next_seq_value() r FROM t1 FORCE INDEX(t) GROUP BY t HAVING r = 1 ORDER BY t1.u;
t r
10 1
12 1
14 1
16 1
15 1
17 1
DROP TABLE t1;
DROP FUNCTION next_seq_value;
DROP TABLE series;
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/main/show_explain.result
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using temporary; Using filesort
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using filesort
set @show_explain_probe_select_id=1;
SET debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT a+SLEEP(0.01) FROM t1
Expand All @@ -1126,7 +1126,7 @@ ORDER BY b;
connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using temporary; Using filesort
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using filesort
Warnings:
Note 1003 SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
Expand All @@ -1149,7 +1149,7 @@ ORDER BY b;
connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using temporary; Using filesort
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using filesort
Warnings:
Note 1003 SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
Expand Down
40 changes: 40 additions & 0 deletions mysql-test/main/sp.result
Original file line number Diff line number Diff line change
Expand Up @@ -8933,6 +8933,46 @@ DROP TABLE t1;
# End of 10.4 tests
#
#
# MDEV-29129: Performance regression starting in 10.6: unlimited "select order by limit"
#
CREATE TABLE t1 (
lookupId int primary key,
value varchar(255)
);
insert into t1 select seq, seq from seq_1_to_100;
# Note: the function is intentionally NOT declared as DETERMINISTIC
CREATE FUNCTION f1(LOOKUPID_IN INT) RETURNS varchar(255) CHARSET utf8
BEGIN
DECLARE LOOKUP_VALUE VARCHAR(255);
SET LOOKUP_VALUE = (SELECT value FROM t1 WHERE lookupId = LOOKUPID_IN);
set @counter=@counter+1;
RETURN LOOKUP_VALUE;
END;
//
create table t2 (
col1 int,
col2 int
);
insert into t2 select mod(seq,100), seq from seq_1_to_1000;
explain
select f1(col1) from t2 order by col2 desc limit 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1000 Using filesort
set @counter=0;
select f1(col1) from t2 order by col2 desc limit 5;
f1(col1)
NULL
99
98
97
96
# Must show 5, not 1000:
select @counter;
@counter
5
drop function f1;
drop table t1,t2;
#
# MDEV-28129: MariaDB UAF issue at lex_end_nops(LEX*)
#
CREATE PROCEDURE sp() SELECT 1 INTO @;
Expand Down
37 changes: 37 additions & 0 deletions mysql-test/main/sp.test
Original file line number Diff line number Diff line change
Expand Up @@ -10520,6 +10520,43 @@ DROP TABLE t1;
--echo # End of 10.4 tests
--echo #

--echo #
--echo # MDEV-29129: Performance regression starting in 10.6: unlimited "select order by limit"
--echo #

CREATE TABLE t1 (
lookupId int primary key,
value varchar(255)
);
insert into t1 select seq, seq from seq_1_to_100;

-- echo # Note: the function is intentionally NOT declared as DETERMINISTIC
delimiter //;
CREATE FUNCTION f1(LOOKUPID_IN INT) RETURNS varchar(255) CHARSET utf8
BEGIN
DECLARE LOOKUP_VALUE VARCHAR(255);
SET LOOKUP_VALUE = (SELECT value FROM t1 WHERE lookupId = LOOKUPID_IN);
set @counter=@counter+1;
RETURN LOOKUP_VALUE;
END;
//
delimiter ;//

create table t2 (
col1 int,
col2 int
);
insert into t2 select mod(seq,100), seq from seq_1_to_1000;

explain
select f1(col1) from t2 order by col2 desc limit 5;
set @counter=0;
select f1(col1) from t2 order by col2 desc limit 5;
--echo # Must show 5, not 1000:
select @counter;
drop function f1;
drop table t1,t2;

--echo #
--echo # MDEV-28129: MariaDB UAF issue at lex_end_nops(LEX*)
--echo #
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/main/user_var.result
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,14 @@ insert into t1 (b) values (10), (30), (10), (10);
set @var := 0;
explain select if(b=@var, 999, b) , @var := b from t1 order by b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort
set @var := 0;
select if(b=@var, 999, b) , @var := b from t1 order by b;
if(b=@var, 999, b) @var := b
10 10
10 10
30 30
999 10
999 10
drop table t1;
create temporary table t1 (id int);
insert into t1 values (2), (3), (3), (4);
Expand Down
24 changes: 24 additions & 0 deletions mysql-test/main/win.result
Original file line number Diff line number Diff line change
Expand Up @@ -4430,3 +4430,27 @@ row_number() OVER (order by a)
2
3
drop table t1;
#
# MDEV-28206 SIGSEGV in Item_field::fix_fields when using LEAD...OVER
#
CREATE TABLE t(c1 INT);
CREATE FUNCTION f() RETURNS INT READS SQL DATA BEGIN
DECLARE v INT;
SELECT 1 INTO v FROM (SELECT c1,COALESCE(LEAD(a2.c1) OVER (PARTITION BY a2.c1 ORDER BY a2.c1),a2.c1) AS a1 FROM (t a2 JOIN t a3 USING (c1))) a4;
RETURN 1;
END//
SELECT f(),f();
f() f()
1 1
EXECUTE IMMEDIATE "SELECT LEAD(c1) OVER (ORDER BY c1) FROM t NATURAL JOIN t AS a;";
LEAD(c1) OVER (ORDER BY c1)
EXECUTE IMMEDIATE "SELECT SUM(c1) OVER (ORDER BY c1) FROM t NATURAL JOIN t AS a;";
SUM(c1) OVER (ORDER BY c1)
EXECUTE IMMEDIATE "SELECT LEAD(c) OVER (ORDER BY c) FROM (SELECT 1 AS c) AS a NATURAL JOIN (SELECT 1 AS c) AS b;";
LEAD(c) OVER (ORDER BY c)
NULL
DROP FUNCTION f;
DROP TABLE t;
#
# End of 10.6 tests
#
28 changes: 28 additions & 0 deletions mysql-test/main/win.test
Original file line number Diff line number Diff line change
Expand Up @@ -2829,3 +2829,31 @@ create table t1 (a int);
insert into t1 values (1),(2),(3);
SELECT row_number() OVER (order by a) FROM t1 order by NAME_CONST('myname',NULL);
drop table t1;

--echo #
--echo # MDEV-28206 SIGSEGV in Item_field::fix_fields when using LEAD...OVER
--echo #

CREATE TABLE t(c1 INT);

DELIMITER //;
CREATE FUNCTION f() RETURNS INT READS SQL DATA BEGIN
DECLARE v INT;
SELECT 1 INTO v FROM (SELECT c1,COALESCE(LEAD(a2.c1) OVER (PARTITION BY a2.c1 ORDER BY a2.c1),a2.c1) AS a1 FROM (t a2 JOIN t a3 USING (c1))) a4;
RETURN 1;
END//
DELIMITER ;//

SELECT f(),f();

EXECUTE IMMEDIATE "SELECT LEAD(c1) OVER (ORDER BY c1) FROM t NATURAL JOIN t AS a;";
EXECUTE IMMEDIATE "SELECT SUM(c1) OVER (ORDER BY c1) FROM t NATURAL JOIN t AS a;";

EXECUTE IMMEDIATE "SELECT LEAD(c) OVER (ORDER BY c) FROM (SELECT 1 AS c) AS a NATURAL JOIN (SELECT 1 AS c) AS b;";

DROP FUNCTION f;
DROP TABLE t;

--echo #
--echo # End of 10.6 tests
--echo #

0 comments on commit 3ff4eb0

Please sign in to comment.