Skip to content

Commit

Permalink
Merge 10.6 into 10.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Mar 16, 2023
2 parents e97560e + a55b951 commit acf46b7
Show file tree
Hide file tree
Showing 51 changed files with 1,485 additions and 1,343 deletions.
1 change: 1 addition & 0 deletions debian/libmariadb-dev.install
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,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
Original file line number Diff line number Diff line change
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 @@ -5279,7 +5288,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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,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
Original file line number Diff line number Diff line change
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
5 changes: 5 additions & 0 deletions mysql-test/suite/parts/t/engine_defined_part_attributes.test
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,19 @@ CREATE TABLE `t12` (
(
pt1 PAGE_COMPRESSED=0
);
--sorted_result
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';

ALTER TABLE `t12` ADD PARTITION (
PARTITION pt2 PAGE_COMPRESSED=1
);
--sorted_result
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';

ALTER TABLE `t12` ADD PARTITION (
PARTITION pt3 PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=3
);
--sorted_result
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t12%';

DROP TABLE `t12`;
Expand All @@ -203,6 +206,7 @@ CREATE TABLE `t13` (
PARTITION pt3 VALUES LESS THAN MAXVALUE
);
SHOW CREATE TABLE `t13`;
--sorted_result
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%';

ALTER TABLE `t13` PARTITION BY RANGE(id) (
Expand All @@ -211,6 +215,7 @@ ALTER TABLE `t13` PARTITION BY RANGE(id) (
PARTITION pt3 VALUES LESS THAN MAXVALUE PAGE_COMPRESSED=0
);
SHOW CREATE TABLE `t13`;
--sorted_result
SELECT name, flag FROM information_schema.innodb_sys_tablespaces WHERE name like 'test/t13%';

DROP TABLE `t13`;
2 changes: 1 addition & 1 deletion plugin/cracklib_password_check/cracklib_password_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */

#include <my_global.h>
#include <my_alloca.h>
#include <mysql/plugin_password_validation.h>
#include <crack.h>
#include <string.h>
Expand Down
5 changes: 1 addition & 4 deletions plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* See COPYRIGHT.txt for details.
*/

#include <my_global.h>
#include <my_alloca.h>
#include <netinet/in.h>
#include <errno.h>
#include <poll.h>
Expand All @@ -17,9 +17,6 @@
#if __linux__
#include <sys/epoll.h>
#endif
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif

#include "hstcpsvr_worker.hpp"
#include "string_buffer.hpp"
Expand Down
1 change: 1 addition & 0 deletions plugin/handler_socket/libhsclient/allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <stdlib.h>
#include <string.h>
#include <my_alloca.h>

#if 0
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -5289,7 +5289,7 @@ class THD: public THD_count, /* this must be first */
bool use_temporary_table(TABLE *table, TABLE **out_table);
void close_temporary_table(TABLE *table);
bool log_events_and_free_tmp_shares();
void free_tmp_table_share(TMP_TABLE_SHARE *share, bool delete_table);
bool free_tmp_table_share(TMP_TABLE_SHARE *share, bool delete_table);
void free_temporary_table(TABLE *table);
bool lock_temporary_tables();
void unlock_temporary_tables();
Expand Down
13 changes: 7 additions & 6 deletions sql/temporary_tables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ bool THD::drop_temporary_table(TABLE *table, bool *is_trans, bool delete_table)
temporary_tables->remove(share);

/* Free the TABLE_SHARE and/or delete the files. */
free_tmp_table_share(share, delete_table);
result= free_tmp_table_share(share, delete_table);

end:
if (locked)
Expand Down Expand Up @@ -1464,20 +1464,21 @@ bool THD::log_events_and_free_tmp_shares()
@param share [IN] TABLE_SHARE to free
@param delete_table [IN] Whether to delete the table files?
@return void
@return false Success
true Error
*/
void THD::free_tmp_table_share(TMP_TABLE_SHARE *share, bool delete_table)
bool THD::free_tmp_table_share(TMP_TABLE_SHARE *share, bool delete_table)
{
bool error= false;
DBUG_ENTER("THD::free_tmp_table_share");

if (delete_table)
{
rm_temporary_table(share->db_type(), share->path.str);
error= rm_temporary_table(share->db_type(), share->path.str);
}
free_table_share(share);
my_free(share);

DBUG_VOID_RETURN;
DBUG_RETURN(error);
}


Expand Down
Loading

0 comments on commit acf46b7

Please sign in to comment.