~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/extra/rpl_tests/rpl_row_sp007.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#############################################################################
 
2
# Original Author: JBM                                                      #
 
3
# Original Date: Aug/15/2005                                                #
 
4
# Updated: 08/29/2005 Remove sleeps                                         #
 
5
#############################################################################
 
6
# TEST: SP that creates table, starts tranaction inserts. Save point, insert#
 
7
#       rollback to save point and then commits.                            #
 
8
#############################################################################
 
9
# Includes
 
10
-- source include/have_binlog_format_row.inc
 
11
-- source include/master-slave.inc
 
12
 
 
13
# Begin clean up test section
 
14
connection master;
 
15
--disable_warnings
 
16
DROP PROCEDURE IF EXISTS test.p1;
 
17
DROP TABLE IF EXISTS test.t1;
 
18
--enable_warnings
 
19
# End of cleanup
 
20
 
 
21
# Begin test section 1
 
22
delimiter |;
 
23
eval CREATE PROCEDURE test.p1(IN i INT)
 
24
BEGIN
 
25
  DECLARE CONTINUE HANDLER FOR sqlexception BEGIN END;
 
26
  DROP TABLE IF EXISTS test.t1;
 
27
  CREATE TABLE test.t1 (num INT,PRIMARY KEY(num))ENGINE=$engine_type;
 
28
  START TRANSACTION;
 
29
    INSERT INTO test.t1 VALUES(i);
 
30
    savepoint t1_save;
 
31
    INSERT INTO test.t1 VALUES (14);
 
32
    ROLLBACK to savepoint t1_save;
 
33
    COMMIT;
 
34
END|
 
35
delimiter ;|
 
36
 
 
37
let $message=< ---- Master selects-- >;
 
38
--source include/show_msg.inc
 
39
CALL test.p1(12);
 
40
SELECT * FROM test.t1;
 
41
 
 
42
 
 
43
let $message=< ---- Slave selects-- >;
 
44
--source include/show_msg.inc
 
45
save_master_pos;
 
46
connection slave;
 
47
sync_with_master;
 
48
SELECT * FROM test.t1;
 
49
 
 
50
let $message=< ---- Master selects-- >;
 
51
--source include/show_msg.inc
 
52
connection master;
 
53
CALL test.p1(13);
 
54
SELECT * FROM test.t1;
 
55
 
 
56
let $message=< ---- Slave selects-- >;
 
57
--source include/show_msg.inc
 
58
save_master_pos;
 
59
connection slave;
 
60
sync_with_master;
 
61
SELECT * FROM test.t1;
 
62
 
 
63
connection master;
 
64
#show binlog events;
 
65
 
 
66
 
 
67
DROP PROCEDURE IF EXISTS test.p1;
 
68
DROP TABLE IF EXISTS test.t1;
 
69
 
 
70
# End of 5.0 test case