Debian Codegraph @

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

raw
1 CREATE SCHEMA IF NOT EXISTS xtest;
2 USE xtest;
3
4
5 ## I. Check command flow when using a modify_collection_options admin
6 ## command.
7 #
8 # 1. Modify existing schema with other valid schema.
9 # 2. Modify existing schema with schema that does not match to existing
10 # collection content.
11
12 #
13 # I.1
14 send Mysqlx.Sql.StmtExecute {
15 stmt: "create_collection"
16 args {
17 type: OBJECT
18 obj {
19 fld {
20 key: "schema"
21 value {
22 type: SCALAR
23 scalar {
24 type: V_STRING
25 v_string {
26 value: "xtest"
27 }
28 }
29 }
30 }
31 fld {
32 key: "name"
33 value {
34 type: SCALAR
35 scalar {
36 type: V_STRING
37 v_string {
38 value: "test_coll"
39 }
40 }
41 }
42 }
43 fld {
44 key: "options"
45 value {
46 type: OBJECT
47 obj {
48 fld {
49 key: "validation"
50 value {
51 type: OBJECT
52 obj {
53 fld {
54 key: "schema"
55 value {
56 type: SCALAR
57 scalar {
58 type: V_STRING
59 v_string {
60 value: "{\"type\": \"object\", \"properties\": {\"latitude\": {\"type\": \"number\", \"minimum\": -90, \"maximum\": 90}}, \"required\": [\"latitude\"]}"
61 }
62 }
63 }
64 }
65 fld {
66 key: "level"
67 value {
68 type: SCALAR
69 scalar {
70 type: V_STRING
71 v_string {
72 value: "strict"
73 }
74 }
75 }
76 }
77 }
78 }
79 }
80 }
81 }
82 }
83 }
84 }
85 namespace: "mysqlx"
86 }
87
88 [ASSERT Mysqlx.Sql.StmtExecuteOk]
89 send Mysqlx.Crud.Insert {
90 collection {
91 name: "test_coll"
92 schema: "xtest"
93 }
94 data_model: DOCUMENT
95 row {
96 field {
97 type: LITERAL
98 literal {
99 type: V_STRING
100 v_string {
101 value: "{\"_id\": \"one\", \"latitude\": 82}"
102 }
103 }
104 }
105 }
106 }
107
108 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
109 [ASSERT Mysqlx.Sql.StmtExecuteOk]
110 send Mysqlx.Crud.Insert {
111 collection {
112 name: "test_coll"
113 schema: "xtest"
114 }
115 data_model: DOCUMENT
116 row {
117 field {
118 type: LITERAL
119 literal {
120 type: V_STRING
121 v_string {
122 value: "{\"_id\": \"two\", \"latitude\": 49}"
123 }
124 }
125 }
126 }
127 }
128
129 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
130 [ASSERT Mysqlx.Sql.StmtExecuteOk]
131 send Mysqlx.Sql.StmtExecute {
132 stmt: "modify_collection_options"
133 args {
134 type: OBJECT
135 obj {
136 fld {
137 key: "schema"
138 value {
139 type: SCALAR
140 scalar {
141 type: V_STRING
142 v_string {
143 value: "xtest"
144 }
145 }
146 }
147 }
148 fld {
149 key: "name"
150 value {
151 type: SCALAR
152 scalar {
153 type: V_STRING
154 v_string {
155 value: "test_coll"
156 }
157 }
158 }
159 }
160 fld {
161 key: "options"
162 value {
163 type: OBJECT
164 obj {
165 fld {
166 key: "validation"
167 value {
168 type: OBJECT
169 obj {
170 fld {
171 key: "schema"
172 value {
173 type: SCALAR
174 scalar {
175 type: V_STRING
176 v_string {
177 value: "{\"type\": \"object\", \"properties\": {\"latitude\": {\"type\": \"number\", \"minimum\": -90, \"maximum\": 100}}, \"required\": [\"latitude\"]}"
178 }
179 }
180 }
181 }
182 fld {
183 key: "level"
184 value {
185 type: SCALAR
186 scalar {
187 type: V_STRING
188 v_string {
189 value: "strict"
190 }
191 }
192 }
193 }
194 }
195 }
196 }
197 }
198 }
199 }
200 }
201 }
202 namespace: "mysqlx"
203 }
204
205 [ASSERT Mysqlx.Sql.StmtExecuteOk]
206 RUN DROP TABLE IF EXISTS xtest.test_coll
207
208 0 rows affected
209
210 #
211 # I.2
212 send Mysqlx.Sql.StmtExecute {
213 stmt: "create_collection"
214 args {
215 type: OBJECT
216 obj {
217 fld {
218 key: "schema"
219 value {
220 type: SCALAR
221 scalar {
222 type: V_STRING
223 v_string {
224 value: "xtest"
225 }
226 }
227 }
228 }
229 fld {
230 key: "name"
231 value {
232 type: SCALAR
233 scalar {
234 type: V_STRING
235 v_string {
236 value: "test_coll"
237 }
238 }
239 }
240 }
241 fld {
242 key: "options"
243 value {
244 type: OBJECT
245 obj {
246 fld {
247 key: "validation"
248 value {
249 type: OBJECT
250 obj {
251 fld {
252 key: "schema"
253 value {
254 type: SCALAR
255 scalar {
256 type: V_STRING
257 v_string {
258 value: "{\"type\": \"object\", \"properties\": {\"latitude\": {\"type\": \"number\", \"minimum\": -90, \"maximum\": 90}}, \"required\": [\"latitude\"]}"
259 }
260 }
261 }
262 }
263 fld {
264 key: "level"
265 value {
266 type: SCALAR
267 scalar {
268 type: V_STRING
269 v_string {
270 value: "strict"
271 }
272 }
273 }
274 }
275 }
276 }
277 }
278 }
279 }
280 }
281 }
282 }
283 namespace: "mysqlx"
284 }
285
286 [ASSERT Mysqlx.Sql.StmtExecuteOk]
287 send Mysqlx.Crud.Insert {
288 collection {
289 name: "test_coll"
290 schema: "xtest"
291 }
292 data_model: DOCUMENT
293 row {
294 field {
295 type: LITERAL
296 literal {
297 type: V_STRING
298 v_string {
299 value: "{\"_id\": \"one\", \"latitude\": 82}"
300 }
301 }
302 }
303 }
304 }
305
306 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
307 [ASSERT Mysqlx.Sql.StmtExecuteOk]
308 send Mysqlx.Crud.Insert {
309 collection {
310 name: "test_coll"
311 schema: "xtest"
312 }
313 data_model: DOCUMENT
314 row {
315 field {
316 type: LITERAL
317 literal {
318 type: V_STRING
319 v_string {
320 value: "{\"_id\": \"two\", \"latitude\": 49}"
321 }
322 }
323 }
324 }
325 }
326
327 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
328 [ASSERT Mysqlx.Sql.StmtExecuteOk]
329 send Mysqlx.Sql.StmtExecute {
330 stmt: "modify_collection_options"
331 args {
332 type: OBJECT
333 obj {
334 fld {
335 key: "schema"
336 value {
337 type: SCALAR
338 scalar {
339 type: V_STRING
340 v_string {
341 value: "xtest"
342 }
343 }
344 }
345 }
346 fld {
347 key: "name"
348 value {
349 type: SCALAR
350 scalar {
351 type: V_STRING
352 v_string {
353 value: "test_coll"
354 }
355 }
356 }
357 }
358 fld {
359 key: "options"
360 value {
361 type: OBJECT
362 obj {
363 fld {
364 key: "validation"
365 value {
366 type: OBJECT
367 obj {
368 fld {
369 key: "schema"
370 value {
371 type: SCALAR
372 scalar {
373 type: V_STRING
374 v_string {
375 value: "{\"type\": \"object\", \"properties\": {\"latitude\": {\"type\": \"number\", \"minimum\": -90, \"maximum\": 50}}, \"required\": [\"latitude\"]}"
376 }
377 }
378 }
379 }
380 fld {
381 key: "level"
382 value {
383 type: SCALAR
384 scalar {
385 type: V_STRING
386 v_string {
387 value: "strict"
388 }
389 }
390 }
391 }
392 }
393 }
394 }
395 }
396 }
397 }
398 }
399 }
400 namespace: "mysqlx"
401 }
402
403 [ASSERT Mysqlx.Error]
404 RUN DROP TABLE IF EXISTS xtest.test_coll
405
406 0 rows affected
407 Mysqlx.Ok {
408 msg: "bye!"
409 }
410 ok