[MDEV-15122] Simultaneous assignment for LOAD..SET Created: 2018-01-30  Updated: 2018-04-10

Status: Open
Project: MariaDB Server
Component/s: OTHER
Fix Version/s: None

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-13418 Compatibility: The order of evaluatio... Stalled
relates to MDEV-13417 UPDATE produces wrong values if an up... Closed
relates to MDEV-15123 Make multiple user variable assignmen... Open
relates to MDEV-15124 Simultaneous assignment for INSERT ..... Open

 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.


Generated at Thu Feb 08 08:18:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.