summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-06-07 08:44:20 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-06-07 08:44:20 +0300
commit09dc322342492aa0ae69346582360eb34c5b9128 (patch)
tree8919dfa7f0bd2d7a353b31cb774f5fff56ca249b
parent7e39470e337aeeab4ee3e73336c2fff88609529f (diff)
parent4b6f5aec55305c6424749e919c65165d3b8d9bb1 (diff)
downloadmariadb-git-09dc322342492aa0ae69346582360eb34c5b9128.tar.gz
Merge 10.6 into 10.7
-rw-r--r--mysql-test/main/mysqladmin.result2
-rw-r--r--mysql-test/main/mysqladmin.test10
-rw-r--r--plugin/type_inet/mysql-test/type_inet/type_inet6.test1
-rw-r--r--plugin/type_inet/sql_type_inet.cc2
-rw-r--r--storage/maria/ma_cache.c14
-rw-r--r--storage/maria/ma_locking.c2
-rw-r--r--storage/maria/ma_pagecache.c22
7 files changed, 26 insertions, 27 deletions
diff --git a/mysql-test/main/mysqladmin.result b/mysql-test/main/mysqladmin.result
index 99615f60e1b..5a45a5f366a 100644
--- a/mysql-test/main/mysqladmin.result
+++ b/mysql-test/main/mysqladmin.result
@@ -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';
@@ -26,5 +25,4 @@ SELECT VARIABLE_VALUE INTO @ssl_not_after FROM INFORMATION_SCHEMA.SESSION_STATUS
Result
OK
# Cleanup
-# Kill the server
# restart
diff --git a/mysql-test/main/mysqladmin.test b/mysql-test/main/mysqladmin.test
index 97e805ecf73..9ba5203963a 100644
--- a/mysql-test/main/mysqladmin.test
+++ b/mysql-test/main/mysqladmin.test
@@ -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;
@@ -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';
@@ -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
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6.test b/plugin/type_inet/mysql-test/type_inet/type_inet6.test
index f3a57217f49..ef8399d981f 100644
--- a/plugin/type_inet/mysql-test/type_inet/type_inet6.test
+++ b/plugin/type_inet/mysql-test/type_inet/type_inet6.test
@@ -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 #
diff --git a/plugin/type_inet/sql_type_inet.cc b/plugin/type_inet/sql_type_inet.cc
index 6451986ea54..b8d2ef706a9 100644
--- a/plugin/type_inet/sql_type_inet.cc
+++ b/plugin/type_inet/sql_type_inet.cc
@@ -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
diff --git a/storage/maria/ma_cache.c b/storage/maria/ma_cache.c
index 764aad0788e..6684a1df20b 100644
--- a/storage/maria/ma_cache.c
+++ b/storage/maria/ma_cache.c
@@ -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;
@@ -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);
diff --git a/storage/maria/ma_locking.c b/storage/maria/ma_locking.c
index d5985a68c13..e53c3759f13 100644
--- a/storage/maria/ma_locking.c
+++ b/storage/maria/ma_locking.c
@@ -553,7 +553,6 @@ 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)
@@ -561,7 +560,6 @@ void _ma_mark_file_crashed(MARIA_SHARE *share)
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
diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c
index 6efc8173915..de85ec51deb 100644
--- a/storage/maria/ma_pagecache.c
+++ b/storage/maria/ma_pagecache.c
@@ -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;
}
@@ -2980,6 +2984,7 @@ end:
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);
}
@@ -2993,18 +2998,11 @@ error:
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,