mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	For this particular bug report it was rpl_loadfile.test that did not make proper cleanup, but the patch includes fixes for other tests aswell. mysql-test/r/rpl_loaddata2.result: Cleanup mysql-test/r/rpl_redirect.result: Cleanup mysql-test/r/rpl_slave_status.result: Cleanup mysql-test/t/rpl_LD_INFILE.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_drop_temp.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_ignore_table.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_loaddata2.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_loaddata_m.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_loaddata_s.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_loadfile.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_multi_update4.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_ndb_basic.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_redirect.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_row_func001.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_row_func002.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_row_sp001.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_row_sp005.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_row_sp008.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_row_sp009.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_row_sp010.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_row_sp011.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_row_sp012.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_row_trig001.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_row_trig002.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_skip_error.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_slave_status.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_sp.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave mysql-test/t/rpl_sp004.test: Most rpl tests need to execute sync_slave_with_master to ensure that cleanup is done on slave
		
			
				
	
	
		
			111 lines
		
	
	
		
			3.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			111 lines
		
	
	
		
			3.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
#############################################################################
 | 
						|
# Original Author: JBM                                                      #
 | 
						|
# Original Date: Aug/15/2005                                                #
 | 
						|
# Updated: Aug/29/2005: Removed sleeps                                      #     
 | 
						|
#############################################################################
 | 
						|
# Test: Tests SPs with cursors, flow logic, and alter sp. In addition the   #
 | 
						|
#       tests SPs with insert and update operations.                        #
 | 
						|
#############################################################################
 | 
						|
# 2006-02-08 By JBM added ORDER BY for use with NDB engine
 | 
						|
#############################################################################
 | 
						|
 | 
						|
# Includes
 | 
						|
-- source include/have_binlog_format_row.inc
 | 
						|
-- source include/master-slave.inc
 | 
						|
 | 
						|
 | 
						|
# Begin clean up test section
 | 
						|
connection master;
 | 
						|
--disable_warnings
 | 
						|
DROP PROCEDURE IF EXISTS test.p1;
 | 
						|
DROP PROCEDURE IF EXISTS test.p2;
 | 
						|
DROP TABLE IF EXISTS test.t2;
 | 
						|
DROP TABLE IF EXISTS test.t1;
 | 
						|
DROP TABLE IF EXISTS test.t3;
 | 
						|
--enable_warnings
 | 
						|
# End of cleanup
 | 
						|
 | 
						|
# Begin test section 1
 | 
						|
CREATE TABLE IF NOT EXISTS test.t1(id INT, data CHAR(16),PRIMARY KEY(id));
 | 
						|
CREATE TABLE IF NOT EXISTS test.t2(id2 INT,PRIMARY KEY(id2));
 | 
						|
CREATE TABLE IF NOT EXISTS test.t3(id3 INT,PRIMARY KEY(id3), c CHAR(16));
 | 
						|
 | 
						|
delimiter |;
 | 
						|
CREATE PROCEDURE test.p1()
 | 
						|
BEGIN
 | 
						|
DECLARE done INT DEFAULT 0;
 | 
						|
  DECLARE spa CHAR(16);
 | 
						|
  DECLARE spb,spc INT;
 | 
						|
  DECLARE cur1 CURSOR FOR SELECT id,data FROM test.t1 ORDER BY id;
 | 
						|
  DECLARE cur2 CURSOR FOR SELECT id2 FROM test.t2 ORDER BY id2;
 | 
						|
  DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
 | 
						|
 | 
						|
  OPEN cur1;
 | 
						|
  OPEN cur2;
 | 
						|
 | 
						|
  REPEAT
 | 
						|
    FETCH cur1 INTO spb, spa;
 | 
						|
    FETCH cur2 INTO spc;
 | 
						|
    IF NOT done THEN
 | 
						|
       IF spb < spc THEN
 | 
						|
          INSERT INTO test.t3 VALUES (spb,spa);
 | 
						|
       ELSE
 | 
						|
          INSERT INTO test.t3 VALUES (spc,spa);
 | 
						|
       END IF;
 | 
						|
    END IF;
 | 
						|
  UNTIL done END REPEAT;
 | 
						|
 | 
						|
  CLOSE cur1;
 | 
						|
  CLOSE cur2;
 | 
						|
END|
 | 
						|
CREATE PROCEDURE test.p2()
 | 
						|
BEGIN
 | 
						|
  INSERT INTO test.t1 VALUES (4,'MySQL'),(20,'ROCKS'),(11,'Texas'),(10,'kyle');
 | 
						|
  INSERT INTO test.t2 VALUES (4),(2),(1),(3);
 | 
						|
  UPDATE test.t1 SET id=id+4 WHERE id=4;
 | 
						|
END|
 | 
						|
delimiter ;|
 | 
						|
 | 
						|
let $message=< ---- Master selects-- >;
 | 
						|
--source include/show_msg.inc
 | 
						|
CALL test.p2();
 | 
						|
SELECT * FROM test.t1 ORDER BY id;
 | 
						|
SELECT * FROM test.t2 ORDER BY id2;
 | 
						|
 | 
						|
let $message=< ---- Slave selects-- >;
 | 
						|
--source include/show_msg.inc
 | 
						|
save_master_pos;
 | 
						|
connection slave;
 | 
						|
sync_with_master;
 | 
						|
SELECT * FROM test.t1 ORDER BY id;
 | 
						|
SELECT * FROM test.t2 ORDER BY id2;
 | 
						|
 | 
						|
let $message=< ---- Master selects-- >;
 | 
						|
--source include/show_msg.inc
 | 
						|
connection master;
 | 
						|
CALL test.p1();
 | 
						|
sleep 6;
 | 
						|
SELECT * FROM test.t3 ORDER BY id3;
 | 
						|
 | 
						|
let $message=< ---- Slave selects-- >;
 | 
						|
--source include/show_msg.inc
 | 
						|
connection slave;
 | 
						|
SELECT * FROM test.t3 ORDER BY id3;
 | 
						|
 | 
						|
connection master;
 | 
						|
 | 
						|
ALTER PROCEDURE test.p1 MODIFIES SQL DATA;
 | 
						|
#show binlog events;
 | 
						|
 | 
						|
# Cleanup
 | 
						|
 | 
						|
connection master;
 | 
						|
DROP PROCEDURE IF EXISTS test.p1;
 | 
						|
DROP PROCEDURE IF EXISTS test.p2;
 | 
						|
DROP TABLE IF EXISTS test.t1;
 | 
						|
DROP TABLE IF EXISTS test.t2;
 | 
						|
DROP TABLE IF EXISTS test.t3;
 | 
						|
sync_slave_with_master;
 | 
						|
 | 
						|
# End of 5.0 test case
 |