~jaypipes/drizzle/refactor-trx-log-applier

« back to all changes in this revision

Viewing changes to plugin/test_authz/tests/t/basic.test

  • Committer: Jay Pipes
  • Date: 2010-03-05 18:24:28 UTC
  • mfrom: (1273.1.51 staging)
  • Revision ID: jpipes@serialcoder-20100305182428-9m16fszbs3mvdhe0
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Check for error if no parameter provided
 
2
create database authz_no;
 
3
--error ER_NO_SUCH_TABLE
 
4
SELECT * from authz_no.dont_exist;
 
5
create database authz_yes;
 
6
show databases;
 
7
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
 
8
connect (should_succeed,localhost,authz,test,,);
 
9
connection should_succeed;
 
10
show databases;
 
11
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
 
12
--replace_regex /@'.*?'/@'LOCALHOST'/
 
13
--error ER_DBACCESS_DENIED_ERROR
 
14
SELECT * from authz_no.dont_exist;
 
15
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
 
16
--replace_regex /@'.*?'/@'LOCALHOST'/
 
17
--error ER_DBACCESS_DENIED_ERROR
 
18
create database authz_no;
 
19
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
 
20
--replace_regex /@'.*?'/@'LOCALHOST'/
 
21
--error ER_DBACCESS_DENIED_ERROR
 
22
drop database authz_no;
 
23
 
 
24
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
 
25
connect (con1,localhost,root,test,,);
 
26
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
 
27
connect (con2,localhost,root,test,,);
 
28
connection con1;
 
29
 
 
30
--replace_column 3 # 5 # 6 # 7 #
 
31
show processlist;
 
32
 
 
33
--disable_reconnect
 
34
create table t1 (kill_id int);
 
35
insert into t1 values(connection_id());
 
36
 
 
37
connection con2;
 
38
select ((@id := kill_id) - kill_id) from t1;
 
39
kill @id;
 
40
 
 
41
connection con1;
 
42
--sleep 2
 
43
 
 
44
--disable_query_log
 
45
--disable_result_log
 
46
# One of the following statements should fail
 
47
--error 0,5,20,23
 
48
select 1;
 
49
--error 0,5,20,23
 
50
select 1;
 
51
--enable_query_log
 
52
--enable_result_log
 
53
--enable_reconnect
 
54
 
 
55
select ((@id := kill_id) - kill_id) from t1;
 
56
select @id != connection_id();
 
57
 
 
58
update t1 set kill_id= connection_id();
 
59
 
 
60
connection should_succeed;
 
61
--replace_column 3 # 6 #
 
62
show processlist;
 
63
select ((@id := kill_id) - kill_id) from t1;
 
64
 
 
65
--error ER_NO_SUCH_THREAD
 
66
kill @id;
 
67
 
 
68
 
 
69
 
 
70
 
 
71
# Test failing initial connection
 
72
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
 
73
--replace_regex /@'.*?'/@'LOCALHOST'/
 
74
--error ER_DBACCESS_DENIED_ERROR
 
75
connect (should_fail,localhost,authz,,authz_no,,);
 
76
 
 
77
connection default;
 
78
drop table t1;
 
79
drop schema authz_yes;
 
80
drop schema authz_no;