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

Bulk: insert with subselect inserts wrong data

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.7.3, 10.3, 10.4, 10.10.3, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
    • 10.4, 10.5, 10.6
    • Prepared Statements
    • None

    Description

      This issue was initially reported on stackoverflow

      When using subselects in bulk insert wrong values are inserted.

      How to repeat:

      SQL:

      create table t1 (a int);
      create table t2 like t1;
      insert into t2 values (1),(2);
      

      Python script:

      import mariadb
      conn= mariadb.connect(db="test")
      cursor=conn.cursor()
      cursor.executemany("INSERT INTO t1 VALUES ((SELECT a FROM t2 WHERE a=?))", [(1,),(2,)])
      cursor.execute("SELECT a FROM t1")
      row= cursor.fetchall()
      print(row)
      

      Output:

      [(1,), (1,)]
      

      Expected Output:

      [(1,), (2,)]
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.