Debian Codegraph @

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

raw
1 RUN DROP SCHEMA IF EXISTS xtest
2
3 0 rows affected
4 RUN CREATE SCHEMA xtest
5
6 1 rows affected
7 RUN CREATE TABLE xtest.xtable (xfield JSON)
8
9 0 rows affected
10 RUN TRUNCATE TABLE xtest.xtable
11
12 0 rows affected
13 RUN INSERT INTO xtest.xtable VALUES('{"first":1.0, "second": "two"}')
14
15 1 rows affected
16 RUN SELECT * FROM xtest.xtable
17 xfield
18 {"first": 1.0, "second": "two"}
19 0 rows affected
20 send Mysqlx.Crud.Update {
21 collection {
22 name: "xtable"
23 schema: "xtest"
24 }
25 data_model: TABLE
26 operation {
27 source {
28 name: "xfield"
29 }
30 operation: SET
31 value {
32 type: LITERAL
33 literal {
34 type: V_OCTETS
35 v_octets {
36 value: "{\"first\":1.1, \"second\": \"two.1\"}"
37 }
38 }
39 }
40 }
41 }
42
43
44 1 rows affected
45 Rows matched: 1 Changed: 1 Warnings: 0
46 RUN SELECT * FROM xtest.xtable
47 xfield
48 {"first": 1.1, "second": "two.1"}
49 0 rows affected
50 RUN TRUNCATE TABLE xtest.xtable
51
52 0 rows affected
53 RUN INSERT INTO xtest.xtable VALUES('{"first":1.0, "second": "two"}')
54
55 1 rows affected
56 RUN SELECT * FROM xtest.xtable
57 xfield
58 {"first": 1.0, "second": "two"}
59 0 rows affected
60 send Mysqlx.Crud.Update {
61 collection {
62 name: "xtable"
63 schema: "xtest"
64 }
65 data_model: TABLE
66 operation {
67 source {
68 document_path {
69 type: MEMBER
70 value: "first"
71 }
72 name: "xfield"
73 }
74 operation: ITEM_SET
75 value {
76 type: LITERAL
77 literal {
78 type: V_DOUBLE
79 v_double: 1.1
80 }
81 }
82 }
83 operation {
84 source {
85 document_path {
86 type: MEMBER
87 value: "second"
88 }
89 name: "xfield"
90 }
91 operation: ITEM_SET
92 value {
93 type: LITERAL
94 literal {
95 type: V_OCTETS
96 v_octets {
97 value: "two.1"
98 }
99 }
100 }
101 }
102 operation {
103 source {
104 document_path {
105 type: MEMBER
106 value: "third"
107 }
108 name: "xfield"
109 }
110 operation: ITEM_SET
111 value {
112 type: LITERAL
113 literal {
114 type: V_DOUBLE
115 v_double: 3.1
116 }
117 }
118 }
119 }
120
121
122 1 rows affected
123 Rows matched: 1 Changed: 1 Warnings: 0
124 RUN SELECT * FROM xtest.xtable
125 xfield
126 {"first": 1.1, "third": 3.1, "second": "two.1"}
127 0 rows affected
128 RUN TRUNCATE TABLE xtest.xtable
129
130 0 rows affected
131 RUN INSERT INTO xtest.xtable VALUES('{"first":1.0, "second": "two"}')
132
133 1 rows affected
134 RUN SELECT * FROM xtest.xtable
135 xfield
136 {"first": 1.0, "second": "two"}
137 0 rows affected
138 send Mysqlx.Crud.Update {
139 collection {
140 name: "xtable"
141 schema: "xtest"
142 }
143 data_model: TABLE
144 operation {
145 source {
146 document_path {
147 type: MEMBER
148 value: "first"
149 }
150 name: "xfield"
151 }
152 operation: ITEM_REMOVE
153 }
154 }
155
156
157 1 rows affected
158 Rows matched: 1 Changed: 1 Warnings: 0
159 RUN SELECT * FROM xtest.xtable
160 xfield
161 {"second": "two"}
162 0 rows affected
163 RUN TRUNCATE TABLE xtest.xtable
164
165 0 rows affected
166 RUN INSERT INTO xtest.xtable VALUES('{"first":1.0, "second": "two"}')
167
168 1 rows affected
169 RUN SELECT * FROM xtest.xtable
170 xfield
171 {"first": 1.0, "second": "two"}
172 0 rows affected
173 send Mysqlx.Crud.Update {
174 collection {
175 name: "xtable"
176 schema: "xtest"
177 }
178 data_model: TABLE
179 operation {
180 source {
181 document_path {
182 type: MEMBER
183 value: "first"
184 }
185 name: "xfield"
186 }
187 operation: ITEM_REPLACE
188 value {
189 type: LITERAL
190 literal {
191 type: V_DOUBLE
192 v_double: 1.1
193 }
194 }
195 }
196 operation {
197 source {
198 document_path {
199 type: MEMBER
200 value: "third"
201 }
202 name: "xfield"
203 }
204 operation: ITEM_REPLACE
205 value {
206 type: LITERAL
207 literal {
208 type: V_OCTETS
209 v_octets {
210 value: "three.1"
211 }
212 }
213 }
214 }
215 }
216
217
218 1 rows affected
219 Rows matched: 1 Changed: 1 Warnings: 0
220 RUN SELECT * FROM xtest.xtable
221 xfield
222 {"first": 1.1, "second": "two"}
223 0 rows affected
224 RUN TRUNCATE TABLE xtest.xtable
225
226 0 rows affected
227 RUN INSERT INTO xtest.xtable VALUES('{"first":1.0, "second": "two"}')
228
229 1 rows affected
230 RUN SELECT * FROM xtest.xtable
231 xfield
232 {"first": 1.0, "second": "two"}
233 0 rows affected
234 send Mysqlx.Crud.Update {
235 collection {
236 name: "xtable"
237 schema: "xtest"
238 }
239 data_model: TABLE
240 operation {
241 source {
242 name: "xfield"
243 }
244 operation: ITEM_MERGE
245 value {
246 type: LITERAL
247 literal {
248 type: V_OCTETS
249 v_octets {
250 value: "{\"third\":3.0, \"fourth\": \"four\"}"
251 }
252 }
253 }
254 }
255 }
256
257
258 1 rows affected
259 Rows matched: 1 Changed: 1 Warnings: 0
260 RUN SELECT * FROM xtest.xtable
261 xfield
262 {"first": 1.0, "third": 3.0, "fourth": "four", "second": "two"}
263 0 rows affected
264 RUN TRUNCATE TABLE xtest.xtable
265
266 0 rows affected
267 RUN INSERT INTO xtest.xtable VALUES('{"first":1.0, "second": ["two"]}')
268
269 1 rows affected
270 RUN SELECT * FROM xtest.xtable
271 xfield
272 {"first": 1.0, "second": ["two"]}
273 0 rows affected
274 send Mysqlx.Crud.Update {
275 collection {
276 name: "xtable"
277 schema: "xtest"
278 }
279 data_model: TABLE
280 operation {
281 source {
282 document_path {
283 type: MEMBER
284 value: "second"
285 }
286 document_path {
287 type: ARRAY_INDEX
288 index: 0
289 }
290 name: "xfield"
291 }
292 operation: ARRAY_INSERT
293 value {
294 type: LITERAL
295 literal {
296 type: V_OCTETS
297 v_octets {
298 value: "two.1"
299 }
300 }
301 }
302 }
303 }
304
305
306 1 rows affected
307 Rows matched: 1 Changed: 1 Warnings: 0
308 RUN SELECT * FROM xtest.xtable
309 xfield
310 {"first": 1.0, "second": ["two.1", "two"]}
311 0 rows affected
312 RUN TRUNCATE TABLE xtest.xtable
313
314 0 rows affected
315 RUN INSERT INTO xtest.xtable VALUES('{"first":1.0, "second": "two"}')
316
317 1 rows affected
318 RUN SELECT * FROM xtest.xtable
319 xfield
320 {"first": 1.0, "second": "two"}
321 0 rows affected
322 send Mysqlx.Crud.Update {
323 collection {
324 name: "xtable"
325 schema: "xtest"
326 }
327 data_model: TABLE
328 operation {
329 source {
330 document_path {
331 type: MEMBER
332 value: "second"
333 }
334 name: "xfield"
335 }
336 operation: ARRAY_APPEND
337 value {
338 type: LITERAL
339 literal {
340 type: V_OCTETS
341 v_octets {
342 value: "two.1"
343 }
344 }
345 }
346 }
347 }
348
349
350 1 rows affected
351 Rows matched: 1 Changed: 1 Warnings: 0
352 RUN SELECT * FROM xtest.xtable
353 xfield
354 {"first": 1.0, "second": ["two", "two.1"]}
355 0 rows affected
356 RUN TRUNCATE TABLE xtest.xtable
357
358 0 rows affected
359 RUN INSERT INTO xtest.xtable VALUES('{"first":1.0, "second": "two"}')
360
361 1 rows affected
362 RUN SELECT * FROM xtest.xtable
363 xfield
364 {"first": 1.0, "second": "two"}
365 0 rows affected
366 send Mysqlx.Crud.Update {
367 collection {
368 name: "xtable"
369 schema: "xtest"
370 }
371 data_model: TABLE
372 operation {
373 source {
374 document_path {
375 type: MEMBER
376 value: "second"
377 }
378 name: "xfield"
379 }
380 operation: SET
381 value {
382 type: LITERAL
383 literal {
384 type: V_OCTETS
385 v_octets {
386 value: "{\"first\":1.1}"
387 }
388 }
389 }
390 }
391 }
392
393 Got expected error: Invalid column name to update (code 5052)
394 send Mysqlx.Crud.Update {
395 collection {
396 name: "xtable"
397 schema: "xtest"
398 }
399 data_model: TABLE
400 operation {
401 source {
402 name: ""
403 }
404 operation: SET
405 value {
406 type: LITERAL
407 literal {
408 type: V_OCTETS
409 v_octets {
410 value: "{\"first\":1.1}"
411 }
412 }
413 }
414 }
415 }
416
417 Got expected error: Invalid column name to update (code 5052)
418 send Mysqlx.Crud.Update {
419 collection {
420 name: "xtable"
421 schema: "xtest"
422 }
423 data_model: TABLE
424 operation {
425 source {
426 name: "xfield"
427 }
428 operation: ITEM_SET
429 value {
430 type: LITERAL
431 literal {
432 type: V_DOUBLE
433 v_double: 1.1
434 }
435 }
436 }
437 }
438
439 Got expected error: Invalid member location (code 5053)
440 send Mysqlx.Crud.Update {
441 collection {
442 name: "xtable"
443 schema: "xtest"
444 }
445 data_model: TABLE
446 operation {
447 source {
448 name: "xfield"
449 }
450 operation: ITEM_REMOVE
451 }
452 }
453
454 Got expected error: Invalid member location (code 5053)
455 send Mysqlx.Crud.Update {
456 collection {
457 name: "xtable"
458 schema: "xtest"
459 }
460 data_model: TABLE
461 operation {
462 source {
463 name: "xfield"
464 }
465 operation: ITEM_REPLACE
466 value {
467 type: LITERAL
468 literal {
469 type: V_DOUBLE
470 v_double: 1.1
471 }
472 }
473 }
474 }
475
476 Got expected error: Invalid member location (code 5053)
477 send Mysqlx.Crud.Update {
478 collection {
479 name: "xtable"
480 schema: "xtest"
481 }
482 data_model: TABLE
483 operation {
484 source {
485 name: "xfield"
486 }
487 operation: ARRAY_INSERT
488 value {
489 type: LITERAL
490 literal {
491 type: V_DOUBLE
492 v_double: 1.1
493 }
494 }
495 }
496 }
497
498 Got expected error: Invalid member location (code 5053)
499 send Mysqlx.Crud.Update {
500 collection {
501 name: "xtable"
502 schema: "xtest"
503 }
504 data_model: TABLE
505 operation {
506 source {
507 name: "xfield"
508 }
509 operation: ARRAY_APPEND
510 value {
511 type: LITERAL
512 literal {
513 type: V_DOUBLE
514 v_double: 1.1
515 }
516 }
517 }
518 }
519
520 Got expected error: Invalid member location (code 5053)
521 RUN DROP SCHEMA IF EXISTS xtest
522
523 1 rows affected
524 Mysqlx.Ok {
525 msg: "bye!"
526 }
527 ok