1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-36566 SELECT create_temporary_table_binlog_formats should show exactly what it is SET to

added a warning
This commit is contained in:
Sergei Golubchik
2025-04-29 19:06:32 +02:00
parent ee9359de89
commit 3e9e1a25b7
12 changed files with 37 additions and 1 deletions

View File

@@ -3,6 +3,8 @@ set sql_mode=no_engine_substitution;
set default_storage_engine = InnoDB;
set autocommit=1;
set @@create_tmp_table_binlog_formats="mixed";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
drop table if exists t1;
drop table if exists t2;
drop table if exists t3;

View File

@@ -201,6 +201,8 @@ DROP TABLE t3;
DROP DATABASE db1;
set binlog_format=mixed;
SET @@create_tmp_table_binlog_formats="mixed";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
select @@binlog_format, @@create_tmp_table_binlog_formats;
@@binlog_format @@create_tmp_table_binlog_formats
MIXED MIXED,STATEMENT

View File

@@ -1,5 +1,9 @@
set @@session.create_tmp_table_binlog_formats="MIXED";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
set @@global.create_tmp_table_binlog_formats="MIXED";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
DROP DATABASE IF EXISTS `drop-temp+table-test`;
select @@session.binlog_format;
@@session.binlog_format

View File

@@ -1,5 +1,9 @@
set @@global.create_tmp_table_binlog_formats="mixed";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
set @@session.create_tmp_table_binlog_formats="mixed";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
include/rpl_init.inc [topology=1->2]
select @@binlog_format, @@create_tmp_table_binlog_formats;
@@binlog_format @@create_tmp_table_binlog_formats

View File

@@ -45,6 +45,8 @@ Variable_name Value
Slave_open_temp_tables 0
connect con1,localhost,root,,;
set @@CREATE_TMP_TABLE_BINLOG_FORMATS="mixed";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
CREATE TEMPORARY TABLE ttmp1 ( i INT );
SET SESSION binlog_format=ROW;
disconnect con1;

View File

@@ -77,6 +77,8 @@ SET SESSION gtid_domain_id= 202;
DROP TEMPORARY TABLE t2;
SET SESSION binlog_format= mixed;
SET SESSION create_tmp_table_binlog_formats="mixed";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
SET SESSION gtid_domain_id= 0;
CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1);

View File

@@ -1,7 +1,11 @@
include/master-slave.inc
[connection master]
set @@global.create_tmp_table_binlog_formats="MIXED";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
set @@session.create_tmp_table_binlog_formats="MIXED";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
#########################################################################
# CONFIGURATION
#########################################################################

View File

@@ -1,7 +1,11 @@
include/master-slave.inc
[connection master]
set @@global.create_tmp_table_binlog_formats="mixed";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
set @@session.create_tmp_table_binlog_formats="mixed";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
#########################################################################
# CONFIGURATION
#########################################################################

View File

@@ -1,5 +1,9 @@
include/master-slave.inc
[connection master]
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
#########################################################################
# CONFIGURATION
#########################################################################

View File

@@ -4,9 +4,11 @@
if (`SELECT @@binlog_format = "MIXED"`) {
--disable_query_log
--disable_warnings
# Ensure that switching between mixed and statment works in all case */
set @@global.create_tmp_table_binlog_formats= "MIXED";
set @@session.create_tmp_table_binlog_formats= "MIXED";
--enable_warnings
--enable_query_log
}

View File

@@ -57,6 +57,8 @@ COUNT(VARIABLE_VALUE)
# Check assignment of correct values
SET @@session.create_tmp_table_binlog_formats= @start_value;
SET @@SESSION.create_tmp_table_binlog_formats="MIXED";
Warnings:
Warning 1292 Truncated incorrect create_tmp_table_binlog_formats value: 'MIXED'
SELECT @@SESSION.create_tmp_table_binlog_formats;
@@SESSION.create_tmp_table_binlog_formats
MIXED,STATEMENT

View File

@@ -741,7 +741,11 @@ static bool binlog_create_tmp_format_check(sys_var *self, THD *thd,
Logging of temporary tables is always done in STATEMENT format.
Because of this MIXED implies STATEMENT.
*/
var->save_result.ulonglong_value|= (1 << BINLOG_FORMAT_STMT);
if (!(var->save_result.ulonglong_value & (1 << BINLOG_FORMAT_STMT)))
{
throw_bounds_warning(thd, self->name.str, "MIXED");
var->save_result.ulonglong_value|= (1 << BINLOG_FORMAT_STMT);
}
return false;
}