| 1 |
# |
| 2 |
# Bug#33500956: ERROR 1156 (08S01): Got packets out of order; |
| 3 |
# Tests if federated engine correctly handles (with reconnect) |
| 4 |
# 5 different possible wait_timeout related errors. |
| 5 |
# |
| 6 |
-- echo # Setup |
| 7 |
|
| 8 |
--source include/have_debug.inc |
| 9 |
--source suite/federated/include/federated.inc |
| 10 |
|
| 11 |
# connect to remote. |
| 12 |
connection slave; |
| 13 |
--disable_warnings |
| 14 |
DROP TABLE IF EXISTS federated.t1; |
| 15 |
--enable_warnings |
| 16 |
|
| 17 |
CREATE TABLE federated.t1 ( |
| 18 |
a int |
| 19 |
); |
| 20 |
|
| 21 |
# connect to local. |
| 22 |
connection master; |
| 23 |
|
| 24 |
--disable_warnings |
| 25 |
DROP TABLE IF EXISTS federated.t1; |
| 26 |
--enable_warnings |
| 27 |
|
| 28 |
--replace_result $SLAVE_MYPORT SLAVE_PORT |
| 29 |
eval CREATE TABLE federated.t1 ( |
| 30 |
a int |
| 31 |
) ENGINE="FEDERATED" |
| 32 |
CONNECTION='mysql://[email protected]:$SLAVE_MYPORT/federated/t1'; |
| 33 |
|
| 34 |
SELECT * FROM federated.t1; |
| 35 |
SET @debug_master_save= @@GLOBAL.DEBUG; |
| 36 |
|
| 37 |
# test on local, each SELECT query should pass by reconnecting |
| 38 |
--echo # 1. Test wait_timeout with ER_NET_PACKETS_OUT_OF_ORDER error |
| 39 |
SET @@GLOBAL.DEBUG='+d,bug33500956_simulate_out_of_order'; |
| 40 |
SELECT * FROM federated.t1; |
| 41 |
|
| 42 |
--echo # 2. Test wait_timeout with ER_NET_ERROR_ON_WRITE error |
| 43 |
SET @@GLOBAL.DEBUG='+d,bug33500956_simulate_write_error'; |
| 44 |
SELECT * FROM federated.t1; |
| 45 |
|
| 46 |
--echo # 3. Test wait_timeout with ER_NET_WRITE_INTERRUPTED error |
| 47 |
SET @@GLOBAL.DEBUG='+d,bug33500956_simulate_write_interrupted'; |
| 48 |
SELECT * FROM federated.t1; |
| 49 |
|
| 50 |
--echo # 4. Test wait_timeout with ER_NET_READ_ERROR error |
| 51 |
SET @@GLOBAL.DEBUG='+d,bug33500956_simulate_read_error'; |
| 52 |
SELECT * FROM federated.t1; |
| 53 |
|
| 54 |
--echo # 5. Test wait_timeout with ER_NET_READ_INTERRUPTED error |
| 55 |
SET @@GLOBAL.DEBUG='+d,bug33500956_simulate_read_interrupted'; |
| 56 |
SELECT * FROM federated.t1; |
| 57 |
|
| 58 |
--echo # Cleanup |
| 59 |
SET @@GLOBAL.DEBUG= @debug_master_save; |
| 60 |
# connect to remote. |
| 61 |
connection slave; |
| 62 |
--source suite/federated/include/federated_cleanup.inc |