mirror of
https://github.com/MariaDB/server.git
synced 2026-02-10 20:58:41 +01:00
This patch removes MASTER_SSL_VERIFY_SERVER_CERT from the list reserved_keyword_udt_not_param_type and adds it to keyword_func_sp_var_and_label in the parser. All other MASTER_SSL_* keywords are in this list. This allows MASTER_SSL_VERIFY_SERVER_CERT to be used unquoted when directly accessed via INFORMATION_SCHEMA.slave_status, as well as opens it up to be used as names in other places, e.g. stored procedures. Reviewed-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
79 lines
1.6 KiB
Text
79 lines
1.6 KiB
Text
#
|
|
# Test for MDEV-38194: Master_SSL_Verify_Server_Cert should not require identifier quoting
|
|
#
|
|
|
|
--source include/not_embedded.inc
|
|
|
|
# Select the column unquoted
|
|
SELECT Master_SSL_Verify_Server_Cert FROM information_schema.slave_status LIMIT 1;
|
|
|
|
# Select the column quoted
|
|
SELECT `Master_SSL_Verify_Server_Cert` FROM information_schema.slave_status LIMIT 1;
|
|
|
|
|
|
# Verify that stored procedures, variables, labels, and functions using the name
|
|
# Master_SSL_Verify_Server_Cert can be successfully created
|
|
|
|
CREATE DATABASE db_is_slave_status;
|
|
|
|
USE db_is_slave_status;
|
|
|
|
CREATE TABLE t1 (
|
|
Master_SSL_Verify_Server_Cert INT
|
|
);
|
|
INSERT INTO t1 VALUES (123);
|
|
SELECT Master_SSL_Verify_Server_Cert FROM t1;
|
|
DROP TABLE t1;
|
|
|
|
|
|
DELIMITER //;
|
|
CREATE PROCEDURE master_ssl_verify_server_cert()
|
|
BEGIN
|
|
SELECT 1;
|
|
END//
|
|
DELIMITER ;//
|
|
|
|
DROP PROCEDURE IF EXISTS master_ssl_verify_server_cert;
|
|
|
|
--disable_warnings
|
|
CREATE FUNCTION master_ssl_verify_server_cert()
|
|
RETURNS INT
|
|
RETURN 1;
|
|
--enable_warnings
|
|
|
|
DROP FUNCTION IF EXISTS master_ssl_verify_server_cert;
|
|
|
|
|
|
DELIMITER //;
|
|
CREATE PROCEDURE sp()
|
|
master_ssl_verify_server_cert:BEGIN
|
|
SELECT 1;
|
|
END//
|
|
DELIMITER ;//
|
|
|
|
DROP PROCEDURE IF EXISTS sp;
|
|
|
|
|
|
DELIMITER //;
|
|
CREATE PROCEDURE sp()
|
|
BEGIN
|
|
DECLARE master_ssl_verify_server_cert CHAR;
|
|
END//
|
|
DELIMITER ;//
|
|
|
|
DROP PROCEDURE IF EXISTS sp;
|
|
|
|
|
|
DELIMITER //;
|
|
CREATE PROCEDURE sp()
|
|
BEGIN
|
|
DECLARE master_ssl_verify_server_cert CONDITION FOR SQLSTATE '02000';
|
|
DECLARE EXIT HANDLER FOR master_ssl_verify_server_cert SET @var2 = 1;
|
|
END//
|
|
DELIMITER ;//
|
|
|
|
DROP PROCEDURE IF EXISTS sp;
|
|
|
|
DROP DATABASE IF EXISTS db_is_slave_status;
|
|
|
|
--echo # End of rpl_is_slave_status.test
|