Commit 09dc3223 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.6 into 10.7

parents 7e39470e 4b6f5aec
...@@ -17,7 +17,6 @@ mysqld is alive ...@@ -17,7 +17,6 @@ mysqld is alive
# Creating an empty file 'cnf_file' # Creating an empty file 'cnf_file'
# Using --defaults-extra-file option with 'cnf_file'. # Using --defaults-extra-file option with 'cnf_file'.
mysqld is alive mysqld is alive
# Kill the server
# restart: --ssl-key=MYSQLTEST_VARDIR/tmp/ssl_key.pem --ssl-cert=MYSQLTEST_VARDIR/tmp/ssl_cert.pem # restart: --ssl-key=MYSQLTEST_VARDIR/tmp/ssl_key.pem --ssl-cert=MYSQLTEST_VARDIR/tmp/ssl_cert.pem
connect ssl_con,localhost,root,,,,,SSL; 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'; SELECT VARIABLE_VALUE INTO @ssl_not_after FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_server_not_after';
...@@ -26,5 +25,4 @@ SELECT VARIABLE_VALUE INTO @ssl_not_after FROM INFORMATION_SCHEMA.SESSION_STATUS ...@@ -26,5 +25,4 @@ SELECT VARIABLE_VALUE INTO @ssl_not_after FROM INFORMATION_SCHEMA.SESSION_STATUS
Result Result
OK OK
# Cleanup # Cleanup
# Kill the server
# restart # restart
...@@ -56,7 +56,7 @@ EOF ...@@ -56,7 +56,7 @@ EOF
# MDEV-19168 Reload SSL certificate # MDEV-19168 Reload SSL certificate
# This test reloads server SSL certs ./mysqladmin flush-ssl, and checks that new SSL # This test reloads server SSL certs ./mysqladmin flush-ssl, and checks that new SSL
# connection use new certificate. # 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; source include/have_ssl_communication.inc;
...@@ -72,8 +72,7 @@ copy_file $MYSQL_TEST_DIR/std_data/server-key.pem $ssl_key; ...@@ -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; copy_file $MYSQL_TEST_DIR/std_data/server-cert.pem $ssl_cert;
let $restart_parameters=--ssl-key=$ssl_key --ssl-cert=$ssl_cert; let $restart_parameters=--ssl-key=$ssl_key --ssl-cert=$ssl_cert;
--source include/kill_mysqld.inc --source include/restart_mysqld.inc
--source include/start_mysqld.inc
connect ssl_con,localhost,root,,,,,SSL; 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'; SELECT VARIABLE_VALUE INTO @ssl_not_after FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_server_not_after';
...@@ -94,7 +93,6 @@ exec $MYSQL --ssl -e "SELECT IF(VARIABLE_VALUE <> '$ssl_not_after', 'OK', 'FAI ...@@ -94,7 +93,6 @@ exec $MYSQL --ssl -e "SELECT IF(VARIABLE_VALUE <> '$ssl_not_after', 'OK', 'FAI
--echo # Cleanup --echo # Cleanup
remove_file $ssl_cert; remove_file $ssl_cert;
remove_file $ssl_key; remove_file $ssl_key;
# restart with usuall SSL # restart with usual SSL
let $restart_parameters=; let $restart_parameters=;
--source include/kill_mysqld.inc --source include/restart_mysqld.inc
--source include/start_mysqld.inc
...@@ -1613,6 +1613,7 @@ SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::'; ...@@ -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'; SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::1';
DROP TABLE t1; DROP TABLE t1;
--echo # --echo #
--echo # MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)" --echo # MDEV-28491 Uuid. "UPDATE/DELETE" not working "WHERE id IN (SELECT id FROM ..)"
--echo # --echo #
......
/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. /* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2014 MariaDB Foundation 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 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 it under the terms of the GNU General Public License as published by
......
...@@ -44,6 +44,9 @@ my_bool _ma_read_cache(MARIA_HA *handler, IO_CACHE *info, uchar *buff, ...@@ -44,6 +44,9 @@ my_bool _ma_read_cache(MARIA_HA *handler, IO_CACHE *info, uchar *buff,
DBUG_ENTER("_ma_read_cache"); DBUG_ENTER("_ma_read_cache");
DBUG_ASSERT(!(info->myflags & MY_ENCRYPT)); 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) if (pos < info->pos_in_file)
{ {
read_length=length; read_length=length;
...@@ -95,14 +98,17 @@ my_bool _ma_read_cache(MARIA_HA *handler, IO_CACHE *info, uchar *buff, ...@@ -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 || if (!(flag & READING_HEADER) || (int) read_length == -1 ||
read_length+in_buff_length < 3) 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", DBUG_PRINT("error",
("Error %d reading next-multi-part block (Got %d bytes)", ("Error %d reading next-multi-part block (Got %d of %d bytes)",
my_errno, (int) read_length)); my_errno, (int) read_length, (int) length));
if (!my_errno || my_errno == HA_ERR_FILE_TOO_SHORT) if (!my_errno || my_errno == HA_ERR_FILE_TOO_SHORT)
{ {
if (!handler->in_check_table) if (!handler->in_check_table)
_ma_set_fatal_error(handler->s, HA_ERR_WRONG_IN_RECORD); _ma_set_fatal_error(handler->s, HA_ERR_FILE_TOO_SHORT);
else if (!my_errno)
my_errno= HA_ERR_WRONG_IN_RECORD; my_errno= HA_ERR_WRONG_IN_RECORD;
} }
DBUG_RETURN(1); DBUG_RETURN(1);
......
...@@ -553,7 +553,6 @@ void _ma_mark_file_crashed(MARIA_SHARE *share) ...@@ -553,7 +553,6 @@ void _ma_mark_file_crashed(MARIA_SHARE *share)
{ {
uchar buff[2]; uchar buff[2];
DBUG_ENTER("_ma_mark_file_crashed"); DBUG_ENTER("_ma_mark_file_crashed");
CRASH_IF_S3_TABLE(share);
share->state.changed|= STATE_CRASHED; share->state.changed|= STATE_CRASHED;
if (share->no_status_updates) if (share->no_status_updates)
...@@ -561,7 +560,6 @@ void _ma_mark_file_crashed(MARIA_SHARE *share) ...@@ -561,7 +560,6 @@ void _ma_mark_file_crashed(MARIA_SHARE *share)
mi_int2store(buff, share->state.changed); mi_int2store(buff, share->state.changed);
/* /*
We can ignore the errors, as if the mark failed, there isn't anything 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 else we can do; The user should already have got an error that the
......
...@@ -2893,10 +2893,14 @@ static void read_big_block(PAGECACHE *pagecache, ...@@ -2893,10 +2893,14 @@ static void read_big_block(PAGECACHE *pagecache,
if (pagecache->big_block_read(pagecache, &args, &block->hash_link->file, if (pagecache->big_block_read(pagecache, &args, &block->hash_link->file,
&data)) &data))
{ {
pagecache->big_block_free(&data);
pagecache_pthread_mutex_lock(&pagecache->cache_lock); pagecache_pthread_mutex_lock(&pagecache->cache_lock);
block_to_read->status|= PCBLOCK_ERROR; block_to_read->status|= PCBLOCK_ERROR;
block_to_read->error= (int16) my_errno; 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; goto error;
} }
...@@ -2980,6 +2984,7 @@ static void read_big_block(PAGECACHE *pagecache, ...@@ -2980,6 +2984,7 @@ static void read_big_block(PAGECACHE *pagecache,
block_to_read->status&= ~PCBLOCK_BIG_READ; block_to_read->status&= ~PCBLOCK_BIG_READ;
if (block_to_read != block) if (block_to_read != block)
{ {
/* Unlock the 'first block' in the big read */
remove_reader(block_to_read); remove_reader(block_to_read);
unreg_request(pagecache, block_to_read, 1); unreg_request(pagecache, block_to_read, 1);
} }
...@@ -2993,18 +2998,11 @@ static void read_big_block(PAGECACHE *pagecache, ...@@ -2993,18 +2998,11 @@ static void read_big_block(PAGECACHE *pagecache,
Read failed. Mark all readers waiting for the a block covered by the Read failed. Mark all readers waiting for the a block covered by the
big block that the read failed big block that the read failed
*/ */
for (offset= pagecache->block_size, page= page_to_read + 1; for (offset= 0, page= page_to_read + 1;
offset < data.length; offset < big_block_size_in_pages;
offset+= pagecache->block_size, page++) offset++)
{ {
DBUG_ASSERT(offset + pagecache->block_size <= data.length); if (page != our_page)
if (page == our_page)
{
DBUG_ASSERT(!(block->status & PCBLOCK_READ));
block->status|= PCBLOCK_ERROR;
block->error= (int16) my_errno;
}
else
{ {
PAGECACHE_BLOCK_LINK *bl; PAGECACHE_BLOCK_LINK *bl;
bl= find_block(pagecache, &block->hash_link->file, page, 1, bl= find_block(pagecache, &block->hash_link->file, page, 1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment