1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
|
--source include/have_sequence.inc
--echo # Test for INSERT...RETURNING
CREATE TABLE t1(id1 INT PRIMARY KEY AUTO_INCREMENT, val1 VARCHAR(1));
CREATE TABLE t2(id2 INT PRIMARY KEY AUTO_INCREMENT, val2 VARCHAR(1));
CREATE VIEW v1 AS SELECT id1, val1 FROM t1;
CREATE VIEW v2 AS SELECT id2,val2 FROM t2;
INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c');
DELIMITER |;
CREATE FUNCTION f(arg INT) RETURNS TEXT
BEGIN
RETURN (SELECT arg+arg);
END|
DELIMITER ;|
--echo #
--echo # Simple insert statement...RETURNING
--echo #
INSERT INTO t1 (id1, val1) VALUES (1, 'a');
INSERT INTO t1 (id1, val1) VALUES (2, 'b') RETURNING *;
INSERT INTO t1 (id1, val1) VALUES (3, 'c') RETURNING id1+id1 as total,val1,
id1 && id1, id1 | id1, UPPER(val1),f(id1);
INSERT INTO t1(id1,val1) VALUES (4,'d') RETURNING(SELECT GROUP_CONCAT(val2)
FROM t2 WHERE id2=1);
INSERT INTO t1(id1,val1) VALUES(5,'e') RETURNING(SELECT GROUP_CONCAT(val2)
FROM t2 GROUP BY id2 HAVING id2=id1-2);
PREPARE stmt FROM "INSERT INTO t1 (id1,val1) VALUES (6,'f') RETURNING (SELECT id2 FROM t2 WHERE val2='b')";
EXECUTE stmt;
DELETE FROM t1 WHERE id1=6;
SELECT * FROM t1;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
INSERT IGNORE INTO t1(id1,val1) VALUES (7,'h') RETURNING *;
SELECT * FROM t1;
EXPLAIN INSERT INTO t1(id1,val1) VALUES (8,'i') RETURNING *;
EXPLAIN EXTENDED INSERT INTO t1(id1,val1) VALUES(9,'j') RETURNING id1;
EXPLAIN FORMAT="json" INSERT INTO t1(id1,val1) VALUES (10,'k') RETURNING id1;
SELECT * FROM t1;
INSERT INTO v1(id1, val1) VALUES (12, 'a') RETURNING id1+id1 as total,val1,
id1 && id1, id1 id1, UPPER(val1),f(id1);
ANALYZE INSERT INTO t1(id1,val1) VALUES(13,'l') RETURNING *;
INSERT INTO t1(id1,val1) VALUES(14,'m') RETURNING t1.*;
TRUNCATE TABLE t1;
--echo #
--echo # Multiple values in one insert statement...RETURNING
--echo #
INSERT INTO t1 VALUES (1,'a'),(2,'b');
INSERT INTO t1 VALUES (3,'c'),(4,'d') RETURNING *;
INSERT INTO t1 VALUES (5,'e'),(6,'f') RETURNING id1 as id,val1,
id1 && id1, id1|id1, UPPER(val1),f(id1);
INSERT INTO t1 VALUES (7,'g'),(8,'h') RETURNING(SELECT GROUP_CONCAT(val2)
FROM t2 WHERE id2=1);
INSERT INTO t1 VALUES (9,'i'),(10,'j') RETURNING(SELECT GROUP_CONCAT(val2)
FROM t2 GROUP BY id2 HAVING id2=id1-8);
PREPARE stmt FROM "INSERT INTO t1 VALUES (11,'k'),(12,'l') RETURNING (SELECT id2 FROM t2 WHERE val2='b')";
EXECUTE stmt;
DELETE FROM t1 WHERE val1 IN ('k','l');
SELECT * FROM t1;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
INSERT IGNORE INTO t1 VALUES(13,'o'),(14,'p') RETURNING *;
EXPLAIN INSERT INTO t1 VALUES(15,'q'),(16,'r') RETURNING *;
EXPLAIN EXTENDED INSERT INTO t1 VALUES (17,'s'),(18,'t') RETURNING *;
EXPLAIN FORMAT="json" INSERT INTO t1 VALUES(19,'u'),(20,'v') RETURNING id1;
SELECT * FROM t1;
INSERT INTO v1 VALUES(23,'y'),(24,'z') RETURNING id1 as id,val1,
id1 && id1, id1|id1, UPPER(val1),f(id1);
ANALYZE INSERT INTO t1 VALUES(25,'a'),(26,'b') RETURNING *;
ANALYZE INSERT INTO t1 VALUES(27,'c'),(28,'d') RETURNING t1.*;
--echo #
--echo # INSERT...ON DUPLICATE KEY UPDATE...RETURNING
--echo #
CREATE TABLE ins_duplicate (id INT PRIMARY KEY AUTO_INCREMENT, val VARCHAR(1));
INSERT INTO ins_duplicate VALUES (1,'a');
INSERT INTO ins_duplicate VALUES (2,'b') ON DUPLICATE KEY UPDATE val='b'
RETURNING *;
INSERT INTO ins_duplicate VALUES (2,'b') ON DUPLICATE KEY UPDATE val='c'
RETURNING id+id AS total, val, id && id, id|id, UPPER(val),f(id);
INSERT INTO ins_duplicate VALUES (2,'b') ON DUPLICATE KEY UPDATE val='d'
RETURNING (SELECT GROUP_CONCAT(val2) FROM t2 WHERE id2=1);
INSERT INTO ins_duplicate VALUES (2,'b') ON DUPLICATE KEY UPDATE val='e'
RETURNING (SELECT GROUP_CONCAT(val2) FROM t2 GROUP BY id2 HAVING id2=id);
PREPARE stmt FROM "INSERT INTO ins_duplicate VALUES (2,'b') ON DUPLICATE
KEY UPDATE val='f' RETURNING (SELECT id2 FROM t2 WHERE val2='b')";
EXECUTE stmt;
SELECT * FROM t2;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
INSERT IGNORE INTO ins_duplicate(id,val) VALUES (3,'c'),(4,'d') ON DUPLICATE
KEY UPDATE val='g' RETURNING id;
EXPLAIN INSERT INTO ins_duplicate(id,val) VALUES (2,'b') ON DUPLICATE KEY
UPDATE val='h' RETURNING val;
EXPLAIN EXTENDED INSERT INTO ins_duplicate(id,val) VALUES (2,'b')
ON DUPLICATE KEY UPDATE val='i' RETURNING val;
EXPLAIN FORMAT="json" INSERT INTO ins_duplicate(id,val) VALUES (2,'b')
ON DUPLICATE KEY UPDATE val='j' RETURNING val;
INSERT INTO v1(id1, val1) VALUES (2,'d') ON DUPLICATE KEY UPDATE
val1='d' RETURNING id1+id1 AS total, val1, id1 && id1, id1|id1, UPPER(val1),
f(id1);
ANALYZE INSERT INTO ins_duplicate(id,val) VALUES(2,'b') ON DUPLICATE KEY UPDATE
val='k' RETURNING *;
INSERT INTO ins_duplicate(id,val) VALUES(2,'b') ON DUPLICATE KEY UPDATE
val='l' RETURNING ins_duplicate.*;
SELECT * FROM ins_duplicate;
--echo #
--echo # INSERT...SET...RETURNING
--echo #
TRUNCATE TABLE t1;
INSERT INTO t1 SET id1= 1, val1= 'a';
INSERT INTO t1 SET id1= 2, val1= 'b' RETURNING *;
INSERT INTO t1 SET id1= 3, val1= 'c' RETURNING id1+id1 AS total,val1,
id1 && id1, id1|id1, UPPER(val1),f(id1);
INSERT INTO t1 SET id1= 4, val1= 'd' RETURNING (SELECT GROUP_CONCAT(val2)
FROM t2 WHERE id2=1);
INSERT INTO t1 SET id1= 5, val1='e' RETURNING (SELECT GROUP_CONCAT(val2)
FROM t2 GROUP BY id2 HAVING id2=id1-3);
PREPARE stmt FROM "INSERT INTO t1 SET id1= 6, val1='f' RETURNING (SELECT id2 FROM t2 WHERE val2='b')";
EXECUTE stmt;
DELETE FROM t1 WHERE val1='f';
SELECT * FROM t1;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
INSERT INTO t1 SET id1= 7, val1= 'g' RETURNING f(id1);
INSERT INTO t1 SET val1= 'n' RETURNING *;
INSERT IGNORE INTO t1 SET id1= 8, val1= 'h' RETURNING *;
EXPLAIN INSERT INTO t1 SET id1=9, val1='i' RETURNING id1;
EXPLAIN EXTENDED INSERT INTO t1 SET id1=10, val1='j' RETURNING val1;
EXPLAIN FORMAT="json" INSERT INTO t1 SET id1=11, val1='k' RETURNING val1;
INSERT INTO v1 SET id1=26, val1='Z' RETURNING id1+id1 AS total,val1,
id1 && id1, id1|id1, UPPER(val1),f(id1);
ANALYZE INSERT INTO t1 SET id1=12, val1='l' RETURNING *;
INSERT INTO t1 SET id1= 13, val1= 'm' RETURNING t1.*;
SELECT * FROM t1;
--echo #
--echo # INSERT...SELECT...RETURNING
--echo #
TRUNCATE TABLE t2;
INSERT INTO t2(id2,val2) SELECT * FROM t1;
TRUNCATE TABLE t2;
INSERT INTO t2 SELECT * FROM t1 WHERE id1=1 RETURNING *;
INSERT INTO t2 SELECT * FROM t1 WHERE id1=2 RETURNING id2+id2 AS total,
val2,id2 && id2, id2|id2, UPPER(val2),f(id2);
INSERT INTO t2 SELECT * FROM t1 WHERE id1=3 RETURNING (SELECT GROUP_CONCAT(val1) FROM t1 GROUP BY id1 HAVING id1=id1+1);
PREPARE stmt FROM "INSERT INTO t2 SELECT * FROM t1 WHERE id1=4 RETURNING (SELECT id1 FROM t1 WHERE val1='b')";
EXECUTE stmt;
DELETE FROM t2 WHERE id2=4;
SELECT * FROM t1;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
INSERT INTO t2 SELECT * FROM t1 WHERE id1=6 RETURNING
(SELECT id1+id2 FROM t1 WHERE id1=1);
INSERT INTO t2 SELECT * FROM t1 WHERE id1=7 RETURNING f(id2);
EXPLAIN INSERT INTO t2 SELECT * FROM t1 WHERE id1=8 RETURNING id2;
EXPLAIN EXTENDED INSERT INTO t1 SELECT * FROM t1 WHERE id1=9 RETURNING val1;
EXPLAIN FORMAT="json" INSERT INTO t1 SELECT * FROM t1 WHERE id1=10 RETURNING val1;
INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE id1=8 RETURNING *;
INSERT IGNORE INTO v2 SELECT * FROM v1 RETURNING *;
ANALYZE INSERT INTO t2 SELECT * FROM t1 WHERE id1=11 RETURNING *;
SELECT * FROM t2;
TRUNCATE TABLE t2;
INSERT INTO t2 SELECT * FROM t1 WHERE id1=1 RETURNING t2.*;
INSERT INTO t2 SELECT t1.* FROM t1 WHERE id1=2 RETURNING t2.*;
SELECT * FROM t2;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE ins_duplicate;
--echo #
--echo # Error message test
--echo #
CREATE TABLE t1(id1 INT,val1 VARCHAR(1));
CREATE TABLE t2(id2 INT,val2 VARCHAR(1));
CREATE TABLE ins_duplicate (id INT PRIMARY KEY, val VARCHAR(1));
INSERT INTO t1 VALUES(1,'a'),(2,'b'),(3,'c');
--echo #
--echo # SIMLPE INSERT STATEMENT
--echo #
--error ER_BAD_FIELD_ERROR
INSERT INTO t2(id2,val2) VALUES(1,'a') RETURNING id1;
--error ER_INVALID_GROUP_FUNC_USE
INSERT INTO t2(id2,val2) values(2,'b') RETURNING SUM(id2);
--error ER_SUBQUERY_NO_1_ROW
INSERT INTO t2(id2,val2) VALUES(3,'c') RETURNING (SELECT id1 FROM t1);
--error ER_OPERAND_COLUMNS
INSERT INTO t2(id2,val2) VALUES(4,'d') RETURNING (SELECT * FROM t1);
--error ER_OPERAND_COLUMNS
INSERT INTO t2(id2,val2) VALUES(4,'d') RETURNING (SELECT * FROM t2);
INSERT INTO t2(id2,val2) VALUES(5,'e') RETURNING id2, (SELECT id1+id2 FROM
t1 WHERE id1=1);
--error ER_UPDATE_TABLE_USED
INSERT INTO t2(id2,val2) VALUES(5,'f') RETURNING (SELECT id2 FROM t2);
--error ER_BAD_TABLE_ERROR
INSERT INTO t2 (id2, val2) VALUES (6,'f') RETURNING t1.*;
--echo #
--echo # Multiple rows in single insert statement
--echo #
--error ER_BAD_FIELD_ERROR
INSERT INTO t2 VALUES(1,'a'),(2,'b') RETURNING id1;
--error ER_INVALID_GROUP_FUNC_USE
INSERT INTO t2 VALUES(3,'c'),(4,'d') RETURNING MAX(id2);
--error ER_SUBQUERY_NO_1_ROW
INSERT INTO t2 VALUES(5,'c'),(6,'f') RETURNING (SELECT id1 FROM t1);
--error ER_OPERAND_COLUMNS
INSERT INTO t2 VALUES(7,'g'),(8,'h') RETURNING (SELECT * FROM t1);
--error ER_OPERAND_COLUMNS
INSERT INTO t2 VALUES(9,'g'),(10,'h') RETURNING (SELECT * FROM t2);
INSERT INTO t2 VALUES(11,'e'),(12,'f') RETURNING id2, (SELECT id1+id2 FROM
t1 WHERE id1=1);
--error ER_UPDATE_TABLE_USED
INSERT INTO t2 VALUES(13,'f'),(14,'g') RETURNING (SELECT id2 FROM t2);
--error ER_BAD_TABLE_ERROR
INSERT INTO t2 VALUES(13,'f'),(14,'g') RETURNING t1.*;
--echo #
--echo # INSERT ... SET
--echo #
--error ER_BAD_FIELD_ERROR
INSERT INTO t2 SET id2=1, val2='a' RETURNING id1;
--error ER_INVALID_GROUP_FUNC_USE
INSERT INTO t2 SET id2=2, val2='b' RETURNING COUNT(id2);
--error ER_SUBQUERY_NO_1_ROW
INSERT INTO t2 SET id2=3, val2='c' RETURNING (SELECT id1 FROM t1);
--error ER_OPERAND_COLUMNS
INSERT INTO t2 SET id2=4, val2='d' RETURNING (SELECT * FROM t1);
--error ER_OPERAND_COLUMNS
INSERT INTO t2 SET id2=4, val2='d' RETURNING (SELECT * FROM t2);
INSERT INTO t2 SET id2=5, val2='e' RETURNING id2, (SELECT id1+id2 FROM t1
WHERE id1=1);
--error ER_UPDATE_TABLE_USED
INSERT INTO t2 SET id2=5, val2='f' RETURNING (SELECT id2 FROM t2);
--error ER_BAD_TABLE_ERROR
INSERT INTO t2 SET id2=5, val2='f' RETURNING t1.*;
--echo #
--echo # INSERT...ON DUPLICATE KEY UPDATE
--echo #
--error ER_BAD_FIELD_ERROR
INSERT INTO ins_duplicate VALUES (2,'b') ON DUPLICATE KEY UPDATE val='b'
RETURNING id1;
--error ER_INVALID_GROUP_FUNC_USE
INSERT INTO ins_duplicate VALUES (2,'b') ON DUPLICATE KEY UPDATE val='b'
RETURNING MAX(id);
--error ER_SUBQUERY_NO_1_ROW
INSERT INTO ins_duplicate VALUES (2,'b') ON DUPLICATE KEY UPDATE val='b'
RETURNING (SELECT id1 FROM t1);
--error ER_OPERAND_COLUMNS
INSERT INTO ins_duplicate VALUES (2,'b') ON DUPLICATE KEY UPDATE val='b'
RETURNING (SELECT * FROM t1);
--error ER_OPERAND_COLUMNS
INSERT INTO ins_duplicate VALUES (2,'b') ON DUPLICATE KEY UPDATE val='b'
RETURNING (SELECT * FROM ins_duplicate);
--error ER_BAD_FIELD_ERROR
INSERT INTO ins_duplicate VALUES(2,'b') ON DUPLICATE KEY UPDATE val='b'
RETURNING id2, (SELECT id1+id FROM t1 WHERE id1=1);
--error ER_UPDATE_TABLE_USED
INSERT INTO ins_duplicate VALUES(2,'b') ON DUPLICATE KEY UPDATE val='b'
RETURNING (SELECT id FROM ins_duplicate);
--error ER_BAD_TABLE_ERROR
INSERT INTO ins_duplicate VALUES(2,'b') ON DUPLICATE KEY UPDATE val='b'
RETURNING t1.*;
--echo #
--echo # INSERT...SELECT
--echo #
--error ER_BAD_FIELD_ERROR
INSERT INTO t2(id2, val2) SELECT * FROM t1 WHERE id1=1 RETURNING id1;
--error ER_INVALID_GROUP_FUNC_USE
INSERT INTO t2(id2, val2) SELECT * FROM t1 WHERE id1=2 RETURNING MAX(id2);
--error ER_SUBQUERY_NO_1_ROW
INSERT INTO t2(id2, val2) SELECT * FROM t1 WHERE id1=2 RETURNING (SELECT
id1 FROM t1);
--error ER_OPERAND_COLUMNS
INSERT INTO t2(id2, val2) SELECT * FROM t1 WHERE id1=2 RETURNING (SELECT
* FROM t1);
--error ER_OPERAND_COLUMNS
INSERT INTO t2(id2, val2) SELECT * FROM t1 WHERE id1=2 RETURNING(SELECT
* FROM t2);
--error ER_SUBQUERY_NO_1_ROW
INSERT INTO t2(id2,val2) SELECT * FROM t1 WHERE id1=2 RETURNING (SELECT
id2 FROM t2);
--error ER_BAD_TABLE_ERROR
INSERT INTO t2(id2,val2) SELECT t1.* FROM t1 WHERE id1=2 RETURNING t1.*;
--echo #
--echo # TRIGGER
--echo #
CREATE TRIGGER bi1 before insert on t1 for each row set NEW.val1= 'z';
INSERT INTO t1 VALUES (4, 'd'), (5, 'e') RETURNING *;
--error ER_SP_NO_RETSET
CREATE TRIGGER bi2 before insert on t2 for each row
INSERT INTO t1 VALUES (NEW.id2, NEW.val2) RETURNING *;
--echo #
--echo # SP
--echo #
delimiter |;
--error ER_SP_NO_RETSET
CREATE FUNCTION f1(arg INT) RETURNS TEXT
BEGIN
INSERT INTO t1 VALUES (arg, arg) RETURNING *;
RETURN arg;
END|
delimiter ;|
CREATE PROCEDURE sp1(arg INT)
INSERT INTO t1 VALUES (arg, arg) RETURNING *;
CALL sp1(0);
DROP PROCEDURE sp1;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE ins_duplicate;
DROP VIEW v1;
DROP VIEW v2;
DROP FUNCTION f;
--echo #
--echo # MDEV-25028: ASAN use-after-poison in base_list_iterator::next or
--echo # Assertion `sl->join == 0' upon INSERT .. RETURNING via PS
--echo #
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT);
PREPARE stmt1 FROM "INSERT INTO t1 SELECT * FROM t1 WHERE a IN (SELECT b FROM t2) RETURNING a";
EXECUTE stmt1;
PREPARE stmt2 FROM "INSERT INTO t1 SELECT * FROM t1 WHERE a IN (SELECT b FROM t2) RETURNING (SELECT b FROM t2)";
EXECUTE stmt2;
DROP TABLE t1, t2;
--echo #
--echo # MDEV-25187: Assertion `inited == NONE || table->open_by_handler'
--echo # failed or Direct leak in init_dynamic_array2 upon INSERT .. RETURNING
--echo # and memory leak in init_dynamic_array2
--echo #
CREATE TABLE t (a INT, KEY (a));
CREATE TABLE t1 (f INT);
INSERT INTO t VALUES (1),(2);
INSERT INTO t1 SELECT a FROM t WHERE 1 NOT IN (SELECT a FROM t) RETURNING f;
# Cleanup
DROP TABLE t, t1;
--echo #
--echo # MDEV-28740: crash in INSERT RETURNING subquery in prepared statements
--echo #
CREATE TABLE t1 (
id INTEGER NOT NULL,
data VARCHAR(30),
PRIMARY KEY (id)
)ENGINE=MyISAM;
EXECUTE IMMEDIATE 'INSERT INTO t1 (id, data) VALUES ((SELECT CAST(1 AS SIGNED INTEGER) AS anon_1), ?) RETURNING t1.id' using 'hi';
DROP TABLE t1;
--echo #
--echo # MDEV-27165: crash in base_list_iterator::next
--echo #
CREATE TABLE t1 ( id int, a int);
CREATE TABLE t2 ( id int);
--error ER_WARN_DATA_OUT_OF_RANGE
INSERT INTO t1 VALUES (( SELECT 1 from t2),999999999999) RETURNING id;
--error ER_WARN_DATA_OUT_OF_RANGE
EXECUTE immediate "INSERT INTO t1 VALUES (( SELECT 1 from t2),999999999999) RETURNING id ";
EXECUTE immediate "INSERT INTO t1 VALUES (( SELECT 1 from t2),9) RETURNING id ";
DROP TABLE t1, t2;
--echo #
--echo # MDEV-29686: Assertion `slave == 0' failed in
--echo # st_select_lex_node::attach_single
--echo #
CREATE TABLE t (a INT);
INSERT t WITH cte AS (SELECT 1) SELECT * FROM cte RETURNING *;
DROP TABLE t;
--echo #
--echo # MDEV-3953 Add columns for ROWS_EXAMINED, ROWS_SENT, and ROWS_READ to I_S and
--echo # processlist
--echo #
create table t1 (a int primary key, b int);
flush status;
insert into t1 values (1,2),(2,4) returning a,b;
insert into t1 select seq,seq from seq_10_to_13 returning a,b;
show status like "Rows_sent";
drop table t1;
|