~mathiaz/ubuntu/lucid/mysql-dfsg-5.1/zap-bug-552053

« back to all changes in this revision

Viewing changes to mysql-test/t/connect.test

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-06-25 12:55:45 UTC
  • mfrom: (1.1.2 upstream) (0.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20090625125545-m8ogs96zzsri74xe
Tags: 5.1.34-1ubuntu1
* Merge from debian experimental (and 5.0 from main), remaining changes:
  - debian/mysql-server-5.1.config:
    + ask for MySQL root password at priority high instead of medium so
      that the password prompt is seen on a default install. (LP: #319843)
    + don't ask for root password when upgrading from a 5.0 install.
  - debian/control:
    + Make libmysqlclient16-dev a transitional package depending on
      libmysqlclient-dev.
    + Make libmysqlclient-dev conflict with libmysqlclient15-dev.
    + Don't build mysql-server, mysql-client, mysql-common and
      libmysqlclient15-dev binary packages since they're still provided
      by mysql-dfsg-5.0.
    + Make mysql-{client,server}-5.1 packages conflict and
      replace mysql-{client,server}-5.0, but not provide
      mysql-{client,server}.
    + Depend on a specific version of mysql-common rather than the src
      version of mysql-dfsg-5.1 since mysql-common is currently part of
      mysql-dfsg-5.0.
    + Lower mailx from a Recommends to a Suggests to avoid pulling in
      a full MTA on all installs of mysql-server. (LP: #259477)
  - debian/rules:
    + added -fno-strict-aliasing to CFLAGS to get around mysql testsuite
      build failures.
    + install mysql-test and sql-bench to /usr/share/mysql/ rather than
      /usr/.
  - debian/additions/debian-start.inc.sh: support ANSI mode (LP: #310211)
  - Add AppArmor profile:
    - debian/apparmor-profile: apparmor profile.
    - debian/rules, debian/mysql-server-5.0.files: install apparmor profile.
    - debian/mysql-server-5.0.dirs: add etc/apparmor.d/force-complain
    - debian/mysql-server-5.0.postrm: remove symlink in force-complain/ on
      purge.
    - debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    - debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    - debian/mysql-server-5.1.postinst: reload apparmor profiles.
  - debian/additions/my.cnf: remove language option. Error message files are
    located in a different directory in MySQL 5.0. Setting the language
    option to use /usr/share/mysql/english breaks 5.0. Both 5.0 and 5.1
    use a default value that works. (LP: #316974)
  - debian/mysql-server-5.1.mysql.init:
    + Clearly indicate that we do not support running multiple instances
      of mysqld by duplicating the init script.
      (closes: #314785, #324834, #435165, #444216)
    + Properly parameterize all existing references to the mysql config
      file (/etc/mysql/my.cnf).
  - debian/mysql-server-5.0.postinst: Clear out the second password
    when setting up mysql. (LP: #344816)
  - mysql-server-core-5.1 package for files needed by Akonadi:
    + debian/control: create mysql-server-core-5.1 package.
    + debian/mysql-server-core-5.1.files, debian/mysql-server-5.1.files:
      move core mysqld files to mysql-server-core-5.1 package.
  - Don't package sql-bench and mysql-test file.
* Dropped changes:
  - debian/patches/92_ssl_test_cert.dpatch: certificate expiration in
    test suite (LP: #323755). Included upstream.
* Dropped from 5.0:
  - apparmor profile:
    - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6. All version
      of apparmor-profile (>hardy) are higher than this version.
    - debian/mysql-server-5.0.preinst: create symlink for force-complain/
      on pre-feisty upgrades, upgrades where apparmor-profiles profile is
      unchanged (ie non-enforcing) and upgrades where the profile
      doesn't exist. Support for pre-hardy upgrades is no longer needed.
* debian/mysql-server-5.1.postinst: fix debian-sys-maint user creation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
# of the log tables (which are CSV-based). By connect mysql; show tables;
10
10
--source include/have_csv.inc
11
11
 
 
12
# Save the initial number of concurrent sessions
 
13
--source include/count_sessions.inc
 
14
 
 
15
 
12
16
--disable_warnings
13
17
drop table if exists t1,t2;
14
18
--enable_warnings
15
19
 
16
 
 
17
20
#connect (con1,localhost,root,,"");
18
21
#show tables;
19
22
connect (con1,localhost,root,,mysql);
22
25
show tables;
23
26
 
24
27
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
25
 
--error 1045
 
28
--error ER_ACCESS_DENIED_ERROR
26
29
connect (fail_con,localhost,root,z,test2);
27
30
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
28
 
--error 1045
 
31
--error ER_ACCESS_DENIED_ERROR
29
32
connect (fail_con,localhost,root,z,);
30
33
 
 
34
connection default;
 
35
disconnect con1;
 
36
disconnect con2;
 
37
 
31
38
grant ALL on *.* to test@localhost identified by "gambling";
32
39
grant ALL on *.* to test@127.0.0.1 identified by "gambling";
33
40
 
39
46
connect (con4,localhost,test,gambling,test);
40
47
show tables;
41
48
 
 
49
connection default;
 
50
disconnect con3;
 
51
disconnect con4;
 
52
 
42
53
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
43
 
--error 1045
 
54
--error ER_ACCESS_DENIED_ERROR
44
55
connect (fail_con,localhost,test,,test2);
45
56
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
46
 
--error 1045
 
57
--error ER_ACCESS_DENIED_ERROR
47
58
connect (fail_con,localhost,test,,"");
48
59
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
49
 
--error 1045
 
60
--error ER_ACCESS_DENIED_ERROR
50
61
connect (fail_con,localhost,test,zorro,test2);
51
62
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
52
 
--error 1045
 
63
--error ER_ACCESS_DENIED_ERROR
53
64
connect (fail_con,localhost,test,zorro,);
54
65
 
55
 
 
56
66
# check if old password version also works
57
67
update mysql.user set password=old_password("gambling2") where user=_binary"test";
58
68
flush privileges;
61
71
connect (con5,localhost,test,gambling2,mysql);
62
72
connection con5;
63
73
set password="";
64
 
--error 1372
 
74
--error ER_PASSWD_LENGTH
65
75
set password='gambling3';
66
76
set password=old_password('gambling3');
67
77
show tables;
68
78
connect (con6,localhost,test,gambling3,test);
69
79
show tables;
70
80
 
 
81
connection default;
 
82
disconnect con10;
 
83
disconnect con5;
 
84
disconnect con6;
 
85
 
71
86
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
72
 
--error 1045
 
87
--error ER_ACCESS_DENIED_ERROR
73
88
connect (fail_con,localhost,test,,test2);
74
89
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
75
 
--error 1045
 
90
--error ER_ACCESS_DENIED_ERROR
76
91
connect (fail_con,localhost,test,,);
77
92
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
78
 
--error 1045
 
93
--error ER_ACCESS_DENIED_ERROR
79
94
connect (fail_con,localhost,test,zorro,test2);
80
95
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
81
 
--error 1045
 
96
--error ER_ACCESS_DENIED_ERROR
82
97
connect (fail_con,localhost,test,zorro,);
83
98
 
84
99
 
85
100
# remove user 'test' so that other tests which may use 'test'
86
101
# do not depend on this test.
87
 
 
88
102
delete from mysql.user where user=_binary"test";
89
103
flush privileges;
90
104
 
91
105
#
92
 
# Bug#12517: Clear user variables and replication events before 
93
 
#            closing temp tables in thread cleanup.
 
106
# Bug#12517 Clear user variables and replication events before
 
107
#           closing temp tables in thread cleanup.
94
108
connect (con7,localhost,root,,test);
95
109
connection con7;
 
110
let $connection_id= `select connection_id()`;
96
111
create table t1 (id integer not null auto_increment primary key);
97
112
create temporary table t2(id integer not null auto_increment primary key);
98
113
set @id := 1;
99
114
delete from t1 where id like @id;
 
115
connection default;
100
116
disconnect con7;
101
 
--sleep 5
102
 
connection default;
 
117
# Wait till the session con7 is disconnected
 
118
let $wait_condition =
 
119
  SELECT COUNT(*) = 0
 
120
  FROM information_schema.processlist
 
121
  WHERE  id = '$connection_id';
 
122
--source include/wait_condition.inc
103
123
drop table t1;
104
124
 
105
 
--disconnect con1
106
 
--disconnect con2
107
 
--disconnect con3
108
 
--disconnect con4
109
 
--disconnect con5
110
 
--disconnect con6
111
 
--disconnect con10
112
 
 
113
125
--echo # ------------------------------------------------------------------
114
126
--echo # -- End of 4.1 tests
115
127
--echo # ------------------------------------------------------------------
147
159
--echo # -- Check that we allow exactly three user connections, no matter how
148
160
--echo # -- many threads are running.
149
161
 
150
 
--echo 
 
162
--echo
151
163
--echo # -- Connecting (1)...
152
164
let $con_name = con_1;
153
165
let $con_user_name = mysqltest_u1;
237
249
 
238
250
###########################################################################
239
251
 
240
 
--echo # -- Bug#35074: max_used_connections is not correct. 
 
252
--echo # -- Bug#35074: max_used_connections is not correct.
241
253
--echo
242
254
 
243
255
FLUSH STATUS;
250
262
SET GLOBAL event_scheduler = ON;
251
263
 
252
264
--echo # -- Waiting for Event Scheduler to start...
253
 
let $wait_condition =
254
 
  SELECT COUNT(*) = 1
255
 
  FROM information_schema.processlist
256
 
  WHERE user = 'event_scheduler';
257
 
--source include/wait_condition.inc
 
265
--source include/running_event_scheduler.inc
258
266
 
259
267
# NOTE: We should use a new connection here instead of reconnect in order to
260
268
# avoid races (we can not for sure when the connection being disconnected is
278
286
SET GLOBAL event_scheduler = OFF;
279
287
 
280
288
--echo # -- Waiting for Event Scheduler to stop...
281
 
let $wait_condition =
282
 
  SELECT COUNT(*) = 0
283
 
  FROM information_schema.processlist
284
 
  WHERE user = 'event_scheduler';
285
 
--source include/wait_condition.inc
 
289
--source include/no_running_events.inc
286
290
 
287
291
--echo
288
292
--echo # -- End of Bug#35074.
291
295
--echo # ------------------------------------------------------------------
292
296
--echo # -- End of 5.1 tests
293
297
--echo # ------------------------------------------------------------------
 
298
 
 
299
# Wait till all disconnects are completed
 
300
--source include/wait_until_count_sessions.inc
 
301