Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
We're going to have a new sql_mode soon for simultaneous assignments (MDEV-13417).
It would be nice to make LOAD..SET also honor this new sql_mode.
Currently this script:
SELECT 1,2 INTO OUTFILE 'test.txt'; |
CREATE OR REPLACE TABLE t1 (a INT, b INT,c INT); |
LOAD DATA INFILE 'test.txt' INTO TABLE t1 (a,b); |
LOAD DATA INFILE 'test.txt' INTO TABLE t1 (a,b) SET c=a; |
LOAD DATA INFILE 'test.txt' INTO TABLE t1 (a,b) SET a=5,c=a; |
SELECT * FROM t1; |
returns this:
+------+------+------+
|
| a | b | c |
|
+------+------+------+
|
| 1 | 2 | NULL |
|
| 1 | 2 | 1 |
|
| 5 | 2 | 5 |
|
+------+------+------+
|
With the new sql_mode, the third row should instead of (5,2,5) return (5,2,1), i.e. assignment of c should use the initial value of a which came from the file, before a=5 was done.
Attachments
Issue Links
- relates to
-
MDEV-13418 Compatibility: The order of evaluation of SELECT..INTO assignments
- Stalled
-
MDEV-13417 UPDATE produces wrong values if an updated column is later used as an update source
- Closed
-
MDEV-15123 Make multiple user variable assignment work similar in standalone query and in SP
- Open
-
MDEV-15124 Simultaneous assignment for INSERT ... SET
- Open