Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a INT DEFAULT 10, b INT DEFAULT 20, c INT); |
INSERT INTO t1 SET c=a; |
SELECT * FROM t1; |
+------+------+------+
|
| a | b | c |
|
+------+------+------+
|
| 10 | 20 | 10 |
|
+------+------+------+
|
Notice, c was assigned to 10, which is the default value for a.
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a INT DEFAULT 10, b INT DEFAULT 20, c INT); |
INSERT INTO t1 SET a=11,c=a; |
SELECT * FROM t1; |
+------+------+------+
|
| a | b | c |
|
+------+------+------+
|
| 11 | 20 | 11 |
|
+------+------+------+
|
Notice, c was assigned to 11, which is the new value of a, after a=11 was done.
We're assing a new sql_mode soon, for simultaneous assignments (See MDEV-13417).
this query should probably also follow the new sql_mode, so c is to the initial (default) value of a, which is 10.
Attachments
Issue Links
- relates to
-
MDEV-13417 UPDATE produces wrong values if an updated column is later used as an update source
- Closed
-
MDEV-15122 Simultaneous assignment for LOAD..SET
- Open
-
MDEV-15123 Make multiple user variable assignment work similar in standalone query and in SP
- Open