List:Internals« Previous MessageNext Message »
From:Elliot Murphy Date:September 14 2005 8:42pm
Subject:bk commit into 5.0 tree (elliot:1.1950) BUG#12870
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of emurphy. When emurphy does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1950 05/09/14 14:42:39 elliot@stripped +3 -0
  BUG#12870 (CREATE PROCEDURE followed by ROLLBACK is not replicated)
  Fixed by making CREATE/ALTER/DROP PROCEDURE cause implicit commit.

  sql/sql_parse.cc
    1.486 05/09/14 14:42:34 elliot@stripped +9 -0
    CREATE/ALTER/DROP PROCEDURE/SPFUNCTION now causes implicit commit.

  mysql-test/t/rpl_ddl.test
    1.6 05/09/14 14:42:34 elliot@stripped +52 -1
    BUG#12870 test implicit commit for create/alter/drop procedure.

  mysql-test/r/rpl_ddl.result
    1.7 05/09/14 14:42:34 elliot@stripped +182 -0
    Updated results to include testing of implicit commit for
    create/alter/drop procedure

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	elliot
# Host:	desperate.(none)
# Root:	/home/emurphy/src/work/mysql-5.0-bug-12870

--- 1.485/sql/sql_parse.cc	2005-09-13 06:51:21 -04:00
+++ 1.486/sql/sql_parse.cc	2005-09-14 14:42:34 -04:00
@@ -4017,6 +4017,9 @@
       goto error;
     }
 
+    if (end_active_trans(thd)) 
+      goto error;
+
     if (!lex->sphead->m_db.str || !lex->sphead->m_db.str[0])
     {
       lex->sphead->m_db.length= strlen(thd->db);
@@ -4271,6 +4274,9 @@
 				 sp->m_name.str,
                                  lex->sql_command == SQLCOM_ALTER_PROCEDURE, 0))
 	  goto error;
+
+        if (end_active_trans(thd)) 
+          goto error;
 	memcpy(&lex->sp_chistics, &chistics, sizeof(lex->sp_chistics));
         if (!trust_routine_creators &&  mysql_bin_log.is_open() &&
             !sp->m_chistics->detistic &&
@@ -4329,6 +4335,9 @@
 	name= thd->strdup(sp->m_name.str);
 	if (check_routine_access(thd, ALTER_PROC_ACL, db, name,
                                  lex->sql_command == SQLCOM_DROP_PROCEDURE, 0))
+          goto error;
+
+        if (end_active_trans(thd)) 
           goto error;
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
 	if (sp_automatic_privileges && !opt_noacl &&

--- 1.6/mysql-test/r/rpl_ddl.result	2005-06-17 08:03:18 -04:00
+++ 1.7/mysql-test/r/rpl_ddl.result	2005-09-14 14:42:34 -04:00
@@ -1072,6 +1072,188 @@
 mysqltest3
 
 -------- switch to master -------
+
+######## CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1"  ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 15 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+16
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+15
+
+-------- switch to master -------
+CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+16
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+16
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+16
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+16
+
+TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW PROCEDURE STATUS LIKE 'p1';
+Db	mysqltest1
+Name	p1
+Type	PROCEDURE
+Definer	root@localhost
+Modified	#
+Created	#
+Security_type	DEFINER
+Comment	
+	-------- switch to slave -------
+SHOW PROCEDURE STATUS LIKE 'p1';
+Db	mysqltest1
+Name	p1
+Type	PROCEDURE
+Definer	@
+Modified	#
+Created	#
+Security_type	DEFINER
+Comment	
+
+######## ALTER PROCEDURE p1 COMMENT "I have been altered"  ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 16 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+17
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+16
+
+-------- switch to master -------
+ALTER PROCEDURE p1 COMMENT "I have been altered";
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+17
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+17
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+17
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+17
+
+TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW PROCEDURE STATUS LIKE 'p1';
+Db	mysqltest1
+Name	p1
+Type	PROCEDURE
+Definer	root@localhost
+Modified	#
+Created	#
+Security_type	DEFINER
+Comment	I have been altered
+	-------- switch to slave -------
+SHOW PROCEDURE STATUS LIKE 'p1';
+Db	mysqltest1
+Name	p1
+Type	PROCEDURE
+Definer	@
+Modified	#
+Created	#
+Security_type	DEFINER
+Comment	I have been altered
+
+######## DROP PROCEDURE p1  ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 17 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+18
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+17
+
+-------- switch to master -------
+DROP PROCEDURE p1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+18
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+18
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+18
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+18
+
+TEST-INFO: SLAVE:  The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW PROCEDURE STATUS LIKE 'p1';
+	-------- switch to slave -------
+SHOW PROCEDURE STATUS LIKE 'p1';
 DROP DATABASE IF EXISTS mysqltest1;
 DROP DATABASE IF EXISTS mysqltest2;
 DROP DATABASE IF EXISTS mysqltest3;

--- 1.5/mysql-test/t/rpl_ddl.test	2005-07-28 09:12:36 -04:00
+++ 1.6/mysql-test/t/rpl_ddl.test	2005-09-14 14:42:34 -04:00
@@ -340,6 +340,57 @@
 SELECT '-------- switch to master -------' as "";
 --enable_query_log
 
+# End of 4.1 tests
+
+###############################################################
+# Cases with stored procedures
+###############################################################
+let $my_stmt= CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--vertical_results
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS LIKE 'p1';
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS LIKE 'p1';
+connection master;
+--horizontal_results
+
+let $my_stmt= ALTER PROCEDURE p1 COMMENT "I have been altered";
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--vertical_results
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS LIKE 'p1';
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS LIKE 'p1';
+connection master;
+--horizontal_results
+
+let $my_stmt= DROP PROCEDURE p1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--vertical_results
+SHOW PROCEDURE STATUS LIKE 'p1';
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SHOW PROCEDURE STATUS LIKE 'p1';
+connection master;
+--horizontal_results
+
 ###############################################################
 # Cleanup
 ###############################################################
@@ -349,4 +400,4 @@
 DROP DATABASE IF EXISTS mysqltest3;
 --enable_warnings
 
-# End of 4.1 tests
+
Thread
bk commit into 5.0 tree (elliot:1.1950) BUG#12870Elliot Murphy14 Sep