Debian Codegraph @

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

raw
1
2 #
3 ## Test direct execution of Crud messages with limit field
4 CREATE DATABASE xtest;
5
6 ## I. Validation of Crud.Find limits
7 #
8 # 1. Different setting in old limit field
9 # a. limit only to first row
10 # b. limit only to first two rows
11 # c. limit only to first hundred rows, still return all rows from collection
12 # d. limit only to last two rows
13 # e. limit only to last two rows, still the last one is out of resultset
14 # 2. Setting literals in limit_expr field
15 # a. limit only to first row
16 # b. limit only to first two rows
17 # c. limit only to first hundred rows, still return all rows from collection
18 # d. limit only to last two rows
19 # e. limit only to last two rows, still the last one is out of resultset
20 # 3. Setting placeholders in limit_expr field
21 # a. limit only to first row
22 # b. limit only to first two rows
23 # c. limit only to first hundred rows, still return all rows from collection
24 # d. limit only to last two rows
25 # e. limit only to last two rows, still the last one is out of resultset
26
27 ## II. Validation of Crud.Delete limits
28 #
29 # 1. Different setting in old limit field
30 # a. delete only first row
31 # b. delete only first two rows
32 # c. try to delete hundred rows, still only 6 delete (in collection)
33 # 2. Setting literals in limit_expr field
34 # a. delete only first row
35 # b. delete only first two rows
36 # c. try to delete hundred rows, still only 6 delete (in collection)
37 # 3. Setting placeholders in limit_expr field
38 # a. delete only first row
39 # b. delete only first two rows
40 # c. try to delete hundred rows, still only 6 delete (in collection)
41
42 ## III. Validation of Crud.Update limits
43 #
44 # 1. Different setting in old limit field
45 # a. delete only first row
46 # b. delete only first two rows
47 # c. try to delete hundred rows, still only 6 delete (in collection)
48 # 2. Setting literals in limit_expr field
49 # a. delete only first row
50 # b. delete only first two rows
51 # c. try to delete hundred rows, still only 6 delete (in collection)
52 # 3. Setting placeholders in limit_expr field
53 # a. delete only first row
54 # b. delete only first two rows
55 # c. try to delete hundred rows, still only 6 delete (in collection)
56
57 ## IV. Validation invalid configuration of Crud limits
58 #
59 # 1. 'limit' and 'limit_expr' were set
60 # a. in Crud.Find
61 # b. in Crud.Update
62 # d. in Crud.Delete
63 # 2. 'limit' uses 'offset' field when Crud doesn't support it
64 # a. in Crud.Update
65 # b. in Crud.Delete
66 # 2. 'limit_expr' uses 'offset' field when Crud doesn't support it
67 # a. in Crud.Update
68 # b. in Crud.Delete
69
70 #
71 ## I.1
72
73 [Setup table coll]
74 [Assert Find operation and expect 1 rows returned, executed with limit {row_count:1}]
75 [Assert Find operation and expect 2 rows returned, executed with limit {row_count:2}]
76 [Assert Find operation and expect 9 rows returned, executed with limit {row_count:100}]
77 [Assert Find operation and expect 2 rows returned, executed with limit {row_count:2 offset: 7}]
78 [Assert Find operation and expect 1 rows returned, executed with limit {row_count:2 offset: 8}]
79
80 #
81 ## I.2
82 [Assert Find operation and expect 1 rows returned, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:1}}}]
83 [Assert Find operation and expect 2 rows returned, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:2}}}]
84 [Assert Find operation and expect 9 rows returned, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:100}}}]
85 [Assert Find operation and expect 2 rows returned, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:2}} offset{type:LITERAL literal {type:V_SINT v_signed_int:7}}}]
86 [Assert Find operation and expect 1 rows returned, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:2}} offset{type:LITERAL literal {type:V_SINT v_signed_int:8}}}]
87
88 #
89 ## I.3
90 [Assert Find operation and expect 1 rows returned, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
91 [Assert Find operation and expect 2 rows returned, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
92 [Assert Find operation and expect 9 rows returned, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
93 [Assert Find operation and expect 2 rows returned, executed with limit_expr { row_count{ type:PLACEHOLDER position:0} offset{type:PLACEHOLDER position:1}}]
94 [Assert Find operation and expect 1 rows returned, executed with limit_expr { row_count{ type:PLACEHOLDER position:0} offset { type:PLACEHOLDER position:1}}]
95
96 #
97 ## II.1
98
99 [Setup table coll]
100 [Assert Delete operation and expect deletion of 1 rows, executed with limit {row_count:1}]
101 [Assert Delete operation and expect deletion of 2 rows, executed with limit {row_count:2}]
102 [Assert Delete operation and expect deletion of 6 rows, executed with limit {row_count:100}]
103
104 #
105 ## II.2
106
107 [Setup table coll]
108 [Assert Delete operation and expect deletion of 1 rows, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:1}}}]
109 [Assert Delete operation and expect deletion of 2 rows, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:2}}}]
110 [Assert Delete operation and expect deletion of 6 rows, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:100}}}]
111
112 #
113 ## II.3
114
115 [Setup table coll]
116 [Assert Delete operation and expect deletion of 1 rows, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
117 [Assert Delete operation and expect deletion of 2 rows, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
118 [Assert Delete operation and expect deletion of 6 rows, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
119
120 #
121 ## III.1
122
123 [Setup table coll]
124 [Assert Update operation and expect rows modified 1, executed with limit {row_count:1}]
125 [Assert Update operation and expect rows modified 2, executed with limit {row_count:2}]
126 [Assert Update operation and expect rows modified 9, executed with limit {row_count:100}]
127
128 #
129 ## III.2
130 [Assert Update operation and expect rows modified 1, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:1}}}]
131 [Assert Update operation and expect rows modified 2, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:2}}}]
132 [Assert Update operation and expect rows modified 9, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:100}}}]
133
134 #
135 ## III.3
136 [Assert Update operation and expect rows modified 1, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
137 [Assert Update operation and expect rows modified 2, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
138 [Assert Update operation and expect rows modified 9, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
139
140 #
141 ## IV.1
142 [Assert Find operation returns an error, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}} limit { row_count:1 }]
143 Got expected error: Invalid message, one of 'limit' and 'limit_expr' fields is allowed. Received both (code 5000)
144 [Assert Update operation returns an error, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}} limit { row_count:1 }]
145 Got expected error: Invalid message, one of 'limit' and 'limit_expr' fields is allowed. Received both (code 5000)
146 [Assert Delete operation returns an error, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}} limit { row_count:1 }]
147 Got expected error: Invalid message, one of 'limit' and 'limit_expr' fields is allowed. Received both (code 5000)
148
149 #
150 ## IV.2
151 [Assert Update operation returns an error, executed with limit { row_count:1 offset: 1 }]
152 Got expected error: Invalid parameter: non-zero offset value is not allowed for this operation (code 5012)
153 [Assert Delete operation returns an error, executed with limit { row_count:1 offset: 1 }]
154 Got expected error: Invalid parameter: non-zero offset value is not allowed for this operation (code 5012)
155
156 #
157 ## IV.3
158 [Assert Update operation returns an error, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:1}} offset{type:LITERAL literal {type:V_SINT v_signed_int:1}}}]
159 Got expected error: Invalid parameter: offset value is not allowed for this operation (code 5012)
160 [Assert Delete operation returns an error, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:1}} offset{type:LITERAL literal {type:V_SINT v_signed_int:1}}}]
161 Got expected error: Invalid parameter: offset value is not allowed for this operation (code 5012)
162 Mysqlx.Ok {
163 msg: "bye!"
164 }
165 ok
166 DROP DATABASE IF EXISTS xtest;
167
168 #
169 ## Test prepared execution of Crud messages with limit field
170 CREATE DATABASE xtest;
171
172 ## I. Validation of Crud.Find limits
173 #
174 # 1. Different setting in old limit field
175 # a. limit only to first row
176 # b. limit only to first two rows
177 # c. limit only to first hundred rows, still return all rows from collection
178 # d. limit only to last two rows
179 # e. limit only to last two rows, still the last one is out of resultset
180 # 2. Setting literals in limit_expr field
181 # a. limit only to first row
182 # b. limit only to first two rows
183 # c. limit only to first hundred rows, still return all rows from collection
184 # d. limit only to last two rows
185 # e. limit only to last two rows, still the last one is out of resultset
186 # 3. Setting placeholders in limit_expr field
187 # a. limit only to first row
188 # b. limit only to first two rows
189 # c. limit only to first hundred rows, still return all rows from collection
190 # d. limit only to last two rows
191 # e. limit only to last two rows, still the last one is out of resultset
192
193 ## II. Validation of Crud.Delete limits
194 #
195 # 1. Different setting in old limit field
196 # a. delete only first row
197 # b. delete only first two rows
198 # c. try to delete hundred rows, still only 6 delete (in collection)
199 # 2. Setting literals in limit_expr field
200 # a. delete only first row
201 # b. delete only first two rows
202 # c. try to delete hundred rows, still only 6 delete (in collection)
203 # 3. Setting placeholders in limit_expr field
204 # a. delete only first row
205 # b. delete only first two rows
206 # c. try to delete hundred rows, still only 6 delete (in collection)
207
208 ## III. Validation of Crud.Update limits
209 #
210 # 1. Different setting in old limit field
211 # a. delete only first row
212 # b. delete only first two rows
213 # c. try to delete hundred rows, still only 6 delete (in collection)
214 # 2. Setting literals in limit_expr field
215 # a. delete only first row
216 # b. delete only first two rows
217 # c. try to delete hundred rows, still only 6 delete (in collection)
218 # 3. Setting placeholders in limit_expr field
219 # a. delete only first row
220 # b. delete only first two rows
221 # c. try to delete hundred rows, still only 6 delete (in collection)
222
223 ## IV. Validation invalid configuration of Crud limits
224 #
225 # 1. 'limit' and 'limit_expr' were set
226 # a. in Crud.Find
227 # b. in Crud.Update
228 # d. in Crud.Delete
229 # 2. 'limit' uses 'offset' field when Crud doesn't support it
230 # a. in Crud.Update
231 # b. in Crud.Delete
232 # 2. 'limit_expr' uses 'offset' field when Crud doesn't support it
233 # a. in Crud.Update
234 # b. in Crud.Delete
235
236 #
237 ## I.1
238
239 [Setup table coll]
240 [Assert Find operation and expect 1 rows returned, executed with limit {row_count:1}]
241 [Assert Find operation and expect 2 rows returned, executed with limit {row_count:2}]
242 [Assert Find operation and expect 9 rows returned, executed with limit {row_count:100}]
243 [Assert Find operation and expect 2 rows returned, executed with limit {row_count:2 offset: 7}]
244 [Assert Find operation and expect 1 rows returned, executed with limit {row_count:2 offset: 8}]
245
246 #
247 ## I.2
248 [Assert Find operation and expect 1 rows returned, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:1}}}]
249 [Assert Find operation and expect 2 rows returned, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:2}}}]
250 [Assert Find operation and expect 9 rows returned, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:100}}}]
251 [Assert Find operation and expect 2 rows returned, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:2}} offset{type:LITERAL literal {type:V_SINT v_signed_int:7}}}]
252 [Assert Find operation and expect 1 rows returned, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:2}} offset{type:LITERAL literal {type:V_SINT v_signed_int:8}}}]
253
254 #
255 ## I.3
256 [Assert Find operation and expect 1 rows returned, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
257 [Assert Find operation and expect 2 rows returned, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
258 [Assert Find operation and expect 9 rows returned, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
259 [Assert Find operation and expect 2 rows returned, executed with limit_expr { row_count{ type:PLACEHOLDER position:0} offset{type:PLACEHOLDER position:1}}]
260 [Assert Find operation and expect 1 rows returned, executed with limit_expr { row_count{ type:PLACEHOLDER position:0} offset { type:PLACEHOLDER position:1}}]
261
262 #
263 ## II.1
264
265 [Setup table coll]
266 [Assert Delete operation and expect deletion of 1 rows, executed with limit {row_count:1}]
267 [Assert Delete operation and expect deletion of 2 rows, executed with limit {row_count:2}]
268 [Assert Delete operation and expect deletion of 6 rows, executed with limit {row_count:100}]
269
270 #
271 ## II.2
272
273 [Setup table coll]
274 [Assert Delete operation and expect deletion of 1 rows, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:1}}}]
275 [Assert Delete operation and expect deletion of 2 rows, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:2}}}]
276 [Assert Delete operation and expect deletion of 6 rows, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:100}}}]
277
278 #
279 ## II.3
280
281 [Setup table coll]
282 [Assert Delete operation and expect deletion of 1 rows, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
283 [Assert Delete operation and expect deletion of 2 rows, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
284 [Assert Delete operation and expect deletion of 6 rows, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
285
286 #
287 ## III.1
288
289 [Setup table coll]
290 [Assert Update operation and expect rows modified 1, executed with limit {row_count:1}]
291 [Assert Update operation and expect rows modified 2, executed with limit {row_count:2}]
292 [Assert Update operation and expect rows modified 9, executed with limit {row_count:100}]
293
294 #
295 ## III.2
296 [Assert Update operation and expect rows modified 1, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:1}}}]
297 [Assert Update operation and expect rows modified 2, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:2}}}]
298 [Assert Update operation and expect rows modified 9, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:100}}}]
299
300 #
301 ## III.3
302 [Assert Update operation and expect rows modified 1, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
303 [Assert Update operation and expect rows modified 2, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
304 [Assert Update operation and expect rows modified 9, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}}]
305
306 #
307 ## IV.1
308 [Assert Find operation returns an error, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}} limit { row_count:1 }]
309 Got expected error: Invalid message, one of 'limit' and 'limit_expr' fields is allowed. Received both (code 5000)
310 [Assert Update operation returns an error, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}} limit { row_count:1 }]
311 Got expected error: Invalid message, one of 'limit' and 'limit_expr' fields is allowed. Received both (code 5000)
312 [Assert Delete operation returns an error, executed with limit_expr { row_count{ type:PLACEHOLDER position:0}} limit { row_count:1 }]
313 Got expected error: Invalid message, one of 'limit' and 'limit_expr' fields is allowed. Received both (code 5000)
314
315 #
316 ## IV.2
317 [Assert Update operation returns an error, executed with limit { row_count:1 offset: 1 }]
318 Got expected error: Invalid parameter: non-zero offset value is not allowed for this operation (code 5012)
319 [Assert Delete operation returns an error, executed with limit { row_count:1 offset: 1 }]
320 Got expected error: Invalid parameter: non-zero offset value is not allowed for this operation (code 5012)
321
322 #
323 ## IV.3
324 [Assert Update operation returns an error, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:1}} offset{type:LITERAL literal {type:V_SINT v_signed_int:1}}}]
325 Got expected error: Invalid parameter: offset value is not allowed for this operation (code 5012)
326 [Assert Delete operation returns an error, executed with limit_expr {row_count{type:LITERAL literal {type:V_SINT v_signed_int:1}} offset{type:LITERAL literal {type:V_SINT v_signed_int:1}}}]
327 Got expected error: Invalid parameter: offset value is not allowed for this operation (code 5012)
328 Mysqlx.Ok {
329 msg: "bye!"
330 }
331 ok
332 DROP DATABASE IF EXISTS xtest;