Skip to content

Commit

Permalink
Merge 10.4 into 10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jun 21, 2021
2 parents bcedb42 + baf0ef9 commit a42c80b
Show file tree
Hide file tree
Showing 86 changed files with 790 additions and 630 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Code status:
------------

* [![Travis CI status](https://secure.travis-ci.org/MariaDB/server.png?branch=10.5)](https://travis-ci.org/MariaDB/server) travis-ci.org (10.5 branch)
* [![Appveyor CI status](https://ci.appveyor.com/api/projects/status/4u6pexmtpuf8jq66?svg=true)](https://ci.appveyor.com/project/rasmushoj/server) ci.appveyor.com

## MariaDB: The open source relational database
Expand Down Expand Up @@ -78,5 +77,3 @@ https://mariadb.org/about/security-policy/

The code for MariaDB, including all revision history, can be found at:
https://github.com/MariaDB/server

***************************************************************************
18 changes: 11 additions & 7 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2020, MariaDB
Copyright (c) 2009, 2021, MariaDB
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
Expand Down Expand Up @@ -91,6 +91,8 @@ static my_bool non_blocking_api_enabled= 0;

#define QUERY_PRINT_ORIGINAL_FLAG 4

#define CLOSED_CONNECTION "-closed_connection-"

#ifndef HAVE_SETENV
static int setenv(const char *name, const char *value, int overwrite);
#endif
Expand Down Expand Up @@ -5583,11 +5585,13 @@ void do_close_connection(struct st_command *command)
my_free(con->name);

/*
When the connection is closed set name to "-closed_connection-"
When the connection is closed set name to CLOSED_CONNECTION
to make it possible to reuse the connection name.
*/
if (!(con->name = my_strdup(PSI_NOT_INSTRUMENTED, "-closed_connection-", MYF(MY_WME))))
if (!(con->name = my_strdup(PSI_NOT_INSTRUMENTED, CLOSED_CONNECTION,
MYF(MY_WME))))
die("Out of memory");
con->name_len= sizeof(CLOSED_CONNECTION)-1;

if (con == cur_con)
{
Expand Down Expand Up @@ -5990,7 +5994,7 @@ void do_connect(struct st_command *command)
con_slot= next_con;
else
{
if (!(con_slot= find_connection_by_name("-closed_connection-")))
if (!(con_slot= find_connection_by_name(CLOSED_CONNECTION)))
die("Connection limit exhausted, you can have max %d connections",
opt_max_connections);
my_free(con_slot->name);
Expand Down Expand Up @@ -8603,7 +8607,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
log_file.flush();
dynstr_set(&ds_res, 0);

if (view_protocol_enabled &&
if (view_protocol_enabled && mysql &&
complete_query &&
match_re(&view_re, query))
{
Expand Down Expand Up @@ -8649,7 +8653,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
dynstr_free(&query_str);
}

if (sp_protocol_enabled &&
if (sp_protocol_enabled && mysql &&
complete_query &&
match_re(&sp_re, query))
{
Expand Down Expand Up @@ -9012,7 +9016,7 @@ static void dump_backtrace(void)
struct st_connection *conn= cur_con;

fprintf(stderr, "read_command_buf (%p): ", read_command_buf);
my_safe_print_str(read_command_buf, sizeof(read_command_buf));
fprintf(stderr, "%.*s\n", (int)read_command_buflen, read_command_buf);
fputc('\n', stderr);

if (conn)
Expand Down
5 changes: 3 additions & 2 deletions cmake/do_abi_check.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ FOREACH(file ${ABI_HEADERS})
FILE(REMOVE ${tmpfile})
EXECUTE_PROCESS(
COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE result)
IF(NOT ${result} EQUAL 0)
IF(result MATCHES "No such file or directory")
MESSAGE("Command 'diff' not found. ABI check for ${file} skipped.")
ELSEIF(NOT result EQUAL 0)
IF(ABI_UPDATE)
EXECUTE_PROCESS(COMMAND mv -v ${abi_check_out} ${file}.pp)
ELSE(ABI_UPDATE)
Expand All @@ -85,4 +87,3 @@ FOREACH(file ${ABI_HEADERS})
ENDIF()
FILE(REMOVE ${abi_check_out})
ENDFOREACH()

22 changes: 22 additions & 0 deletions cmake/os/OpenBSD.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (C) 2012 Monty Program Ab, 2021 Brad Smith
#
# 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 St, Fifth Floor, Boston, MA 02110-1335 USA

# This file includes OpenBSD specific options and quirks, related to system checks

# Find libexecinfo (library that contains backtrace_symbols etc)
FIND_LIBRARY(EXECINFO NAMES execinfo)
IF(EXECINFO)
SET(LIBEXECINFO ${EXECINFO})
ENDIF()
39 changes: 5 additions & 34 deletions extra/innochecksum.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2014, 2020, MariaDB Corporation.
Copyright (c) 2014, 2021, 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
Expand Down Expand Up @@ -111,13 +111,10 @@ static ulong write_check;
struct innodb_page_type {
int n_undo_state_active;
int n_undo_state_cached;
int n_undo_state_to_free;
int n_undo_state_to_purge;
int n_undo_state_prepared;
int n_undo_state_other;
int n_undo_insert;
int n_undo_update;
int n_undo_other;
int n_undo;
int n_fil_page_index;
int n_fil_page_undo_log;
int n_fil_page_inode;
Expand Down Expand Up @@ -937,21 +934,7 @@ parse_page(
fprintf(file, "#::%llu\t\t|\t\tUndo log page\t\t\t|",
cur_page_num);
}
if (undo_page_type == TRX_UNDO_INSERT) {
page_type.n_undo_insert++;
if (page_type_dump) {
fprintf(file, "\t%s",
"Insert Undo log page");
}

} else if (undo_page_type == TRX_UNDO_UPDATE) {
page_type.n_undo_update++;
if (page_type_dump) {
fprintf(file, "\t%s",
"Update undo log page");
}
}

page_type.n_undo++;
undo_page_type = mach_read_from_2(page + TRX_UNDO_SEG_HDR +
TRX_UNDO_STATE);
switch (undo_page_type) {
Expand All @@ -971,14 +954,6 @@ parse_page(
}
break;

case TRX_UNDO_TO_FREE:
page_type.n_undo_state_to_free++;
if (page_type_dump) {
fprintf(file, ", %s", "Insert undo "
"segment that can be freed");
}
break;

case TRX_UNDO_TO_PURGE:
page_type.n_undo_state_to_purge++;
if (page_type_dump) {
Expand Down Expand Up @@ -1202,15 +1177,11 @@ print_summary(

fprintf(fil_out, "\n===============================================\n");
fprintf(fil_out, "Additional information:\n");
fprintf(fil_out, "Undo page type: %d insert, %d update, %d other\n",
page_type.n_undo_insert,
page_type.n_undo_update,
page_type.n_undo_other);
fprintf(fil_out, "Undo page state: %d active, %d cached, %d to_free, %d"
fprintf(fil_out, "Undo page type: %d\n", page_type.n_undo);
fprintf(fil_out, "Undo page state: %d active, %d cached, %d"
" to_purge, %d prepared, %d other\n",
page_type.n_undo_state_active,
page_type.n_undo_state_cached,
page_type.n_undo_state_to_free,
page_type.n_undo_state_to_purge,
page_type.n_undo_state_prepared,
page_type.n_undo_state_other);
Expand Down
1 change: 1 addition & 0 deletions extra/wolfssl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ IF(WOLFSSL_X86_64_BUILD)
SET(USE_INTEL_SPEEDUP 1)
LIST(APPEND WOLFCRYPT_SOURCES
${WOLFCRYPT_SRCDIR}/aes_asm.S
${WOLFCRYPT_SRCDIR}/aes_gcm_asm.S
${WOLFCRYPT_SRCDIR}/sha512_asm.S
${WOLFCRYPT_SRCDIR}/sha256_asm.S)
ADD_DEFINITIONS(-maes -msse4.2 -mpclmul)
Expand Down
3 changes: 2 additions & 1 deletion extra/wolfssl/user_settings.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
#define WC_RSA_BLINDING
#define HAVE_TLS_EXTENSIONS
#define HAVE_AES_ECB
#define HAVE_AESGCM
#define WOLFSSL_AES_COUNTER
#define NO_WOLFSSL_STUB
#define OPENSSL_ALL
#undef WOLFSSL_ALLOW_TLSV10 /* see https://github.com/wolfSSL/wolfssl/issues/2960 */
#define WOLFSSL_ALLOW_TLSV10
#define NO_OLD_TIMEVAL_NAME
/*
FP_MAX_BITS is set high solely to satisfy ssl_8k_key.test
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/service_my_crypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern "C" {
/* The max key length of all supported algorithms */
#define MY_AES_MAX_KEY_LENGTH 32

#define MY_AES_CTX_SIZE 640
#define MY_AES_CTX_SIZE 656

enum my_aes_mode {
MY_AES_ECB, MY_AES_CBC
Expand Down
2 changes: 1 addition & 1 deletion libmariadb
3 changes: 0 additions & 3 deletions mysql-test/main/connect-abstract.cnf
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

!include include/default_my.cnf

[mysqld.1]
socket= @ENV.ABSTRACT_SOCKET

# Using @OPT.port here for uniqueness
[ENV]
ABSTRACT_SOCKET= @mtr-test-abstract-socket-@OPT.port
2 changes: 0 additions & 2 deletions mysql-test/main/connect-abstract.result
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
connect con1,localhost,root,,test,,$ABSTRACT_SOCKET;
select 1;
1
1
disconnect con1;
5 changes: 4 additions & 1 deletion mysql-test/main/connect-abstract.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
--source include/linux.inc
--source include/not_embedded.inc

let $restart_parameters=--socket=$ABSTRACT_SOCKET
--source include/kill_mysqld.inc
--source include/start_mysqld.inc

connect(con1,localhost,root,,test,,$ABSTRACT_SOCKET);
select 1;
disconnect con1;
7 changes: 5 additions & 2 deletions mysql-test/main/failed_auth_unixsocket.result
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket') where user='root';
create table global_priv_backup select * from mysql.global_priv;
update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket');
delete from mysql.global_priv where user != 'root';
flush privileges;
connect(localhost,USER,,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'USER'@'localhost'
ERROR 28000: Access denied for user 'USER'@'localhost'
update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin')) where user='root';
replace mysql.global_priv select * from global_priv_backup;
flush privileges;
drop table global_priv_backup;
7 changes: 5 additions & 2 deletions mysql-test/main/failed_auth_unixsocket.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
# MDEV-3909 remote user enumeration
# unix_socket tests
#
update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket') where user='root';
create table global_priv_backup select * from mysql.global_priv;
update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket');
delete from mysql.global_priv where user != 'root';
flush privileges;

# Make sure that the replace works, even if $USER is 'user' or something else
Expand All @@ -22,5 +24,6 @@ connect (fail,localhost,$USER);
--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
change_user $USER;

update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin')) where user='root';
replace mysql.global_priv select * from global_priv_backup;
flush privileges;
drop table global_priv_backup;
6 changes: 3 additions & 3 deletions mysql-test/main/password_expiration_unix_socket.result
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# A password cannot expire, if there is no password
#
create user USER identified via unix_socket;
alter user USER password expire;
create user 'USER' identified via unix_socket;
alter user 'USER' password expire;
1
1
drop user USER;
drop user 'USER';
18 changes: 9 additions & 9 deletions mysql-test/main/password_expiration_unix_socket.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
--echo # A password cannot expire, if there is no password
--echo #

--let $replace=create user $USER
--replace_result $replace "create user USER"
--eval create user $USER identified via unix_socket
--let $replace=create user '$USER'
--replace_result $replace "create user 'USER'"
--eval create user '$USER' identified via unix_socket

--let $replace=alter user $USER
--replace_result $replace "alter user USER"
--eval alter user $USER password expire
--let $replace=alter user '$USER'
--replace_result $replace "alter user 'USER'"
--eval alter user '$USER' password expire

--exec $MYSQL -u $USER -e 'select 1'

--let $replace=drop user $USER
--replace_result $replace "drop user USER"
--eval drop user $USER
--let $replace=drop user '$USER'
--replace_result $replace "drop user 'USER'"
--eval drop user '$USER'
19 changes: 19 additions & 0 deletions mysql-test/main/win.result
Original file line number Diff line number Diff line change
Expand Up @@ -3893,6 +3893,25 @@ id rn
1 1
drop table t1;
#
# MDEV-25630: Crash with window function in left expr of IN subquery
#
CREATE TABLE t1 (i int);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT lag(i) over (ORDER BY i) IN ( SELECT 1 FROM t1 a) FROM t1;
lag(i) over (ORDER BY i) IN ( SELECT 1 FROM t1 a)
NULL
1
0
DROP TABLE t1;
CREATE TABLE t1 (i int);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT sum(i) over () IN ( SELECT 1 FROM t1 a) FROM t1;
sum(i) over () IN ( SELECT 1 FROM t1 a)
0
0
0
DROP TABLE t1;
#
# End of 10.2 tests
#
#
Expand Down
14 changes: 14 additions & 0 deletions mysql-test/main/win.test
Original file line number Diff line number Diff line change
Expand Up @@ -2541,6 +2541,20 @@ order by rn desc;

drop table t1;

--echo #
--echo # MDEV-25630: Crash with window function in left expr of IN subquery
--echo #

CREATE TABLE t1 (i int);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT lag(i) over (ORDER BY i) IN ( SELECT 1 FROM t1 a) FROM t1;
DROP TABLE t1;

CREATE TABLE t1 (i int);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT sum(i) over () IN ( SELECT 1 FROM t1 a) FROM t1;
DROP TABLE t1;

--echo #
--echo # End of 10.2 tests
--echo #
Expand Down
1 change: 1 addition & 0 deletions mysql-test/main/wolfssl.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--ssl_cipher=ECDHE-RSA-AES256-GCM-SHA384
6 changes: 6 additions & 0 deletions mysql-test/main/wolfssl.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Various tests that require WolfSSL
#
--source include/have_ssl_communication.inc
--source include/not_embedded.inc
SELECT @@ssl_cipher;
2 changes: 0 additions & 2 deletions mysql-test/suite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ sub skip_combinations {
$skip{'main/ssl_verify_ip.test'} = 'x509v3 support required'
unless $openssl_ver ge "1.0.2";

$skip{'main/tls_version1.test'} = 'https://github.com/wolfSSL/wolfssl/issues/2960'
if $ssl_lib =~ /WolfSSL 4.4.0/;

%skip;
}
Expand Down
Loading

0 comments on commit a42c80b

Please sign in to comment.