1include/master-slave.inc
2[connection master]
3call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
4connection master;
5drop database if exists test1;
6create database test1;
7use test1;
8CREATE TABLE `t1` (
9`id` int(10) unsigned NOT NULL auto_increment,
10`fname` varchar(100) default NULL,
11PRIMARY KEY  (`id`)
12) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
13INSERT INTO `t1` VALUES (1, 'blablabla');
14CREATE TABLE `t2` (
15`id` int(10) NOT NULL auto_increment,
16`comment` varchar(255) NOT NULL default '',
17PRIMARY KEY  (`id`)
18) ENGINE=MyISAM  AUTO_INCREMENT=3 ;
19INSERT INTO `t2` VALUES (1, 'testtest 1');
20INSERT INTO `t2` VALUES (2, 'test 2');
21CREATE PROCEDURE simpleproc3 ()
22NOT DETERMINISTIC
23BEGIN
24INSERT INTO t1 (fname) (SELECT t2.comment FROM t2 WHERE t2.id = '1');
25INSERT INTO t1 (fname) VALUES('test');
26END
27$
28CALL simpleproc3();
29select * from t2;
30id	comment
311	testtest 1
322	test 2
33TRUNCATE TABLE `t1`;
34CALL simpleproc3();
35select * from t1;
36id	fname
371	testtest 1
382	test
39connection slave;
40use test1;
41select * from t1;
42id	fname
431	testtest 1
442	test
45connection master;
46drop database test1;
47include/rpl_end.inc
48