Debian Codegraph @

mysql-test/suite/x/r/notice_shutdown.result

raw
1 ## I. Validate that X Plugin sends shutdown notice on IDLE connections
2 #
3 # 1. Connect multiple clients, make the IDLE, and trigger restart, validate the notice
4 # 2. Assert status variables after server restart (they should be set at 0)
5 # 3. Assert MYSQLXTEST message counters that it saw the warning notice
6 #
7 ## II. Validate that X Plugin sends shutdown notice on connections that process a query
8 #
9 # 1. A connection is waiting for lock
10 # 2. A connection is sleeping "SELECT SLEEP(A);"
11 #
12 ## III. Validate that X Plugin not sends shutdown notice on not authotized connections
13 #
14
15
16 #
17 # I.1
18 connecting...
19 active session is now 'session_0'
20 connecting...
21 active session is now 'session_1'
22 connecting...
23 active session is now 'session_2'
24 connecting...
25 active session is now 'session_3'
26 connecting...
27 active session is now 'session_4'
28 connecting...
29 active session is now 'session_5'
30 connecting...
31 active session is now 'session_6'
32 connecting...
33 active session is now 'session_7'
34 connecting...
35 active session is now 'session_8'
36 connecting...
37 active session is now 'session_9'
38
39 #
40 # Shutting down MySQL Server
41 session_0
42 switched to session session_0
43 [ASSERT notice warning - ERROR, 1053]
44 Server disconnected
45 switched to session default
46 [ASSERT notice warning - ERROR, 1053]
47 Server disconnected
48 # Reconnecting default session
49
50 #
51 # I.2
52 RUN SHOW STATUS LIKE 'Mysqlx_notice_warning_sent';
53 Verify [Status variable "Mysqlx_notice_warning_sent" needs to have a value of 0]
54 RUN SHOW GLOBAL STATUS LIKE 'Mysqlx_notice_warning_sent';
55 Verify [Status variable "Mysqlx_notice_warning_sent" needs to have a value of 0]
56
57 #
58 # I.3
59 Verify [Client handled Mysqlx.Notice.Warning message count is "==" 1]
60 Mysqlx.Ok {
61 msg: "bye!"
62 }
63 ok
64
65 #
66 # II. Prepare
67 RUN CREATE TABLE test.some_table(some_column int)
68
69 0 rows affected
70 RUN CREATE PROCEDURE test.loop_in_sp()
71 BEGIN
72 REPEAT
73 SET @A=1;
74 UNTIL FALSE END REPEAT;
75 END
76
77
78 0 rows affected
79 connecting...
80 active session is now 'session_WRITE_LOCK'
81 RUN LOCK TABLE test.some_table WRITE
82
83 0 rows affected
84 connecting...
85 active session is now 'session_READ_LOCK'
86 RUN SELECT * FROM test.some_table
87 connecting...
88 active session is now 'session_SLEEP'
89 RUN SELECT SLEEP(10000)
90 connecting...
91 active session is now 'session_SP'
92 RUN CALL test.loop_in_sp()
93 switched to session default
94
95 #
96 # Shutting down MySQL Server
97 switched to session default
98
99 #
100 # II.1
101 switched to session session_WRITE_LOCK
102 [ASSERT notice warning - ERROR, 1053]
103 Server disconnected
104
105 #
106 # II.1
107 switched to session session_READ_LOCK
108 Got expected error (one of: 0 1317 )
109 Mysqlx.Notice.Frame {
110 type: 1
111 payload: "Mysqlx.Notice.Warning { level: ERROR\ncode: 1053\nmsg: \"Server shutdown in progress\"\n }"
112 }
113
114 Server disconnected
115
116 #
117 # II.2
118 switched to session session_SLEEP
119 SLEEP(10000)
120 1
121 0 rows affected
122 [ASSERT notice warning - ERROR, 1053]
123 Server disconnected
124
125 #
126 # II.3
127 switched to session session_SP
128 Mysqlx.Error(code) = 1053
129 [ASSERT notice warning - ERROR, 1053]
130 Server disconnected
131 closing session session_SP
132 Mysqlx.Ok {
133 msg: "bye!"
134 }
135 ok
136
137 #
138 # III
139
140 #
141 # Creating sessions
142 connecting...
143 active session is now 'session_0'
144 Mysqlx.Notice.Frame(type) = 5
145 connecting...
146 active session is now 'session_1'
147 Mysqlx.Notice.Frame(type) = 5
148 connecting...
149 active session is now 'session_2'
150 Mysqlx.Notice.Frame(type) = 5
151 connecting...
152 active session is now 'session_3'
153 Mysqlx.Notice.Frame(type) = 5
154 connecting...
155 active session is now 'session_4'
156 Mysqlx.Notice.Frame(type) = 5
157 connecting...
158 active session is now 'session_5'
159 Mysqlx.Notice.Frame(type) = 5
160 connecting...
161 active session is now 'session_6'
162 Mysqlx.Notice.Frame(type) = 5
163 connecting...
164 active session is now 'session_7'
165 Mysqlx.Notice.Frame(type) = 5
166 connecting...
167 active session is now 'session_8'
168 Mysqlx.Notice.Frame(type) = 5
169 connecting...
170 active session is now 'session_9'
171 Mysqlx.Notice.Frame(type) = 5
172
173 #echo # Shutting down MySQL Server
174 switched to session default
175
176 #
177 # Closing connection and reconect
178 switched to session session_0
179 # `recvunitldisc` command must report disconnection without any other messages
180 Server disconnected
181 switched to session session_1
182 # `recvunitldisc` command must report disconnection without any other messages
183 Server disconnected
184 switched to session session_2
185 # `recvunitldisc` command must report disconnection without any other messages
186 Server disconnected
187 switched to session session_3
188 # `recvunitldisc` command must report disconnection without any other messages
189 Server disconnected
190 switched to session session_4
191 # `recvunitldisc` command must report disconnection without any other messages
192 Server disconnected
193 switched to session session_5
194 # `recvunitldisc` command must report disconnection without any other messages
195 Server disconnected
196 switched to session session_6
197 # `recvunitldisc` command must report disconnection without any other messages
198 Server disconnected
199 switched to session session_7
200 # `recvunitldisc` command must report disconnection without any other messages
201 Server disconnected
202 switched to session session_8
203 # `recvunitldisc` command must report disconnection without any other messages
204 Server disconnected
205 switched to session session_9
206 # `recvunitldisc` command must report disconnection without any other messages
207 Server disconnected
208 switched to session default
209 [ASSERT notice warning - ERROR, 1053]
210 Server disconnected
211 # Reconnecting default session
212 Mysqlx.Ok {
213 msg: "bye!"
214 }
215 ok
216 DROP TABLE test.some_table;
217 DROP PROCEDURE test.loop_in_sp;