mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	This bug is just one facet of stored routines not being able to detect changes in meta-data (WL#4179). This particular problem can be triggered within a single session due to the improper management of the pre-locking list if the view is expanded after the pre-locking list is calculated. Since the overall solution for the meta-data detection issue is planned for a later release, for now a workaround is used to fix this particular aspect that only involves a single session. The workaround is to flush the thread-local stored routine cache every time a view is created or modified, causing locally cached routines to be re-evaluated upon invocation.
		
			
				
	
	
		
			77 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			77 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| #
 | |
| # Bug #47412: Valgrind warnings / user can read uninitalized memory
 | |
| # using SP variables
 | |
| #
 | |
| CREATE SCHEMA testdb;
 | |
| USE testdb;
 | |
| CREATE FUNCTION f2 () RETURNS INTEGER
 | |
| BEGIN
 | |
| DECLARE CONTINUE HANDLER FOR SQLSTATE '42000' SET @aux = 1;
 | |
| RETURN f_not_exists () ;
 | |
| END|
 | |
| CREATE PROCEDURE p3 ( arg1 VARCHAR(32) )
 | |
| BEGIN
 | |
| CALL p_not_exists ( );
 | |
| END|
 | |
| # should not return valgrind warnings
 | |
| CALL p3 ( f2 () );
 | |
| ERROR 42000: PROCEDURE testdb.p_not_exists does not exist
 | |
| DROP SCHEMA testdb;
 | |
| CREATE SCHEMA testdb;
 | |
| USE testdb;
 | |
| CREATE FUNCTION f2 () RETURNS INTEGER
 | |
| BEGIN
 | |
| DECLARE CONTINUE HANDLER FOR SQLSTATE '42000' SET @aux = 1;
 | |
| RETURN f_not_exists () ;
 | |
| END|
 | |
| CREATE PROCEDURE p3 ( arg2 INTEGER )
 | |
| BEGIN
 | |
| CALL p_not_exists ( );
 | |
| END|
 | |
| # should not return valgrind warnings
 | |
| CALL p3 ( f2 () );
 | |
| ERROR 42000: PROCEDURE testdb.p_not_exists does not exist
 | |
| DROP SCHEMA testdb;
 | |
| CREATE SCHEMA testdb;
 | |
| USE testdb;
 | |
| CREATE FUNCTION f2 () RETURNS INTEGER
 | |
| BEGIN
 | |
| DECLARE CONTINUE HANDLER FOR SQLSTATE '42000' SET @aux = 1;
 | |
| RETURN f_not_exists () ;
 | |
| END|
 | |
| # should not return valgrind warnings
 | |
| SELECT f2 ();
 | |
| f2 ()
 | |
| NULL
 | |
| DROP SCHEMA testdb;
 | |
| USE test;
 | |
| #
 | |
| # Bug#50423: Crash on second call of a procedure dropping a trigger
 | |
| #
 | |
| DROP TABLE IF EXISTS t1;
 | |
| DROP TRIGGER IF EXISTS tr1;
 | |
| DROP PROCEDURE IF EXISTS p1;
 | |
| CREATE TABLE t1 (f1 INTEGER);
 | |
| CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @aux = 1;
 | |
| CREATE PROCEDURE p1 () DROP TRIGGER tr1;
 | |
| CALL p1 ();
 | |
| CALL p1 ();
 | |
| ERROR HY000: Trigger does not exist
 | |
| DROP TABLE t1;
 | |
| DROP PROCEDURE p1;
 | |
| #
 | |
| # Bug#50423: Crash on second call of a procedure dropping a trigger
 | |
| #
 | |
| DROP TABLE IF EXISTS t1;
 | |
| DROP TRIGGER IF EXISTS tr1;
 | |
| DROP PROCEDURE IF EXISTS p1;
 | |
| CREATE TABLE t1 (f1 INTEGER);
 | |
| CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @aux = 1;
 | |
| CREATE PROCEDURE p1 () DROP TRIGGER tr1;
 | |
| CALL p1 ();
 | |
| CALL p1 ();
 | |
| ERROR HY000: Trigger does not exist
 | |
| DROP TABLE t1;
 | |
| DROP PROCEDURE p1;
 | |
| End of 5.1 tests
 |