Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15122

Simultaneous assignment for LOAD..SET

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • OTHER
    • 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

          Activity

            People

              Unassigned Unassigned
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.