~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
# This test is to check various cases of connections
2
# with right and wrong password, with and without database
3
# Unfortunately the check is incomplete as we can't connect without database
4
5
# check that CSV engine was compiled in, as the test relies on the presence
6
# of the log tables (which are CSV-based). By connect mysql; show tables;
7
--source include/have_csv.inc
8
9
--disable_warnings
10
drop table if exists t1,t2;
11
--enable_warnings
12
13
14
#connect (con1,localhost,root,,"");
15
#show tables;
16
connect (con1,localhost,root,,mysql);
17
show tables;
18
connect (con2,localhost,root,,test);
19
show tables;
20
21
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
22
--error 1045
23
connect (fail_con,localhost,root,z,test2);
24
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
25
--error 1045
26
connect (fail_con,localhost,root,z,);
27
28
grant ALL on *.* to test@localhost identified by "gambling";
29
grant ALL on *.* to test@127.0.0.1 identified by "gambling";
30
31
# Now check this user with different databases
32
#connect (con1,localhost,test,gambling,"");
33
#show tables;
34
connect (con3,localhost,test,gambling,mysql);
35
show tables;
36
connect (con4,localhost,test,gambling,test);
37
show tables;
38
39
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
40
--error 1045
41
connect (fail_con,localhost,test,,test2);
42
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
43
--error 1045
44
connect (fail_con,localhost,test,,"");
45
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
46
--error 1045
47
connect (fail_con,localhost,test,zorro,test2);
48
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
49
--error 1045
50
connect (fail_con,localhost,test,zorro,);
51
52
53
# check if old password version also works
54
update mysql.user set password=old_password("gambling2") where user=_binary"test";
55
flush privileges;
56
57
connect (con10,localhost,test,gambling2,);
58
connect (con5,localhost,test,gambling2,mysql);
59
connection con5;
60
set password="";
61
--error 1372
62
set password='gambling3';
63
set password=old_password('gambling3');
64
show tables;
65
connect (con6,localhost,test,gambling3,test);
66
show tables;
67
68
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
69
--error 1045
70
connect (fail_con,localhost,test,,test2);
71
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
72
--error 1045
73
connect (fail_con,localhost,test,,);
74
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
75
--error 1045
76
connect (fail_con,localhost,test,zorro,test2);
77
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
78
--error 1045
79
connect (fail_con,localhost,test,zorro,);
80
81
82
# remove user 'test' so that other tests which may use 'test'
83
# do not depend on this test.
84
85
delete from mysql.user where user=_binary"test";
86
flush privileges;
87
88
#
89
# Bug#12517: Clear user variables and replication events before 
90
#            closing temp tables in thread cleanup.
91
connect (con7,localhost,root,,test);
92
connection con7;
93
create table t1 (id integer not null auto_increment primary key);
94
create temporary table t2(id integer not null auto_increment primary key);
95
set @id := 1;
96
delete from t1 where id like @id;
97
disconnect con7;
98
--sleep 5
99
connection default;
100
drop table t1;
101
102
--disconnect con1
103
--disconnect con2
104
--disconnect con3
105
--disconnect con4
106
--disconnect con5
107
--disconnect con6
108
--disconnect con10
109
110
--echo # ------------------------------------------------------------------
111
--echo # -- End of 4.1 tests
112
--echo # ------------------------------------------------------------------
113
114
--echo # ------------------------------------------------------------------
115
--echo # -- End of 5.1 tests
116
--echo # ------------------------------------------------------------------