Skip to content

Commit b6ebc97

Browse files
committed
MDEV-39563 Implement UPDATE ... RETURNING ... INTO
1 parent 50d0c98 commit b6ebc97

16 files changed

Lines changed: 1294 additions & 3 deletions

mysql-test/main/delete_returning.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,8 @@ show status like "Rows_sent";
227227
Variable_name Value
228228
Rows_sent 3
229229
drop table t1;
230+
#
231+
# MDEV-39563 Implement UPDATE ... RETURNING ... INTO
232+
#
233+
DELETE FROM t1 RETURNING a INTO @a;
234+
ERROR HY000: 'RETURNING..INTO' is not allowed in this context

mysql-test/main/delete_returning.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,10 @@ flush status;
183183
delete from t1 where a between 1 and 3 returning a,b;
184184
show status like "Rows_sent";
185185
drop table t1;
186+
187+
--echo #
188+
--echo # MDEV-39563 Implement UPDATE ... RETURNING ... INTO
189+
--echo #
190+
191+
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
192+
DELETE FROM t1 RETURNING a INTO @a;

mysql-test/main/insert_returning.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,3 +705,8 @@ show status like "Rows_sent";
705705
Variable_name Value
706706
Rows_sent 6
707707
drop table t1;
708+
#
709+
# MDEV-39563 Implement UPDATE ... RETURNING ... INTO
710+
#
711+
INSERT INTO t1 VALUES (10) RETURNING a INTO @a;
712+
ERROR HY000: 'RETURNING..INTO' is not allowed in this context

mysql-test/main/insert_returning.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,3 +412,10 @@ insert into t1 values (1,2),(2,4) returning a,b;
412412
insert into t1 select seq,seq from seq_10_to_13 returning a,b;
413413
show status like "Rows_sent";
414414
drop table t1;
415+
416+
--echo #
417+
--echo # MDEV-39563 Implement UPDATE ... RETURNING ... INTO
418+
--echo #
419+
420+
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
421+
INSERT INTO t1 VALUES (10) RETURNING a INTO @a;

mysql-test/main/replace_returning.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,3 +260,8 @@ ERROR 21000: Subquery returns more than 1 row
260260
REPLACE INTO t2(id2,val2) SELECT t1.* FROM t1 WHERE id1=2 RETURNING t1.*;
261261
ERROR 42S02: Unknown table 'test.t1'
262262
DROP TABLE t1,t2;
263+
#
264+
# MDEV-39563 Implement UPDATE ... RETURNING ... INTO
265+
#
266+
REPLACE t1 SET a=a+1 RETURNING a INTO @a;
267+
ERROR HY000: 'RETURNING..INTO' is not allowed in this context

mysql-test/main/replace_returning.test

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,11 @@ REPLACE INTO t2(id2,val2) SELECT t1.* FROM t1 WHERE id1=2 RETURNING t1.*;
190190

191191

192192
DROP TABLE t1,t2;
193+
194+
195+
--echo #
196+
--echo # MDEV-39563 Implement UPDATE ... RETURNING ... INTO
197+
--echo #
198+
199+
--error ER_NOT_ALLOWED_IN_THIS_CONTEXT
200+
REPLACE t1 SET a=a+1 RETURNING a INTO @a;

0 commit comments

Comments
 (0)