Debian Codegraph @

mysql-test/suite/ndb/r/ndb_truncate_fail.result

raw
1 # [connection default]
2 CALL create_tables(20);
3 CALL insert_row(20);
4 SELECT COUNT(*) FROM t1;
5 COUNT(*)
6 1
7 SELECT COUNT(*) FROM t20;
8 COUNT(*)
9 1
10 SET GLOBAL ndb_metadata_sync = 'ON';
11 # Start truncating
12 CALL truncate_list(1,10);
13 # Now fail all drops (1st phase of truncate)
14 SET @saved_debug = @@GLOBAL.debug;
15 SET @@GLOBAL.debug = '+d,ndb_fail_drop';
16 CALL truncate_list(11, 20);
17 ERROR HY000: Got error 761 'Unable to drop table as backup is in progress' from NDBCLUSTER
18 CALL truncate_list(11, 20);
19 ERROR HY000: Got error 761 'Unable to drop table as backup is in progress' from NDBCLUSTER
20 # t1->t10 must have been truncated
21 SELECT COUNT(*) FROM t1;
22 COUNT(*)
23 0
24 SELECT COUNT(*) FROM t10;
25 COUNT(*)
26 0
27 # t11->t20 must have failed
28 SELECT COUNT(*) FROM t11;
29 COUNT(*)
30 1
31 SELECT COUNT(*) FROM t20;
32 COUNT(*)
33 1
34 # [connection server1]
35 SET DEBUG_SYNC='truncate_stop_after_execute SIGNAL signal1 WAIT_FOR go_signal1';
36 CALL truncate_list(1,20);
37 # [connection server2]
38 CALL truncate_list(1,20);
39 # [connection default]
40 SET DEBUG_SYNC='now SIGNAL go_signal1';
41 # [connection server1]
42 ERROR HY000: Got error 761 'Unable to drop table as backup is in progress' from NDBCLUSTER
43 # [connection server2]
44 # [connection server1]
45 SET DEBUG_SYNC='truncate_stop_after_execute SIGNAL signal1 WAIT_FOR go_signal1';
46 CALL truncate_list(1,20);
47 # [connection server2]
48 CALL truncate_list(1,20);
49 # [connection default]
50 SET DEBUG_SYNC='now SIGNAL go_signal1';
51 # [connection server1]
52 ERROR HY000: Got error 761 'Unable to drop table as backup is in progress' from NDBCLUSTER
53 # [connection server2]
54 # [connection default]
55 # Re-insert data to assess that share locks were properly cleaned
56 CALL insert_row(20);
57 # All tables should have data (t1->t20 1 row, by server2)
58 SELECT COUNT(*) FROM t1;
59 COUNT(*)
60 1
61 SELECT COUNT(*) FROM t20;
62 COUNT(*)
63 1
64 # Cleanup
65 DROP PROCEDURE truncate_list;
66 SET GLOBAL debug = @saved_debug;
67 CALL drop_tables(20);
68 DROP PROCEDURE create_tables;
69 DROP PROCEDURE drop_tables;
70 DROP PROCEDURE insert_row;
71 DROP PROCEDURE truncate_list;