~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_row_USER.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#############################################################################
 
2
# Original Author: JBM                                                      #
 
3
# Original Date: Aug/18/2005                                                #
 
4
#############################################################################
 
5
# TEST: To test the USER() and CURRENT_USER() in rbr                        #
 
6
#############################################################################
 
7
# Change Author: JBM
 
8
# Change Date: 2006-01-16
 
9
# Change: Added Order by for NDB
 
10
##########
 
11
 
 
12
# Includes
 
13
-- source include/have_binlog_format_row.inc
 
14
-- source include/master-slave.inc
 
15
 
 
16
# Begin clean up test section
 
17
connection master;
 
18
--disable_warnings
 
19
DROP DATABASE IF EXISTS mysqltest1;
 
20
CREATE DATABASE mysqltest1;
 
21
--enable_warnings
 
22
 
 
23
# Section 1 test 
 
24
CREATE USER tester IDENTIFIED BY 'test';
 
25
GRANT ALL ON mysqltest1.* TO 'tester'@'%' IDENTIFIED BY 'test';
 
26
GRANT ALL ON mysqltest1.* TO ''@'localhost%';
 
27
FLUSH PRIVILEGES;
 
28
connect (m_1,localhost,tester,,mysqltest1);
 
29
 
 
30
connection m_1;
 
31
CREATE TABLE mysqltest1.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a));
 
32
INSERT INTO mysqltest1.t1 VALUES(1,USER());
 
33
INSERT INTO mysqltest1.t1 VALUES(2,CURRENT_USER());
 
34
delimiter |;
 
35
create procedure mysqltest1.p1()
 
36
begin
 
37
 INSERT INTO mysqltest1.t1 VALUES(3,USER());
 
38
 INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER());
 
39
end|
 
40
delimiter ;|
 
41
 
 
42
CALL mysqltest1.p1();
 
43
connection master;
 
44
SELECT * FROM mysqltest1.t1 ORDER BY a;
 
45
sync_slave_with_master;
 
46
SELECT * FROM mysqltest1.t1 ORDER BY a;
 
47
 
 
48
connection master;
 
49
# Lets cleanup
 
50
#show binlog events;
 
51
 
 
52
DROP DATABASE mysqltest1;
 
53
REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
 
54
REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
 
55
DROP USER tester@'%';
 
56
DROP USER ''@'localhost%';
 
57
 
 
58
sync_slave_with_master;
 
59
 
 
60
# End of 5.0 test case