Skip to content

Commit

Permalink
Merge 10.6 into 10.7
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jun 7, 2022
2 parents 7e39470 + 4b6f5ae commit 09dc322
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 27 deletions.
2 changes: 0 additions & 2 deletions mysql-test/main/mysqladmin.result
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ mysqld is alive
# Creating an empty file 'cnf_file'
# Using --defaults-extra-file option with 'cnf_file'.
mysqld is alive
# Kill the server
# restart: --ssl-key=MYSQLTEST_VARDIR/tmp/ssl_key.pem --ssl-cert=MYSQLTEST_VARDIR/tmp/ssl_cert.pem
connect ssl_con,localhost,root,,,,,SSL;
SELECT VARIABLE_VALUE INTO @ssl_not_after FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_server_not_after';
Expand All @@ -26,5 +25,4 @@ SELECT VARIABLE_VALUE INTO @ssl_not_after FROM INFORMATION_SCHEMA.SESSION_STATUS
Result
OK
# Cleanup
# Kill the server
# restart
10 changes: 4 additions & 6 deletions mysql-test/main/mysqladmin.test
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ EOF
# MDEV-19168 Reload SSL certificate
# This test reloads server SSL certs ./mysqladmin flush-ssl, and checks that new SSL
# connection use new certificate.
# SWtatus variable Ssl_server_not_after is used to tell the old certificate from new.
# Status variable Ssl_server_not_after is used to tell the old certificate from new.
#

source include/have_ssl_communication.inc;
Expand All @@ -72,8 +72,7 @@ copy_file $MYSQL_TEST_DIR/std_data/server-key.pem $ssl_key;
copy_file $MYSQL_TEST_DIR/std_data/server-cert.pem $ssl_cert;

let $restart_parameters=--ssl-key=$ssl_key --ssl-cert=$ssl_cert;
--source include/kill_mysqld.inc
--source include/start_mysqld.inc
--source include/restart_mysqld.inc

connect ssl_con,localhost,root,,,,,SSL;
SELECT VARIABLE_VALUE INTO @ssl_not_after FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_server_not_after';
Expand All @@ -94,7 +93,6 @@ exec $MYSQL --ssl -e "SELECT IF(VARIABLE_VALUE <> '$ssl_not_after', 'OK', 'FAI
--echo # Cleanup
remove_file $ssl_cert;
remove_file $ssl_key;
# restart with usuall SSL
# restart with usual SSL
let $restart_parameters=;
--source include/kill_mysqld.inc
--source include/start_mysqld.inc
--source include/restart_mysqld.inc
1 change: 1 addition & 0 deletions plugin/type_inet/mysql-test/type_inet/type_inet6.test
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,7 @@ SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::';
SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::1';
DROP TABLE t1;


--echo #
--echo # MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"
--echo #
Expand Down
2 changes: 1 addition & 1 deletion plugin/type_inet/sql_type_inet.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2014 MariaDB Foundation
Copyright (c) 2019,2021 MariaDB Corporation
Copyright (c) 2019,2022 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
14 changes: 10 additions & 4 deletions storage/maria/ma_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ my_bool _ma_read_cache(MARIA_HA *handler, IO_CACHE *info, uchar *buff,
DBUG_ENTER("_ma_read_cache");
DBUG_ASSERT(!(info->myflags & MY_ENCRYPT));

if (unlikely(pos >= info->end_of_file) && (flag & READING_HEADER))
DBUG_RETURN(-1);

if (pos < info->pos_in_file)
{
read_length=length;
Expand Down Expand Up @@ -95,14 +98,17 @@ my_bool _ma_read_cache(MARIA_HA *handler, IO_CACHE *info, uchar *buff,
if (!(flag & READING_HEADER) || (int) read_length == -1 ||
read_length+in_buff_length < 3)
{
if ((flag & READING_HEADER) && read_length + in_buff_length == 0)
DBUG_RETURN(-1); /* End of file */

DBUG_PRINT("error",
("Error %d reading next-multi-part block (Got %d bytes)",
my_errno, (int) read_length));
("Error %d reading next-multi-part block (Got %d of %d bytes)",
my_errno, (int) read_length, (int) length));
if (!my_errno || my_errno == HA_ERR_FILE_TOO_SHORT)
{
if (!handler->in_check_table)
_ma_set_fatal_error(handler->s, HA_ERR_WRONG_IN_RECORD);
else
_ma_set_fatal_error(handler->s, HA_ERR_FILE_TOO_SHORT);
if (!my_errno)
my_errno= HA_ERR_WRONG_IN_RECORD;
}
DBUG_RETURN(1);
Expand Down
2 changes: 0 additions & 2 deletions storage/maria/ma_locking.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,15 +553,13 @@ void _ma_mark_file_crashed(MARIA_SHARE *share)
{
uchar buff[2];
DBUG_ENTER("_ma_mark_file_crashed");
CRASH_IF_S3_TABLE(share);

share->state.changed|= STATE_CRASHED;
if (share->no_status_updates)
DBUG_VOID_RETURN; /* Safety */

mi_int2store(buff, share->state.changed);


/*
We can ignore the errors, as if the mark failed, there isn't anything
else we can do; The user should already have got an error that the
Expand Down
22 changes: 10 additions & 12 deletions storage/maria/ma_pagecache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2893,10 +2893,14 @@ static void read_big_block(PAGECACHE *pagecache,
if (pagecache->big_block_read(pagecache, &args, &block->hash_link->file,
&data))
{
pagecache->big_block_free(&data);
pagecache_pthread_mutex_lock(&pagecache->cache_lock);
block_to_read->status|= PCBLOCK_ERROR;
block_to_read->error= (int16) my_errno;
pagecache->big_block_free(&data);

/* Handle the block that we originally wanted with read */
block->status|= PCBLOCK_ERROR;
block->error= block_to_read->error;
goto error;
}

Expand Down Expand Up @@ -2980,6 +2984,7 @@ static void read_big_block(PAGECACHE *pagecache,
block_to_read->status&= ~PCBLOCK_BIG_READ;
if (block_to_read != block)
{
/* Unlock the 'first block' in the big read */
remove_reader(block_to_read);
unreg_request(pagecache, block_to_read, 1);
}
Expand All @@ -2993,18 +2998,11 @@ static void read_big_block(PAGECACHE *pagecache,
Read failed. Mark all readers waiting for the a block covered by the
big block that the read failed
*/
for (offset= pagecache->block_size, page= page_to_read + 1;
offset < data.length;
offset+= pagecache->block_size, page++)
for (offset= 0, page= page_to_read + 1;
offset < big_block_size_in_pages;
offset++)
{
DBUG_ASSERT(offset + pagecache->block_size <= data.length);
if (page == our_page)
{
DBUG_ASSERT(!(block->status & PCBLOCK_READ));
block->status|= PCBLOCK_ERROR;
block->error= (int16) my_errno;
}
else
if (page != our_page)
{
PAGECACHE_BLOCK_LINK *bl;
bl= find_block(pagecache, &block->hash_link->file, page, 1,
Expand Down

0 comments on commit 09dc322

Please sign in to comment.