Debian Codegraph @

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

raw
1 CREATE SCHEMA IF NOT EXISTS xtest;
2
3 command ok
4
5 1 rows affected
6
7 1 rows affected
8
9 1 rows affected
10
11 ## x. Prepare find with OP in [==, !=, <, <=, >, >=]
12 # a. Try to execute (no params)
13 # b. Execute with ...001
14 # c. Execute with ...002
15 # d. Execute with ...003
16 # e. Deallocate
17
18
19 Stmt 1: Prepare find with '? == _id'
20 ====================================
21 RUN recvok
22
23 Stmt 1.a. Try to execute (no params)
24 ====================================
25 Got expected error: There is no argument for statement placeholder at position: 0 (code 5134)
26
27 Stmt 1.b. Execute == with '0000XXXXXXXX0000000000000001'
28 ========================================================
29 doc
30 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
31 command ok
32
33 Stmt 1.b. Execute == with '0000XXXXXXXX0000000000000002'
34 ========================================================
35 doc
36 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
37 command ok
38
39 Stmt 1.b. Execute == with '0000XXXXXXXX0000000000000003'
40 ========================================================
41 doc
42 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
43 command ok
44
45 Stmt 1.d. Deallocate
46 ====================
47 RUN recvok
48
49 Stmt 1: Prepare find with '_id == ?'
50 ====================================
51 RUN recvok
52
53 Stmt 1.a. Try to execute (no params)
54 ====================================
55 Got expected error: There is no argument for statement placeholder at position: 0 (code 5134)
56
57 Stmt 1.b. Execute == with '0000XXXXXXXX0000000000000001'
58 ========================================================
59 doc
60 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
61 command ok
62
63 Stmt 1.b. Execute == with '0000XXXXXXXX0000000000000002'
64 ========================================================
65 doc
66 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
67 command ok
68
69 Stmt 1.b. Execute == with '0000XXXXXXXX0000000000000003'
70 ========================================================
71 doc
72 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
73 command ok
74
75 Stmt 1.d. Deallocate
76 ====================
77 RUN recvok
78
79 Stmt 2: Prepare find with '? != _id'
80 ====================================
81 RUN recvok
82
83 Stmt 2.a. Try to execute (no params)
84 ====================================
85 Got expected error: There is no argument for statement placeholder at position: 0 (code 5134)
86
87 Stmt 2.b. Execute != with '0000XXXXXXXX0000000000000001'
88 ========================================================
89 doc
90 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
91 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
92 command ok
93
94 Stmt 2.b. Execute != with '0000XXXXXXXX0000000000000002'
95 ========================================================
96 doc
97 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
98 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
99 command ok
100
101 Stmt 2.b. Execute != with '0000XXXXXXXX0000000000000003'
102 ========================================================
103 doc
104 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
105 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
106 command ok
107
108 Stmt 2.d. Deallocate
109 ====================
110 RUN recvok
111
112 Stmt 2: Prepare find with '_id != ?'
113 ====================================
114 RUN recvok
115
116 Stmt 2.a. Try to execute (no params)
117 ====================================
118 Got expected error: There is no argument for statement placeholder at position: 0 (code 5134)
119
120 Stmt 2.b. Execute != with '0000XXXXXXXX0000000000000001'
121 ========================================================
122 doc
123 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
124 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
125 command ok
126
127 Stmt 2.b. Execute != with '0000XXXXXXXX0000000000000002'
128 ========================================================
129 doc
130 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
131 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
132 command ok
133
134 Stmt 2.b. Execute != with '0000XXXXXXXX0000000000000003'
135 ========================================================
136 doc
137 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
138 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
139 command ok
140
141 Stmt 2.d. Deallocate
142 ====================
143 RUN recvok
144
145 Stmt 3: Prepare find with '? > _id'
146 ===================================
147 RUN recvok
148
149 Stmt 3.a. Try to execute (no params)
150 ====================================
151 Got expected error: There is no argument for statement placeholder at position: 0 (code 5134)
152
153 Stmt 3.b. Execute > with '0000XXXXXXXX0000000000000001'
154 =======================================================
155 doc
156 command ok
157
158 Stmt 3.b. Execute > with '0000XXXXXXXX0000000000000002'
159 =======================================================
160 doc
161 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
162 command ok
163
164 Stmt 3.b. Execute > with '0000XXXXXXXX0000000000000003'
165 =======================================================
166 doc
167 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
168 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
169 command ok
170
171 Stmt 3.d. Deallocate
172 ====================
173 RUN recvok
174
175 Stmt 3: Prepare find with '_id > ?'
176 ===================================
177 RUN recvok
178
179 Stmt 3.a. Try to execute (no params)
180 ====================================
181 Got expected error: There is no argument for statement placeholder at position: 0 (code 5134)
182
183 Stmt 3.b. Execute > with '0000XXXXXXXX0000000000000001'
184 =======================================================
185 doc
186 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
187 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
188 command ok
189
190 Stmt 3.b. Execute > with '0000XXXXXXXX0000000000000002'
191 =======================================================
192 doc
193 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
194 command ok
195
196 Stmt 3.b. Execute > with '0000XXXXXXXX0000000000000003'
197 =======================================================
198 doc
199 command ok
200
201 Stmt 3.d. Deallocate
202 ====================
203 RUN recvok
204
205 Stmt 4: Prepare find with '? >= _id'
206 ====================================
207 RUN recvok
208
209 Stmt 4.a. Try to execute (no params)
210 ====================================
211 Got expected error: There is no argument for statement placeholder at position: 0 (code 5134)
212
213 Stmt 4.b. Execute >= with '0000XXXXXXXX0000000000000001'
214 ========================================================
215 doc
216 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
217 command ok
218
219 Stmt 4.b. Execute >= with '0000XXXXXXXX0000000000000002'
220 ========================================================
221 doc
222 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
223 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
224 command ok
225
226 Stmt 4.b. Execute >= with '0000XXXXXXXX0000000000000003'
227 ========================================================
228 doc
229 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
230 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
231 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
232 command ok
233
234 Stmt 4.d. Deallocate
235 ====================
236 RUN recvok
237
238 Stmt 4: Prepare find with '_id >= ?'
239 ====================================
240 RUN recvok
241
242 Stmt 4.a. Try to execute (no params)
243 ====================================
244 Got expected error: There is no argument for statement placeholder at position: 0 (code 5134)
245
246 Stmt 4.b. Execute >= with '0000XXXXXXXX0000000000000001'
247 ========================================================
248 doc
249 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
250 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
251 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
252 command ok
253
254 Stmt 4.b. Execute >= with '0000XXXXXXXX0000000000000002'
255 ========================================================
256 doc
257 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
258 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
259 command ok
260
261 Stmt 4.b. Execute >= with '0000XXXXXXXX0000000000000003'
262 ========================================================
263 doc
264 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
265 command ok
266
267 Stmt 4.d. Deallocate
268 ====================
269 RUN recvok
270
271 Stmt 5: Prepare find with '? < _id'
272 ===================================
273 RUN recvok
274
275 Stmt 5.a. Try to execute (no params)
276 ====================================
277 Got expected error: There is no argument for statement placeholder at position: 0 (code 5134)
278
279 Stmt 5.b. Execute < with '0000XXXXXXXX0000000000000001'
280 =======================================================
281 doc
282 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
283 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
284 command ok
285
286 Stmt 5.b. Execute < with '0000XXXXXXXX0000000000000002'
287 =======================================================
288 doc
289 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
290 command ok
291
292 Stmt 5.b. Execute < with '0000XXXXXXXX0000000000000003'
293 =======================================================
294 doc
295 command ok
296
297 Stmt 5.d. Deallocate
298 ====================
299 RUN recvok
300
301 Stmt 5: Prepare find with '_id < ?'
302 ===================================
303 RUN recvok
304
305 Stmt 5.a. Try to execute (no params)
306 ====================================
307 Got expected error: There is no argument for statement placeholder at position: 0 (code 5134)
308
309 Stmt 5.b. Execute < with '0000XXXXXXXX0000000000000001'
310 =======================================================
311 doc
312 command ok
313
314 Stmt 5.b. Execute < with '0000XXXXXXXX0000000000000002'
315 =======================================================
316 doc
317 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
318 command ok
319
320 Stmt 5.b. Execute < with '0000XXXXXXXX0000000000000003'
321 =======================================================
322 doc
323 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
324 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
325 command ok
326
327 Stmt 5.d. Deallocate
328 ====================
329 RUN recvok
330
331 Stmt 6: Prepare find with '? <= _id'
332 ====================================
333 RUN recvok
334
335 Stmt 6.a. Try to execute (no params)
336 ====================================
337 Got expected error: There is no argument for statement placeholder at position: 0 (code 5134)
338
339 Stmt 6.b. Execute <= with '0000XXXXXXXX0000000000000001'
340 ========================================================
341 doc
342 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
343 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
344 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
345 command ok
346
347 Stmt 6.b. Execute <= with '0000XXXXXXXX0000000000000002'
348 ========================================================
349 doc
350 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
351 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
352 command ok
353
354 Stmt 6.b. Execute <= with '0000XXXXXXXX0000000000000003'
355 ========================================================
356 doc
357 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
358 command ok
359
360 Stmt 6.d. Deallocate
361 ====================
362 RUN recvok
363
364 Stmt 6: Prepare find with '_id <= ?'
365 ====================================
366 RUN recvok
367
368 Stmt 6.a. Try to execute (no params)
369 ====================================
370 Got expected error: There is no argument for statement placeholder at position: 0 (code 5134)
371
372 Stmt 6.b. Execute <= with '0000XXXXXXXX0000000000000001'
373 ========================================================
374 doc
375 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
376 command ok
377
378 Stmt 6.b. Execute <= with '0000XXXXXXXX0000000000000002'
379 ========================================================
380 doc
381 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
382 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
383 command ok
384
385 Stmt 6.b. Execute <= with '0000XXXXXXXX0000000000000003'
386 ========================================================
387 doc
388 {"_id": "0000XXXXXXXX0000000000000001", "name": "foo"}
389 {"_id": "0000XXXXXXXX0000000000000002", "name": "bar"}
390 {"_id": "0000XXXXXXXX0000000000000003", "name": "buz"}
391 command ok
392
393 Stmt 6.d. Deallocate
394 ====================
395 RUN recvok
396 Mysqlx.Ok {
397 msg: "bye!"
398 }
399 ok
400 SET @id1 = '0000616daea30000000000000001',
401 @id2 = '0000616daea30000000000000002',
402 @id3 = '0000616daea30000000000000003';
403 PREPARE s1 FROM "SELECT doc FROM xtest.expr WHERE JSON_UNQUOTE(JSON_EXTRACT(doc, '$._id')) = ?";
404 EXECUTE s1 using @id1;
405 doc
406 {"_id": "0000616daea30000000000000001", "name": "foo"}
407 EXECUTE s1 using @id2;
408 doc
409 {"_id": "0000616daea30000000000000002", "name": "bar"}
410 EXECUTE s1 using @id3;
411 doc
412 {"_id": "0000616daea30000000000000003", "name": "buz"}
413 DEALLOCATE PREPARE s1;
414 PREPARE s1 FROM "SELECT doc FROM xtest.expr WHERE JSON_UNQUOTE(JSON_EXTRACT(doc, '$._id')) != ?";
415 EXECUTE s1 using @id1;
416 doc
417 {"_id": "0000616daea30000000000000002", "name": "bar"}
418 {"_id": "0000616daea30000000000000003", "name": "buz"}
419 EXECUTE s1 using @id2;
420 doc
421 {"_id": "0000616daea30000000000000001", "name": "foo"}
422 {"_id": "0000616daea30000000000000003", "name": "buz"}
423 EXECUTE s1 using @id3;
424 doc
425 {"_id": "0000616daea30000000000000001", "name": "foo"}
426 {"_id": "0000616daea30000000000000002", "name": "bar"}
427 DEALLOCATE PREPARE s1;
428 PREPARE s1 FROM "SELECT doc FROM xtest.expr WHERE JSON_UNQUOTE(JSON_EXTRACT(doc, '$._id')) > ?";
429 EXECUTE s1 using @id1;
430 doc
431 {"_id": "0000616daea30000000000000002", "name": "bar"}
432 {"_id": "0000616daea30000000000000003", "name": "buz"}
433 EXECUTE s1 using @id2;
434 doc
435 {"_id": "0000616daea30000000000000003", "name": "buz"}
436 EXECUTE s1 using @id3;
437 doc
438 DEALLOCATE PREPARE s1;
439 PREPARE s1 FROM "SELECT doc FROM xtest.expr WHERE JSON_UNQUOTE(JSON_EXTRACT(doc, '$._id')) >= ?";
440 EXECUTE s1 using @id1;
441 doc
442 {"_id": "0000616daea30000000000000001", "name": "foo"}
443 {"_id": "0000616daea30000000000000002", "name": "bar"}
444 {"_id": "0000616daea30000000000000003", "name": "buz"}
445 EXECUTE s1 using @id2;
446 doc
447 {"_id": "0000616daea30000000000000002", "name": "bar"}
448 {"_id": "0000616daea30000000000000003", "name": "buz"}
449 EXECUTE s1 using @id3;
450 doc
451 {"_id": "0000616daea30000000000000003", "name": "buz"}
452 DEALLOCATE PREPARE s1;
453 PREPARE s1 FROM "SELECT doc FROM xtest.expr WHERE JSON_UNQUOTE(JSON_EXTRACT(doc, '$._id')) < ?";
454 EXECUTE s1 using @id1;
455 doc
456 EXECUTE s1 using @id2;
457 doc
458 {"_id": "0000616daea30000000000000001", "name": "foo"}
459 EXECUTE s1 using @id3;
460 doc
461 {"_id": "0000616daea30000000000000001", "name": "foo"}
462 {"_id": "0000616daea30000000000000002", "name": "bar"}
463 DEALLOCATE PREPARE s1;
464 PREPARE s1 FROM "SELECT doc FROM xtest.expr WHERE JSON_UNQUOTE(JSON_EXTRACT(doc, '$._id')) <= ?";
465 EXECUTE s1 using @id1;
466 doc
467 {"_id": "0000616daea30000000000000001", "name": "foo"}
468 EXECUTE s1 using @id2;
469 doc
470 {"_id": "0000616daea30000000000000001", "name": "foo"}
471 {"_id": "0000616daea30000000000000002", "name": "bar"}
472 EXECUTE s1 using @id3;
473 doc
474 {"_id": "0000616daea30000000000000001", "name": "foo"}
475 {"_id": "0000616daea30000000000000002", "name": "bar"}
476 {"_id": "0000616daea30000000000000003", "name": "buz"}
477 DEALLOCATE PREPARE s1;