mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Cherry-pick the commits the mysql and some changes. WL#4618 RBR: extended table metadata in the binary log This patch extends Table Map Event. It appends some new fields for more metadata. The new metadata includes: - Signedness of Numberic Columns - Character Set of Character Columns and Binary Columns - Column Name - String Value of SET Columns - String Value of ENUM Columns - Primary Key - Character Set of SET Columns and ENUM Columns - Geometry Type Some of them are optional, the patch introduces a GLOBAL system variable to control it. It is binlog_row_metadata. - Scope: GLOBAL - Dynamic: Yes - Type: ENUM - Values: {NO_LOG, MINIMAL, FULL} - Default: NO_LOG Only Signedness, character set and geometry type are logged if it is MINIMAL. Otherwise all of them are logged. Also add a binlog_type_info() to field, So that we can have extract relevant binlog info from field.
122 lines
5.0 KiB
Plaintext
122 lines
5.0 KiB
Plaintext
################## mysql-test\t\binlog_row_metadata_basic.test ################
|
|
# #
|
|
# Variable Name: binlog_row_metadata #
|
|
# Scope: Global #
|
|
# Data Type: enumeration #
|
|
# #
|
|
# Creation Date: 2017-01-23 #
|
|
# Author : Libing Song #
|
|
# #
|
|
# #
|
|
# Description:Test Cases of Dynamic System Variable binlog_row_metadata #
|
|
# that checks the behavior of this variable in the following ways #
|
|
# * Value Check #
|
|
# * Scope Check #
|
|
# #
|
|
# Reference: #
|
|
# http://dev.mysql.com/doc/refman/8.X/en/server-system-variables.html #
|
|
# #
|
|
###############################################################################
|
|
|
|
|
|
--echo NO_LOG Expected
|
|
SELECT @@GLOBAL.binlog_row_metadata;
|
|
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
|
SELECT @@SESSION.binlog_row_metadata;
|
|
|
|
--echo '#---------------------BS_STVARS_002_01----------------------#'
|
|
####################################################################
|
|
# Displaying default value #
|
|
####################################################################
|
|
SET @start_value= @@global.binlog_row_metadata;
|
|
|
|
SELECT COUNT(@@GLOBAL.binlog_row_metadata);
|
|
--echo 1 Expected
|
|
|
|
--echo '#---------------------BS_STVARS_002_02----------------------#'
|
|
####################################################################
|
|
# Check if Value can set #
|
|
####################################################################
|
|
SET @@GLOBAL.binlog_row_metadata=0;
|
|
SELECT @@GLOBAL.binlog_row_metadata;
|
|
--echo NO_LOG Expected
|
|
|
|
SET @@GLOBAL.binlog_row_metadata=1;
|
|
SELECT @@GLOBAL.binlog_row_metadata;
|
|
--echo MINIMAL Expected
|
|
|
|
SET @@GLOBAL.binlog_row_metadata=2;
|
|
SELECT @@GLOBAL.binlog_row_metadata;
|
|
--echo FULL Expected
|
|
|
|
SET @@GLOBAL.binlog_row_metadata=NO_LOG;
|
|
SELECT @@GLOBAL.binlog_row_metadata;
|
|
--echo NO_LOG Expected
|
|
|
|
SET @@GLOBAL.binlog_row_metadata=MINIMAL;
|
|
SELECT @@GLOBAL.binlog_row_metadata;
|
|
--echo MINIMAL Expected
|
|
|
|
SET @@GLOBAL.binlog_row_metadata=FULL;
|
|
SELECT @@GLOBAL.binlog_row_metadata;
|
|
--echo FULL Expected
|
|
|
|
SET @@GLOBAL.binlog_row_metadata='NO_LOG';
|
|
SELECT @@GLOBAL.binlog_row_metadata;
|
|
--echo NO_LOG Expected
|
|
|
|
SET @@GLOBAL.binlog_row_metadata='MINIMAL';
|
|
SELECT @@GLOBAL.binlog_row_metadata;
|
|
--echo MINIMAL Expected
|
|
|
|
SET @@GLOBAL.binlog_row_metadata='FULL';
|
|
SELECT @@GLOBAL.binlog_row_metadata;
|
|
--echo FULL Expected
|
|
|
|
--echo '#---------------------BS_STVARS_002_03----------------------#'
|
|
#################################################################
|
|
# Check if the value in GLOBAL Table matches value in variable #
|
|
#################################################################
|
|
|
|
SET @@GLOBAL.binlog_row_metadata='MINIMAl';
|
|
SELECT *
|
|
FROM information_schema.global_variables
|
|
WHERE VARIABLE_NAME='binlog_row_metadata';
|
|
|
|
--echo '#---------------------BS_STVARS_002_04----------------------#'
|
|
#################################################################
|
|
# Check if the value in SESSION Table matches value in variable #
|
|
#################################################################
|
|
|
|
SELECT *
|
|
FROM information_schema.session_variables
|
|
WHERE VARIABLE_NAME LIKE 'binlog_row_metadata';
|
|
|
|
--echo '#---------------------BS_STVARS_002_05----------------------#'
|
|
################################################################################
|
|
# Check if binlog_row_metadata can be accessed with and without @@ sign #
|
|
################################################################################
|
|
|
|
SELECT COUNT(@@binlog_row_metadata);
|
|
--echo 1 Expected
|
|
SELECT COUNT(@@GLOBAL.binlog_row_metadata);
|
|
--echo 1 Expected
|
|
|
|
--echo '#---------------------BS_STVARS_002_06----------------------#'
|
|
################################################################################
|
|
# Check if binlog_row_metadata can handle invalid values correctly #
|
|
################################################################################
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
SET GLOBAL binlog_row_metadata = full1;
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
SET GLOBAL binlog_row_metadata = "full1";
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
SET GLOBAL binlog_row_metadata = 3;
|
|
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
SET GLOBAL binlog_row_metadata = -1;
|
|
|
|
SET @@global.binlog_row_metadata= @start_value;
|