~jan-kneschke/mysql-proxy/packet-tracking-assertions

« back to all changes in this revision

Viewing changes to tests/suite/base/t/failover.test

  • Committer: Kay Roepke
  • Date: 2009-09-02 14:04:24 UTC
  • Revision ID: kay@sun.com-20090902140424-j795532tpi1y06lt
Fix linking errors on Win32:
 * chassis-timing was missing CHASSIS_API
 * evutil_socketpair was not exported

Suppress superfluous warnings from MSVC and fix a couple of valid ones (unused variables etc).

Add third path to the dllexport macros, to be used in testcases which are statically linked (fixes linker warnings).
Fixes PR-237

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#  $%BEGINLICENSE%$
2
 
#  Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
 
2
#  Copyright (C) 2008 MySQL AB, 2008 Sun Microsystems, Inc
3
3
4
 
#  This program is free software; you can redistribute it and/or
5
 
#  modify it under the terms of the GNU General Public License as
6
 
#  published by the Free Software Foundation; version 2 of the
7
 
#  License.
 
4
#  This program is free software; you can redistribute it and/or modify
 
5
#  it under the terms of the GNU General Public License as published by
 
6
#  the Free Software Foundation; version 2 of the License.
8
7
9
8
#  This program is distributed in the hope that it will be useful,
10
9
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
10
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
11
#  GNU General Public License for more details.
13
12
14
13
#  You should have received a copy of the GNU General Public License
15
14
#  along with this program; if not, write to the Free Software
16
 
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17
 
#  02110-1301  USA
 
15
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
16
19
17
#  $%ENDLICENSE%$
20
18
# this test 
24
22
# * stop the first backend and verifies that queries against it fail
25
23
# * checks that new connects end up on the second backend
26
24
 
27
 
connect (conn1,127.0.0.1,root,,,$PROXY_PORT);
28
 
connect (conn2,127.0.0.1,root,,,$PROXY_PORT);
 
25
connect (conn1,127.0.0.1,root,,,14040);
 
26
connect (conn2,127.0.0.1,root,,,14040);
29
27
 
30
28
connection conn1;
31
29
SET ID 1;
38
36
disconnect conn1;
39
37
 
40
38
# check if we end up on the the right backend
41
 
connect (conn1,127.0.0.1,root,,,$PROXY_PORT);
 
39
connect (conn1,127.0.0.1,root,,,14040);
42
40
connection conn1;
43
41
GET ID;
44
42
 
45
 
# now kill the backend
46
 
--error 2013
47
 
KILL BACKEND;
 
43
# now kill the backend and wait until it is down
 
44
COMMIT SUICIDE;
 
45
real_sleep 1;
48
46
 
49
47
# ... and this should fail now as the backend is gone
 
48
-- error 2013
 
49
GET ID;
 
50
 
50
51
-- error 2006
51
52
GET ID;
52
 
 
53
53
disconnect conn1;
54
54
 
55
55
connection conn2;
56
56
GET ID;
57
57
 
58
 
connect (conn1,127.0.0.1,root,,,$PROXY_PORT);
 
58
connect (conn1,127.0.0.1,root,,,14040);
59
59
GET ID;
60
60
disconnect conn1;
61
61