Debian Codegraph @

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

raw
1 RUN DROP SCHEMA if EXISTS dbmysqlxplugintest
2
3 0 rows affected
4 RUN CREATE SCHEMA dbmysqlxplugintest DEFAULT CHARSET='utf8'
5
6 1 rows affected
7 RUN USE dbmysqlxplugintest
8
9 0 rows affected
10 RUN CREATE TABLE Categories (
11 CategoryID int NOT NULL AUTO_INCREMENT,
12 CategoryName varchar(100),
13 CategoryDescription varchar(200),
14 CategoryIMEI tinyint,
15 CategoryDecimal decimal(5,2),
16 PRIMARY key (CategoryID)
17 )
18
19 0 rows affected
20 RUN INSERT INTO Categories(CategoryID, CategoryName, CategoryDescription, CategoryIMEI, CategoryDecimal)
21 VALUES
22 (1,'Sports','Sports related category',1,235.15),
23 (2,'Entertaiment','Entertaiment related category',2,235.15),
24 (3, 'Home','Home related category',3,235.15),
25 (4, 'Kitchen','Kitchen related category',4,235.15),
26 (5, 'Garden','Garden related category',5,535.15),
27 (6, 'Toys','Toys related category',6,635.15)
28
29 6 rows affected
30 last insert id: 6
31 Records: 6 Duplicates: 0 Warnings: 0
32 RUN CREATE TABLE ExtraCategoryInfo (
33 ExtraCategoryInfoID int NOT NULL AUTO_INCREMENT,
34 CategoryID int NOT NULL,
35 MainParentCategoryName varchar(100),
36 PRIMARY key (ExtraCategoryInfoID)
37 )
38
39 0 rows affected
40 RUN INSERT INTO ExtraCategoryInfo(ExtraCategoryInfoID, CategoryID, MainParentCategoryName)
41 VALUES
42 (1,1,'People'),
43 (2,2,'People'),
44 (3,2,'House'),
45 (4,3,'House'),
46 (5,1,'People'),
47 (6,2,'People'),
48 (7,2,'House'),
49 (8,3,'House'),
50 (9,1,'People'),
51 (10,2,'House')
52
53 10 rows affected
54 last insert id: 10
55 Records: 10 Duplicates: 0 Warnings: 0
56 RUN SELECT * FROM dbmysqlxplugintest.ExtraCategoryInfo
57 ExtraCategoryInfoID CategoryID MainParentCategoryName
58 1 1 People
59 2 2 People
60 3 2 House
61 4 3 House
62 5 1 People
63 6 2 People
64 7 2 House
65 8 3 House
66 9 1 People
67 10 2 House
68 0 rows affected
69 Delete with In, && operators
70 send Mysqlx.Crud.Delete {
71 collection {
72 name: "ExtraCategoryInfo"
73 schema: "dbmysqlxplugintest"
74 }
75 data_model: TABLE
76 criteria {
77 type: OPERATOR
78 operator {
79 name: "&&"
80 param {
81 type: OPERATOR
82 operator {
83 name: "in"
84 param {
85 type: IDENT
86 identifier {
87 name: "ExtraCategoryInfoID"
88 }
89 }
90 param {
91 type: LITERAL
92 literal {
93 type: V_SINT
94 v_signed_int: 1
95 }
96 }
97 param {
98 type: LITERAL
99 literal {
100 type: V_SINT
101 v_signed_int: 3
102 }
103 }
104 }
105 }
106 param {
107 type: OPERATOR
108 operator {
109 name: "=="
110 param {
111 type: IDENT
112 identifier {
113 name: "CategoryID"
114 }
115 }
116 param {
117 type: LITERAL
118 literal {
119 type: V_SINT
120 v_signed_int: 2
121 }
122 }
123 }
124 }
125 }
126 }
127 }
128
129
130 1 rows affected
131 RUN SELECT * FROM dbmysqlxplugintest.ExtraCategoryInfo
132 ExtraCategoryInfoID CategoryID MainParentCategoryName
133 1 1 People
134 2 2 People
135 4 3 House
136 5 1 People
137 6 2 People
138 7 2 House
139 8 3 House
140 9 1 People
141 10 2 House
142 0 rows affected
143 RUN START TRANSACTION
144
145 0 rows affected
146 Delete with == operator and rollback operation
147 send Mysqlx.Crud.Delete {
148 collection {
149 name: "ExtraCategoryInfo"
150 schema: "dbmysqlxplugintest"
151 }
152 data_model: TABLE
153 criteria {
154 type: OPERATOR
155 operator {
156 name: "=="
157 param {
158 type: IDENT
159 identifier {
160 name: "ExtraCategoryInfoID"
161 }
162 }
163 param {
164 type: LITERAL
165 literal {
166 type: V_SINT
167 v_signed_int: 1
168 }
169 }
170 }
171 }
172 }
173
174
175 1 rows affected
176 RUN SELECT * FROM dbmysqlxplugintest.ExtraCategoryInfo
177 ExtraCategoryInfoID CategoryID MainParentCategoryName
178 2 2 People
179 4 3 House
180 5 1 People
181 6 2 People
182 7 2 House
183 8 3 House
184 9 1 People
185 10 2 House
186 0 rows affected
187 RUN ROLLBACK
188
189 0 rows affected
190 RUN SELECT * FROM dbmysqlxplugintest.ExtraCategoryInfo
191 ExtraCategoryInfoID CategoryID MainParentCategoryName
192 1 1 People
193 2 2 People
194 4 3 House
195 5 1 People
196 6 2 People
197 7 2 House
198 8 3 House
199 9 1 People
200 10 2 House
201 0 rows affected
202 RUN START TRANSACTION
203
204 0 rows affected
205 Delete with == operator and commit
206 send Mysqlx.Crud.Delete {
207 collection {
208 name: "ExtraCategoryInfo"
209 schema: "dbmysqlxplugintest"
210 }
211 data_model: TABLE
212 criteria {
213 type: OPERATOR
214 operator {
215 name: "=="
216 param {
217 type: IDENT
218 identifier {
219 name: "ExtraCategoryInfoID"
220 }
221 }
222 param {
223 type: LITERAL
224 literal {
225 type: V_SINT
226 v_signed_int: 1
227 }
228 }
229 }
230 }
231 }
232
233
234 1 rows affected
235 RUN COMMIT
236
237 0 rows affected
238 RUN SELECT * FROM dbmysqlxplugintest.ExtraCategoryInfo
239 ExtraCategoryInfoID CategoryID MainParentCategoryName
240 2 2 People
241 4 3 House
242 5 1 People
243 6 2 People
244 7 2 House
245 8 3 House
246 9 1 People
247 10 2 House
248 0 rows affected
249 Mysqlx.Ok {
250 msg: "bye!"
251 }
252 ok
253 RUN USE dbmysqlxplugintest
254
255 0 rows affected
256 RUN SELECT * FROM dbmysqlxplugintest.ExtraCategoryInfo
257 ExtraCategoryInfoID CategoryID MainParentCategoryName
258 2 2 People
259 4 3 House
260 5 1 People
261 6 2 People
262 7 2 House
263 8 3 House
264 9 1 People
265 10 2 House
266 0 rows affected
267 Use delete with limit and order parameters
268 send Mysqlx.Crud.Delete {
269 collection {
270 name: "ExtraCategoryInfo"
271 schema: "dbmysqlxplugintest"
272 }
273 data_model: DOCUMENT
274 limit {
275 row_count: 2
276 offset: 5
277 }
278 }
279
280 Mysqlx.Error {
281 severity: ERROR
282 code: 5012
283 msg: "Invalid parameter: non-zero offset value is not allowed for this operation"
284 sql_state: "HY000"
285 }
286
287 RUN SELECT * FROM dbmysqlxplugintest.ExtraCategoryInfo
288 ExtraCategoryInfoID CategoryID MainParentCategoryName
289 2 2 People
290 4 3 House
291 5 1 People
292 6 2 People
293 7 2 House
294 8 3 House
295 9 1 People
296 10 2 House
297 0 rows affected
298 Use delete with limit 0 and order parameters
299 send Mysqlx.Crud.Delete {
300 collection {
301 name: "ExtraCategoryInfo"
302 schema: "dbmysqlxplugintest"
303 }
304 data_model: DOCUMENT
305 limit {
306 row_count: 0
307 offset: 0
308 }
309 }
310
311
312 0 rows affected
313 Mysqlx.Ok {
314 msg: "bye!"
315 }
316 ok
317 RUN USE dbmysqlxplugintest
318
319 0 rows affected
320 RUN SELECT * FROM dbmysqlxplugintest.ExtraCategoryInfo
321 ExtraCategoryInfoID CategoryID MainParentCategoryName
322 2 2 People
323 4 3 House
324 5 1 People
325 6 2 People
326 7 2 House
327 8 3 House
328 9 1 People
329 10 2 House
330 0 rows affected
331 Use delete with limit and order parameters
332 send Mysqlx.Crud.Delete {
333 collection {
334 name: "ExtraCategoryInfo"
335 schema: "dbmysqlxplugintest"
336 }
337 data_model: DOCUMENT
338 limit {
339 row_count: 1
340 }
341 order {
342 expr {
343 type: IDENT
344 identifier {
345 name: "CategoryID"
346 }
347 }
348 direction: DESC
349 }
350 order {
351 expr {
352 type: IDENT
353 identifier {
354 name: "ExtraCategoryInfoID"
355 }
356 }
357 direction: DESC
358 }
359 }
360
361
362 1 rows affected
363 RUN SELECT * FROM dbmysqlxplugintest.ExtraCategoryInfo
364 ExtraCategoryInfoID CategoryID MainParentCategoryName
365 2 2 People
366 4 3 House
367 5 1 People
368 6 2 People
369 7 2 House
370 9 1 People
371 10 2 House
372 0 rows affected
373 Mysqlx.Ok {
374 msg: "bye!"
375 }
376 ok
377 DROP DATABASE IF EXISTS dbmysqlxplugintest;