Debian Codegraph @

mysql-test/suite/x/t/input_queue.test

raw
1 call mtr.add_suppression("Message of size .* received, exceeding the limit of");
2
3 --echo Setup
4 --source include/xplugin_preamble.inc
5 --source include/xplugin_create_user.inc
6 USE `test`;
7 SET GLOBAL Mysqlx_max_allowed_packet=1024;
8 CREATE TABLE IF NOT EXISTS `first_table`(`column_name` INTEGER DEFAULT 0 NOT NULL);
9
10 --write_file $MYSQL_TMP_DIR/mysqlx-input-queue.xpl
11 -->sql
12 USE test;
13 -->endsql
14
15
16 -->macro Lock_table
17 -->setsession
18 LOCK TABLES `first_table` WRITE;
19 -->endmacro
20
21 -->macro Do_nothing
22 -->endmacro
23
24 -->macro Unlock_table
25 -->setsession
26 UNLOCK TABLES;
27 -->endmacro
28
29 -->macro Pipline_message %SESSION% %PACKET_COMMENT_SIZE%
30 -->newsession %SESSION% x_root test
31 Mysqlx.Sql.StmtExecute {
32 stmt:"LOCK TABLES `first_table` READ;"
33 namespace: "sql"
34 }
35
36 -->vargen %COMMENT% c %PACKET_COMMENT_SIZE%
37
38 -->varsub %COMMENT%
39
40 -->echo Test sends 4 messages
41 -->echo LOCK TABLE stops processing of following commands
42 -->quiet
43 Mysqlx.Sql.StmtExecute {
44 stmt:"SELECT 1 as `First query` /* %COMMENT% */;"
45 namespace: "sql"
46 }
47 Mysqlx.Sql.StmtExecute {
48 stmt:"SELECT 2 as `Second query`/* %COMMENT% */;"
49 namespace: "sql"
50 }
51 Mysqlx.Sql.StmtExecute {
52 stmt:"SELECT 3 as `Third query`/* %COMMENT% */;"
53 namespace: "sql"
54 }
55 Mysqlx.Sql.StmtExecute {
56 stmt:"SELECT 4 as `Fourth query`/* %COMMENT% */;"
57 namespace: "sql"
58 }
59 -->noquiet
60 -->endmacro
61
62 -->macro Response_for_last_pipline %SESSION%
63 -->setsession %SESSION%
64
65 -->recvresult
66 -->recvresult
67 -->recvresult
68 -->recvresult
69 -->recvresult
70
71 -->echo Bug 21811192 (fixed)
72 -->echo Lets try if plugin is processing new data
73 -->stmtadmin ping
74 -->recvresult
75 -->closesession %SESSION%
76 -->endmacro
77
78
79 -->macro Send_two_messages_as_one_and_queue_in_input %SESSION% %PACKET_COMMENT_SIZE%
80 -->newsession %SESSION% x_root test
81
82 -->vargen %COMMENT% c %PACKET_COMMENT_SIZE%
83 -->varsub %COMMENT%
84
85 -->quiet
86 -->binparse %FIRST% Mysqlx.Sql.StmtExecute {
87 stmt:"SELECT 1 as `First query`/*%PACKET_COMMENT_SIZE% %COMMENT% */;"
88 namespace: "sql"
89 }
90 -->binparse %SECOND% Mysqlx.Sql.StmtExecute {
91 stmt:"SELECT 2 as `Second query`;"
92 namespace: "sql"
93 }
94
95 -->binsend %FIRST%%SECOND%
96 -->noquiet
97
98 -->echo wait for first
99 -->recvresult
100 -->echo wait for second
101 -->recvresult
102
103
104 -->echo Bug 21811192 (fixed)
105 -->echo Lets try if plugin is processing new data
106 -->stmtadmin ping
107 -->recvresult
108 -->closesession %SESSION%
109 -->endmacro
110
111
112 -->macro Buffer_config %I1% %I2% %I3%
113 -->setsession
114 -->sql
115 #Buffer uses one additional page
116 SET GLOBAL Mysqlx_max_allowed_packet=%I2%;
117 -->endsql
118
119 -->endmacro
120
121
122
123 -->echo Limits are less then page size
124 -->callmacro Buffer_config 1024 1024 1024
125 -->callmacro %MACRO_LOCK%
126 -->callmacro Pipline_message test1 250
127 -->callmacro %MACRO_UNLOCK%
128 -->callmacro Response_for_last_pipline test1
129
130
131 -->echo Multiple messages fill the buffer (last one uses extra page)
132 -->callmacro Buffer_config 4094 4094 4094
133 -->callmacro %MACRO_LOCK%
134 -->callmacro Pipline_message test2 1024
135 -->callmacro %MACRO_UNLOCK%
136 -->callmacro Response_for_last_pipline test2
137
138 -->callmacro %MACRO_LOCK%
139 -->callmacro Pipline_message test3 2048
140 -->callmacro %MACRO_UNLOCK%
141 -->callmacro Response_for_last_pipline test3
142
143 -->callmacro %MACRO_LOCK%
144 -->callmacro Pipline_message test4 3048
145 -->callmacro %MACRO_UNLOCK%
146 -->callmacro Response_for_last_pipline test4
147
148
149 -->echo Use 2 page for single message, while receiving second packet wait for first to be processed
150 -->echo Extra page is used in case of not full loaded first page
151 -->callmacro Buffer_config 4094 8188 4094
152 -->callmacro %MACRO_LOCK%
153 -->callmacro Pipline_message test5 8058
154 -->callmacro %MACRO_UNLOCK%
155 -->callmacro Response_for_last_pipline test5
156
157 -->callmacro Buffer_config 1024 2024 100
158 -->callmacro Send_two_messages_as_one_and_queue_in_input test6 1024
159
160
161 -->echo Bug 21839782 (fixed) - no data in buffer for incoming message (infinite loop)
162 # Current connection shouldn't be impacted by packet change
163 -->newsession invalid_1 x_root
164 -->sql
165 SET GLOBAL mysqlx_max_allowed_packet=1048597;
166 -->endsql
167 -->quiet
168 -->vargen %A% c 1048576
169
170
171 -->quiet
172 -->echo While sending client could receive CR_BROKEN_PIPE network which could occur
173 -->echo because xplugin stopped read ops
174 -->expecterror 0,2007
175 Mysqlx.Sql.StmtExecute {
176 stmt: "SELECT 1; /* %A% */"
177 }
178 -->recvresult
179 EOF
180
181
182 --echo Test case
183 exec $MYSQLXTEST
184 -u x_root --password=''
185 -v%MACRO_LOCK%=Do_nothing
186 -v%MACRO_UNLOCK%=Do_nothing
187 --file=$MYSQL_TMP_DIR/mysqlx-input-queue.xpl 2>&1;
188
189 # X Plugin uses TCP buffer for pipelining, anyway at least
190 # client must have additional implementation to support
191 # pipelining correctly.
192
193 # Without server-side input buffering
194 #
195 # following scenrio is going to fail when system has small
196 # values set in `tcp_rmem` and `tcp_wmem`.
197 #exec $MYSQLXTEST
198 # -u x_root --password=''
199 # -v%MACRO_LOCK%=Lock_table
200 # -v%MACRO_UNLOCK%=Unlock_table
201 # --file=$MYSQL_TMP_DIR/mysqlx-input-queue.xpl 2>&1;
202
203 ## Cleanup
204 SET GLOBAL Mysqlx_max_allowed_packet=DEFAULT;
205 DROP TABLE `first_table`;
206 --source ../include/xplugin_cleanup.inc