mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.7' into 10.8
This commit is contained in:
@@ -167,6 +167,7 @@ SET(files
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/after_setup.sql)
|
||||
ENDIF()
|
||||
|
||||
SET_PROPERTY(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${files})
|
||||
SET(CMAKE_CONFIGURABLE_FILE_CONTENT)
|
||||
|
||||
FOREACH(f ${files})
|
||||
|
@@ -80,14 +80,11 @@ BEGIN
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_setup_instruments;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp_threads;
|
||||
|
||||
CREATE TEMPORARY TABLE tmp_setup_actors LIKE performance_schema.setup_actors;
|
||||
CREATE TEMPORARY TABLE tmp_setup_consumers LIKE performance_schema.setup_consumers;
|
||||
CREATE TEMPORARY TABLE tmp_setup_instruments LIKE performance_schema.setup_instruments;
|
||||
CREATE TEMPORARY TABLE tmp_setup_actors AS SELECT * FROM performance_schema.setup_actors;
|
||||
CREATE TEMPORARY TABLE tmp_setup_consumers AS SELECT * FROM performance_schema.setup_consumers;
|
||||
CREATE TEMPORARY TABLE tmp_setup_instruments AS SELECT * FROM performance_schema.setup_instruments;
|
||||
CREATE TEMPORARY TABLE tmp_threads (THREAD_ID bigint unsigned NOT NULL PRIMARY KEY, INSTRUMENTED enum('YES','NO') NOT NULL);
|
||||
|
||||
INSERT INTO tmp_setup_actors SELECT * FROM performance_schema.setup_actors;
|
||||
INSERT INTO tmp_setup_consumers SELECT * FROM performance_schema.setup_consumers;
|
||||
INSERT INTO tmp_setup_instruments SELECT * FROM performance_schema.setup_instruments;
|
||||
INSERT INTO tmp_threads SELECT THREAD_ID, INSTRUMENTED FROM performance_schema.threads;
|
||||
ELSE
|
||||
SIGNAL SQLSTATE VALUE '90000'
|
||||
|
@@ -133,6 +133,8 @@ CREATE DEFINER='mariadb.sys'@'localhost' PROCEDURE table_exists (
|
||||
CONTAINS SQL
|
||||
BEGIN
|
||||
DECLARE v_error BOOLEAN DEFAULT FALSE;
|
||||
DECLARE db_quoted VARCHAR(64);
|
||||
DECLARE table_quoted VARCHAR(64);
|
||||
DECLARE v_table_type VARCHAR(16) DEFAULT '';
|
||||
DECLARE v_system_db BOOLEAN
|
||||
DEFAULT LOWER(in_db) IN ('information_schema', 'performance_schema');
|
||||
@@ -140,19 +142,28 @@ BEGIN
|
||||
DECLARE CONTINUE HANDLER FOR 1146 SET v_error = TRUE;
|
||||
|
||||
SET out_exists = '';
|
||||
SET db_quoted = sys.quote_identifier(in_db);
|
||||
SET table_quoted = sys.quote_identifier(in_table);
|
||||
|
||||
-- Verify whether the table name exists as a normal table
|
||||
IF (EXISTS(SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = in_db AND TABLE_NAME = in_table)) THEN
|
||||
-- Unfortunately the only way to determine whether there is also a temporary table is to try to create
|
||||
-- a temporary table with the same name. If it succeeds the table didn't exist as a temporary table.
|
||||
IF v_system_db = FALSE THEN
|
||||
SET @sys.tmp.table_exists.SQL = CONCAT('CREATE TEMPORARY TABLE `', in_db, '`.`', in_table, '` (id INT PRIMARY KEY)');
|
||||
SET @sys.tmp.table_exists.SQL = CONCAT('CREATE TEMPORARY TABLE ',
|
||||
db_quoted,
|
||||
'.',
|
||||
table_quoted,
|
||||
'(id INT PRIMARY KEY)');
|
||||
PREPARE stmt_create_table FROM @sys.tmp.table_exists.SQL;
|
||||
EXECUTE stmt_create_table;
|
||||
DEALLOCATE PREPARE stmt_create_table;
|
||||
|
||||
-- The temporary table was created, i.e. it didn't exist. Remove it again so we don't leave garbage around.
|
||||
SET @sys.tmp.table_exists.SQL = CONCAT('DROP TEMPORARY TABLE `', in_db, '`.`', in_table, '`');
|
||||
SET @sys.tmp.table_exists.SQL = CONCAT('DROP TEMPORARY TABLE ',
|
||||
db_quoted,
|
||||
'.',
|
||||
table_quoted);
|
||||
PREPARE stmt_drop_table FROM @sys.tmp.table_exists.SQL;
|
||||
EXECUTE stmt_drop_table;
|
||||
DEALLOCATE PREPARE stmt_drop_table;
|
||||
@@ -174,7 +185,10 @@ BEGIN
|
||||
-- If it does it's possible to SELECT from the table without causing an error.
|
||||
-- If it does not exist even a PREPARE using the table will fail.
|
||||
IF v_system_db = FALSE THEN
|
||||
SET @sys.tmp.table_exists.SQL = CONCAT('SELECT COUNT(*) FROM `', in_db, '`.`', in_table, '`');
|
||||
SET @sys.tmp.table_exists.SQL = CONCAT('SELECT COUNT(*) FROM ',
|
||||
db_quoted,
|
||||
'.',
|
||||
table_quoted);
|
||||
PREPARE stmt_select FROM @sys.tmp.table_exists.SQL;
|
||||
IF (NOT v_error) THEN
|
||||
DEALLOCATE PREPARE stmt_select;
|
||||
|
@@ -443,13 +443,6 @@ EOF
|
||||
elif tar --version | grep -q -E '^bsdtar\>'; then
|
||||
tar_type=2
|
||||
fi
|
||||
if [ $tar_type -ne 2 ]; then
|
||||
if [ -n "$BASH_VERSION" ]; then
|
||||
printf '%s' "$binlog_files" >&2
|
||||
else
|
||||
echo "$binlog_files" >&2
|
||||
fi
|
||||
fi
|
||||
if [ $tar_type -ne 0 ]; then
|
||||
# Preparing list of the binlog file names:
|
||||
echo "$binlog_files" | {
|
||||
|
Reference in New Issue
Block a user