Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
I run this script:
SET @a=10; |
SET @a=20,@b=@a; |
SELECT @a,@b; |
+------+------+
|
| @a | @b |
|
+------+------+
|
| 20 | 10 |
|
+------+------+
|
No I wrap the same script into an anonymous SP block:
DELIMITER $$
|
BEGIN NOT ATOMIC |
SET @a=10; |
SET @a=20,@b=@a; |
SELECT @a,@b; |
END
|
$$
|
+------+------+
|
| @a | @b |
|
+------+------+
|
| 20 | 20 |
|
+------+------+
|
Notice:
- in the standalone script @b was assigned to the initial value of @a
- in the anonymous block @b was assigned to the new value of @a
We'll make multiple SET inside an SP work the same way with a standalone SET.
Note, multiple SET for SP variables should also work the same way.
Attachments
Issue Links
- relates to
-
MDEV-13417 UPDATE produces wrong values if an updated column is later used as an update source
- Closed
-
MDEV-13418 Compatibility: The order of evaluation of SELECT..INTO assignments
- Stalled
-
MDEV-15122 Simultaneous assignment for LOAD..SET
- Open
-
MDEV-15124 Simultaneous assignment for INSERT ... SET
- Open