File: events_bugs_debug.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (107 lines) | stat: -rw-r--r-- 3,602 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
--source include/have_debug.inc

# Save the initial number of concurrent sessions.
--source include/count_sessions.inc

--echo #
--echo # Bug#21914871 : ASSERTION `! IS_SET()' FOR DIAGNOSTICS_AREA::SET_OK_STATUS
--echo #                  CREATE EVENT
--echo #

SET SESSION DEBUG='+d,thd_killed_injection';
--error ER_QUERY_INTERRUPTED
CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR DO SELECT 1;
SET SESSION DEBUG='-d,thd_killed_injection';

--echo #
--echo # Bug#28122841 - CREATE EVENT/PROCEDURE/FUNCTION CRASHES WITH ACCENT SENSTIVE NAMES.
--echo #

--enable_connect_log

--echo # Case 1: Test case to verify MDL locking from concurrent SHOW CREATE EVENT
--echo #         and ALTER EVENT operation with case and accent insensitive
--echo #         event names.

CREATE EVENT café ON SCHEDULE EVERY 2 YEAR DO SELECT 1;
SET DEBUG_SYNC='after_acquiring_shared_lock_on_the_event SIGNAL locked WAIT_FOR continue';
--SEND SHOW CREATE EVENT CaFé
--echo # At this stage shared lock on the event object is acquired.

--CONNECT (con1, localhost, root)
SET DEBUG_SYNC='now WAIT_FOR locked';
--SEND ALTER EVENT CaFé COMMENT "comment"
--echo # Exclusive lock on the event is requested by this statement and it is
--echo # blocked till the shared lock is released by the SHOW statement.

--CONNECT (con2, localhost, root)
let $wait_condition= SELECT COUNT(*) > 0 FROM information_schema.processlist
                     WHERE info LIKE 'ALTER EVENT%' AND
                     state='Waiting for event metadata lock';
source include/wait_condition.inc;
SET DEBUG_SYNC='now SIGNAL continue';

--CONNECTION con1
--REAP

--CONNECTION default
--replace_column 2 # 3 # 4 # 5 # 6 # 7 #
--REAp

--echo # Case 2: Test case to verify MDL locking from concurrent DROP EVENT
--echo #         and SHOW CREATE EVENT operation with case and accent insensitive
--echo #         event name.

SET DEBUG_SYNC='after_acquiring_exclusive_lock_on_the_event SIGNAL locked WAIT_FOR continue';
--SEND DROP EVENT cafe
--echo # At this point we have a exclusive lock on the event.

--CONNECTION con1
SET DEBUG_SYNC='now WAIT_FOR locked';
--SEND SHOW CREATE EVENT CaFe
--echo # This statement request for shared lock on the event and it is blocked till
--echo # the DROP EVENT releases the lock.

--CONNECTION con2
let $wait_condition= SELECT COUNT(*) > 0 FROM information_schema.processlist
                     WHERE info LIKE 'SHOW CREATE EVENT%' AND
                     state='Waiting for event metadata lock';
source include/wait_condition.inc;
SET DEBUG_SYNC='now SIGNAL continue';

--CONNECTION con1
--error ER_EVENT_DOES_NOT_EXIST
--REAP

--CONNECTION default
--REAP

--echo # Cleanup.
SET DEBUG_SYNC='RESET';
DISCONNECT con1;
DISCONNECT con2;
--disable_connect_log


# Check that all connections opened by test cases in this file are really gone
# so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc


--echo #
--echo #  BUG#29140298 - `OPT_EVENT_SCHEDULER == EVENTS::EVENTS_ON ||
--echo #                  OPT_EVENT_SCHEDULER == EVENTS::EVEN
--echo #  When mysqld is started with --event_scheduler=DISABLED,
--echo #  it asserts on debug build without the fix.
--echo #  With the fix, the event scheduler initialization is skipped
--echo #  if mysqld is started with --event_scheduler=DISABLED.

--let $restart_parameters = restart: --event_scheduler=DISABLED
--source include/restart_mysqld.inc
# Ensure the event scheduler is OFF.
SELECT @@event_scheduler='DISABLED';


# Clean up, clear option
--let $restart_parameters = restart:
--source include/restart_mysqld.inc