用于EagleEye3.0 规则集漏报和误报测试的示例项目,项目收集于github和gitee
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

72 lines
2.4 KiB

#
# WL#7897 -- Use DD API for Stored Routines.
#
# Test case to verify stored routine load failure.
CREATE FUNCTION f1() RETURNS INT return 1;
CREATE PROCEDURE p1() SELECT 1 AS my_column;
SET DEBUG='+d,fail_stored_routine_load';
SELECT f1();
ERROR HY000: Failed to load routine 'test.f1'.
CALL p1();
ERROR HY000: Failed to load routine 'test.p1'.
SET DEBUG='-d,fail_stored_routine_load';
SELECT f1();
f1()
1
CALL p1();
my_column
1
DROP FUNCTION f1;
DROP PROCEDURE p1;
# Test case to verify stored routine body length error.
SET DEBUG='+d,simulate_routine_length_error';
CREATE PROCEDURE p1() SELECT "simulate_routine_length_error";
ERROR 42000: Routine body for 'p1' is too long
SET DEBUG='-d,simulate_routine_length_error';
# Test case to verify the schema state after failure to drop routine.
CREATE SCHEMA new_db;
CREATE PROCEDURE new_db.proc() SELECT 1 AS my_column;
SET DEBUG='+d,fail_drop_db_routines';
DROP SCHEMA IF EXISTS new_db;
ERROR HY000: Failed to DROP ROUTINE
SET DEBUG='-d,fail_drop_db_routines';
DROP SCHEMA IF EXISTS new_db;
CREATE SCHEMA new_db;
DROP SCHEMA new_db;
#
# Bug#26040870 - ASSERT ON KILL'ING A STORED ROUTINE INVOCATION.
#
CREATE TABLE t1 (a INT);
CREATE FUNCTION f1() RETURNS INT
BEGIN
INSERT INTO t1 VALUES (1);
RETURN 1;
END|
SET DEBUG_SYNC= "sp_lex_instr_before_exec_core SIGNAL sp_ready WAIT_FOR sp_finish";
SELECT f1();
SET DEBUG_SYNC="now WAIT_FOR sp_ready";
KILL QUERY sp_con_id;
SET DEBUG_SYNC="now SIGNAL sp_finish";
# Diagnostics area is not set if routine statement execution is
# interrupted by the KILL operation. Accessing diagnostics area in such
# case results in the issue reported.
# Patch for the bug25586773, checks if diagnostics area is set before
# accessing it.
ERROR 70100: Query execution was interrupted
SET DEBUG_SYNC='RESET';
DROP TABLE t1;
DROP FUNCTION f1;
#
# Bug#28864244 : DATA DICTIONARY ASSERT IN MEB.UNICODE.
#
SET NAMES utf8;
Warnings:
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
SET DEBUG='+d,simulate_lctn_two_case_for_schema_case_compare';
CREATE DATABASE `tèst-db`;
#Without fix, assert condition to check schema name case fails for following
#statement.
CREATE PROCEDURE `tèst-db`.test() SELECT 1;
DROP DATABASE `tèst-db`;
SET DEBUG='-d,simulate_lctn_two_case_for_schema_case_compare';
SET NAMES default;