Skip to content

Commit

Permalink
Merge 10.10 into 10.11
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Mar 17, 2023
2 parents ceb0e7f + 3dd3378 commit c50f849
Show file tree
Hide file tree
Showing 70 changed files with 1,850 additions and 1,506 deletions.
5 changes: 4 additions & 1 deletion .gitlab-ci.yml
Expand Up @@ -331,6 +331,7 @@ mysql-test-run-asan:
needs:
- "fedora-sanitizer: [-DWITH_ASAN=YES]"
<<: *mysql-test-run-def
allow_failure: true
artifacts:
when: always # Also show results when tests fail
reports:
Expand Down Expand Up @@ -489,6 +490,8 @@ mini-benchmark:
stage: test
dependencies:
- fedora
needs:
- fedora
script:
- ls -la rpm; rm -vf rpm/*.el?.* # Delete artifacts from Centos builds
# Don't use cracklib, otherwise the Sysbench user password will be rejected
Expand All @@ -503,7 +506,7 @@ mini-benchmark:
- |
mariadb --skip-column-names -e "SELECT @@version, @@version_comment" | tee /tmp/version
grep $MARIADB_MAJOR_VERSION /tmp/version || echo "MariaDB didn't install properly"
- yum install -y sysbench procps-ng perf || yum install -y https://kojipkgs.fedoraproject.org//packages/luajit/2.0.4/3.el7/x86_64/luajit-2.0.4-3.el7.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/sysbench/1.0.17/2.el7/x86_64/sysbench-1.0.17-2.el7.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/ck/0.5.2/2.el7/x86_64/ck-0.5.2-2.el7.x86_64.rpm
- yum install -y sysbench procps-ng perf util-linux || yum install -y https://kojipkgs.fedoraproject.org//packages/luajit/2.0.4/3.el7/x86_64/luajit-2.0.4-3.el7.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/sysbench/1.0.17/2.el7/x86_64/sysbench-1.0.17-2.el7.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/ck/0.5.2/2.el7/x86_64/ck-0.5.2-2.el7.x86_64.rpm
- /usr/share/mysql/mini-benchmark
- cp -av */sysbench-run-*.log */metrics.txt .. # Move files one level down so they can be saved as artifacts
artifacts:
Expand Down
1 change: 1 addition & 0 deletions debian/libmariadb-dev.install
Expand Up @@ -15,6 +15,7 @@ usr/include/mariadb/mariadb_version.h
usr/include/mariadb/my_config.h
usr/include/mariadb/my_global.h
usr/include/mariadb/my_sys.h
usr/include/mariadb/my_alloca.h
usr/include/mariadb/mysql.h
usr/include/mariadb/mysql/
usr/include/mariadb/mysql/client_plugin.h
Expand Down
16 changes: 13 additions & 3 deletions extra/mariabackup/xtrabackup.cc
Expand Up @@ -2280,8 +2280,14 @@ static bool innodb_init()
/* Check if the data files exist or not. */
dberr_t err= srv_sys_space.check_file_spec(&create_new_db, 5U << 20);

if (create_new_db)
{
msg("mariadb-backup: InnoDB files do not exist");
return true;
}

if (err == DB_SUCCESS)
err= srv_start(create_new_db);
err= srv_start(false);

if (err != DB_SUCCESS)
{
Expand All @@ -2292,6 +2298,7 @@ static bool innodb_init()
ut_ad(srv_force_recovery <= SRV_FORCE_IGNORE_CORRUPT);
ut_ad(recv_no_log_write);
buf_flush_sync();
recv_sys.debug_free();
DBUG_ASSERT(!buf_pool.any_io_pending());
log_sys.close_file();

Expand Down Expand Up @@ -3473,7 +3480,9 @@ static void xb_load_single_table_tablespace(const char *dirname,
if (err == DB_SUCCESS && file->space_id() != SRV_TMP_SPACE_ID) {
space = fil_space_t::create(
file->space_id(), file->flags(),
FIL_TYPE_TABLESPACE, NULL/* TODO: crypt_data */);
FIL_TYPE_TABLESPACE, nullptr/* TODO: crypt_data */,
FIL_ENCRYPTION_DEFAULT,
file->handle() != OS_FILE_CLOSED);

ut_a(space != NULL);
fil_node_t* node= space->add(
Expand Down Expand Up @@ -5193,7 +5202,8 @@ xb_delta_open_matching_space(
ut_ad(fil_space_t::physical_size(flags) == info.page_size);

if (fil_space_t::create(info.space_id, flags,
FIL_TYPE_TABLESPACE, 0)) {
FIL_TYPE_TABLESPACE, 0, FIL_ENCRYPTION_DEFAULT,
true)) {
*success = xb_space_create_file(real_name, info.space_id,
flags, &file);
} else {
Expand Down
3 changes: 3 additions & 0 deletions include/CMakeLists.txt
Expand Up @@ -37,6 +37,7 @@ SET(HEADERS
ma_dyncol.h
my_list.h
my_alloc.h
my_alloca.h
typelib.h
my_dbug.h
m_string.h
Expand Down Expand Up @@ -111,7 +112,9 @@ ${footer}
ENDMACRO()

INSTALL_COMPAT_HEADER(my_global.h "")
INSTALL_COMPAT_HEADER(my_alloca.h "")
INSTALL_COMPAT_HEADER(my_config.h "")
INSTALL_COMPAT_HEADER(my_alloca.h "")
INSTALL_COMPAT_HEADER(my_sys.h "")
INSTALL_COMPAT_HEADER(mysql_version.h "
#include <mariadb_version.h>
Expand Down
45 changes: 45 additions & 0 deletions include/my_alloca.h
@@ -0,0 +1,45 @@
/* Copyright (c) 2023, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

#ifndef MY_ALLOCA_INCLUDED
#define MY_ALLOCA_INCLUDED

#ifdef _WIN32
#include <malloc.h> /*for alloca*/
/*
MSVC may define "alloca" when compiling in /Ze mode
(with extensions from Microsoft), but otherwise only
the _alloca function is defined:
*/
#ifndef alloca
#define alloca _alloca
#endif
#else
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#endif

#if defined(HAVE_ALLOCA)
/*
If the GCC/LLVM compiler from the MinGW is used,
alloca may not be defined when using the MSVC CRT:
*/
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && !defined(alloca)
#define alloca __builtin_alloca
#endif /* GNUC */
#endif

#endif /* MY_ALLOCA_INCLUDED */
8 changes: 1 addition & 7 deletions include/my_global.h
Expand Up @@ -330,13 +330,6 @@ C_MODE_END
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#if defined(__cplusplus) && defined(NO_CPLUSPLUS_ALLOCA)
#undef HAVE_ALLOCA
#undef HAVE_ALLOCA_H
#endif
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif

#include <errno.h> /* Recommended by debian */
/* We need the following to go around a problem with openssl on solaris */
Expand Down Expand Up @@ -493,6 +486,7 @@ typedef unsigned short ushort;
#endif

#include <my_compiler.h>
#include <my_alloca.h>

/*
Wen using the embedded library, users might run into link problems,
Expand Down
14 changes: 1 addition & 13 deletions include/my_sys.h
Expand Up @@ -28,9 +28,7 @@ C_MODE_START
#include <m_ctype.h> /* for CHARSET_INFO */
#include <stdarg.h>
#include <typelib.h>
#ifdef _WIN32
#include <malloc.h> /*for alloca*/
#endif
#include <my_alloca.h>
#include <mysql/plugin.h>
#include <mysql/service_my_print_error.h>

Expand Down Expand Up @@ -195,16 +193,6 @@ my_bool my_test_if_thinly_provisioned(File handle);
extern my_bool my_may_have_atomic_write;

#if defined(HAVE_ALLOCA) && !defined(HAVE_valgrind)
#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
#pragma alloca
#endif /* _AIX */
#if defined(__MWERKS__)
#undef alloca
#define alloca _alloca
#endif /* __MWERKS__ */
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca)
#define alloca __builtin_alloca
#endif /* GNUC */
#define my_alloca(SZ) alloca((size_t) (SZ))
#define my_afree(PTR) ((void)0)
#define MAX_ALLOCA_SZ 4096
Expand Down
11 changes: 4 additions & 7 deletions include/mysql/service_encryption.h
Expand Up @@ -24,22 +24,19 @@
*provider* (encryption plugin).
*/

#ifdef __cplusplus
extern "C" {
#endif

#ifndef MYSQL_ABI_CHECK
#include <my_alloca.h>
#ifdef _WIN32
#include <malloc.h>
#ifndef __cplusplus
#define inline __inline
#endif
#else
#include <stdlib.h>
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#endif

#ifdef __cplusplus
extern "C" {
#endif

/* returned from encryption_key_get_latest_version() */
Expand Down
17 changes: 17 additions & 0 deletions mysql-test/main/derived_cond_pushdown.result
Expand Up @@ -20700,3 +20700,20 @@ id select_type table type possible_keys key key_len ref rows Extra
drop view v1;
drop table t1;
# End of 10.4 tests
#
# MDEV-28958: condition pushable into view after simplification
# contains constant TRUE/FALSE as subformula
#
create table t1 (c1 int);
insert into t1 values (3), (7), (1), (3), (1), (3);
create table t2 (c2 int);
insert into t2 values (3), (5), (7), (3);
create view v1 as select * from t1 group by c1;
create view v2 as select c1 as a, c2 as b from v1,t2 where c1=c2;
select * from v2 group by a,b having a=b or b > a+10;
a b
3 3
7 7
drop view v1,v2;
drop table t1,t2;
# End of 10.7 tests
21 changes: 21 additions & 0 deletions mysql-test/main/derived_cond_pushdown.test
Expand Up @@ -3944,3 +3944,24 @@ drop view v1;
drop table t1;

--echo # End of 10.4 tests

--echo #
--echo # MDEV-28958: condition pushable into view after simplification
--echo # contains constant TRUE/FALSE as subformula
--echo #

create table t1 (c1 int);
insert into t1 values (3), (7), (1), (3), (1), (3);

create table t2 (c2 int);
insert into t2 values (3), (5), (7), (3);

create view v1 as select * from t1 group by c1;
create view v2 as select c1 as a, c2 as b from v1,t2 where c1=c2;

select * from v2 group by a,b having a=b or b > a+10;

drop view v1,v2;
drop table t1,t2;

--echo # End of 10.7 tests
21 changes: 21 additions & 0 deletions mysql-test/main/partition_charset.result
Expand Up @@ -20,3 +20,24 @@ create table t1 (a varchar(1), primary key (a))
partition by list (ascii(a))
(partition p1 values in (65));
ERROR HY000: This partition function is not allowed
#
# Start of 10.9 tests
#
#
# MDEV-30805 SIGSEGV in my_convert and UBSAN: member access within null pointer of type 'const struct MY_CHARSET_HANDLER' in my_convert
#
CREATE TABLE t1 (a CHAR CHARACTER SET ucs2)
PARTITION BY RANGE COLUMNS (a)
(PARTITION p0 VALUES LESS THAN ('a'));
ALTER TABLE t1 CHANGE COLUMN a a CHAR BINARY;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(1) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE COLUMNS(`a`)
(PARTITION `p0` VALUES LESS THAN ('a') ENGINE = MyISAM)
DROP TABLE t1;
#
# End of 10.9 tests
#
20 changes: 20 additions & 0 deletions mysql-test/main/partition_charset.test
Expand Up @@ -27,3 +27,23 @@ partition by list (ascii(a))
#insert into t1 values ('A');
#replace into t1 values ('A');
#drop table t1;

--echo #
--echo # Start of 10.9 tests
--echo #

--echo #
--echo # MDEV-30805 SIGSEGV in my_convert and UBSAN: member access within null pointer of type 'const struct MY_CHARSET_HANDLER' in my_convert
--echo #

CREATE TABLE t1 (a CHAR CHARACTER SET ucs2)
PARTITION BY RANGE COLUMNS (a)
(PARTITION p0 VALUES LESS THAN ('a'));
ALTER TABLE t1 CHANGE COLUMN a a CHAR BINARY;
SHOW CREATE TABLE t1;
DROP TABLE t1;

--echo #
--echo # End of 10.9 tests
--echo #

2 changes: 1 addition & 1 deletion mysql-test/main/partition_utf8-debug.result
Expand Up @@ -77,7 +77,7 @@ CREATE OR REPLACE TABLE t1 (a DATE) CHARACTER SET utf8
PARTITION BY LIST COLUMNS (a) (PARTITION p0 VALUES IN (FROM_DAYS(100)));
Warnings:
Note 1003 PARTITION BY LIST COLUMNS(`a`)
(PARTITION `p0` VALUES IN (_utf8mb3 0x303030302d30302d3030) ENGINE = MyISAM)
(PARTITION `p0` VALUES IN (_latin1 0x303030302d30302d3030) ENGINE = MyISAM)
SELECT PARTITION_DESCRIPTION FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME='t1';
PARTITION_DESCRIPTION
'0000-00-00'
Expand Down
Expand Up @@ -31,8 +31,10 @@ insert into t8 values (1, 'publicmessage');
insert into t9 values (1, 'pugliccompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc');

--echo # should list tables t1-t6
--sorted_result
SELECT NAME,ENCRYPTION_SCHEME,CURRENT_KEY_ID FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'enctests%';
--echo # should list tables t7-t9
--sorted_result
SELECT NAME,ENCRYPTION_SCHEME,CURRENT_KEY_ID FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 and NAME LIKE 'enctests%';

--let $MYSQLD_DATADIR=`select @@datadir`
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/innodb_encryption_is.test
Expand Up @@ -9,6 +9,7 @@ INSERT INTO t2 VALUES ('foobar');
#
# MDEV-9640: Add used key_id to INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
#
--sorted_result
SELECT NAME, ENCRYPTION_SCHEME, MIN_KEY_VERSION, CURRENT_KEY_VERSION,
CURRENT_KEY_ID
FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
Expand Down
Expand Up @@ -190,7 +190,7 @@ compress_pages_page_decompressed compression 0 NULL NULL NULL 0 NULL NULL NULL N
compress_pages_page_compression_error compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of page compression errors
compress_pages_encrypted compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of pages encrypted
compress_pages_decrypted compression 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of pages decrypted
index_page_splits index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of index page splits
index_page_splits index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of index page splits
index_page_merge_attempts index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of index page merge attempts
index_page_merge_successful index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of successful index page merges
index_page_reorg_attempts index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of index page reorganization attempts
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/innodb/r/innodb_status_variables.result
Expand Up @@ -23,6 +23,7 @@ INNODB_BUFFER_POOL_PAGES_OLD
INNODB_BUFFER_POOL_PAGES_TOTAL
INNODB_BUFFER_POOL_PAGES_LRU_FLUSHED
INNODB_BUFFER_POOL_PAGES_LRU_FREED
INNODB_BUFFER_POOL_PAGES_SPLIT
INNODB_BUFFER_POOL_READ_AHEAD_RND
INNODB_BUFFER_POOL_READ_AHEAD
INNODB_BUFFER_POOL_READ_AHEAD_EVICTED
Expand Down
20 changes: 20 additions & 0 deletions mysql-test/suite/innodb/r/online_table_rebuild.result
Expand Up @@ -43,5 +43,25 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
#
# MDEV-30183 Assertion `!memcmp(rec_trx_id, old_pk_trx_id->data,
# 6 + 7)' failed in row_log_table_apply_update
#
set @old_sql_mode = @@sql_mode;
set @@sql_mode="";
CREATE TABLE t1(col_int int, col_varchar varchar(500))ENGINE=InnoDB;
INSERT INTO t1(col_int) values(2560);
set debug_sync="row_log_table_apply1_before SIGNAL con1_begin WAIT_FOR con1_commit";
ALTER TABLE t1 ADD PRIMARY KEY ( col_varchar);
connection con1;
SET DEBUG_SYNC="now WAIT_FOR con1_begin";
UPDATE t1 SET col_int = 2178;
INSERT INTO t1(col_int) VALUES(3016);
UPDATE t1 set col_int=2802;
SET DEBUG_SYNC="now SIGNAL con1_commit";
connection default;
ERROR 23000: Duplicate entry '' for key 'PRIMARY'
DROP TABLE t1;
SET @@sql_mode = @old_sql_mode;
disconnect con1;
SET DEBUG_SYNC=reset;

0 comments on commit c50f849

Please sign in to comment.