Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-240

Bulk Insert (Row-wise Binding) inserts wrong data in db when array_size= 1

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 3.0.1
    • 3.0.2
    • None
    • None
    • Fedora linux
      mariadb-connector-c-3.0.1-beta
      Server version: 10.2.4-MariaDB MariaDB Server

    Description

      Using the example in:
      https://mariadb.com/kb/en/mariadb/bulk-insert-row-wise-binding/

      If I change array_size from 3 to 1 I get the following stored in the db:
      select * from example_db.bulk_example2;

      +----+----------+---------+
      | id | forename | surname |
      +----+----------+---------+
      |  1 |          | Monty   |
      +----+----------+---------+

      I would have expected:

      +----+----------+----------+
      | id | forename | surname  |
      +----+----------+----------+
      |  1 | Monty    | Widenius |
      +----+----------+---------+

      When array_size=3 I get, as expected, the following stored in the db:

      +----+----------+----------+
      | id | forename | surname  |
      +----+----------+----------+
      |  1 | Monty    | Widenius |
      |  2 | David    | Axmark   |
      |  3 | unknown  | N.N.     |
      +----+----------+----------+

      Attachments

        Issue Links

          Activity

            georg Georg Richter added a comment -

            Client sends the following data packet (execute_generate_request):

            0000   40 fe 40 fe 40 01 00 05 4d 6f 6e 74 79 00 08 57  @.@.@...Monty..W
            0010   69 64 65 6e 69 75 73                             idenius
            

            According to COM_STMT_EXECUTE documentation the server expects a null bitmap if iteration count is one.

            Unfortunately all test cases both in Connector/C and Server are working with larger array sizes.

            This needs to be fixed in protocol (affects Connector/C, Connector/J and MariaDB Server 10.2)

            georg Georg Richter added a comment - Client sends the following data packet (execute_generate_request): 0000 40 fe 40 fe 40 01 00 05 4d 6f 6e 74 79 00 08 57 @.@.@...Monty..W 0010 69 64 65 6e 69 75 73 idenius According to COM_STMT_EXECUTE documentation the server expects a null bitmap if iteration count is one. Unfortunately all test cases both in Connector/C and Server are working with larger array sizes. This needs to be fixed in protocol (affects Connector/C, Connector/J and MariaDB Server 10.2)
            TomBishop Thomas Pollak added a comment -

            Not directly connected to the connector, but which storage engine do you use for your repro case?

            TomBishop Thomas Pollak added a comment - Not directly connected to the connector, but which storage engine do you use for your repro case?
            TomBishop Thomas Pollak added a comment -

            Never mind, I found out that bulk insert doesn't work in server 10.2.6 and 10.3.

            TomBishop Thomas Pollak added a comment - Never mind, I found out that bulk insert doesn't work in server 10.2.6 and 10.3.
            georg Georg Richter added a comment -

            Due to this bug we decided to change the protocol - unfortunately it was too late for 10.2.6, so it will be available in 10.2.7 (planned release date will be July).

            If you want to test before, the github branches are:
            MDEV-12471 (Connector/C)
            bb-10.2-MDEV-12471 (Server)

            georg Georg Richter added a comment - Due to this bug we decided to change the protocol - unfortunately it was too late for 10.2.6, so it will be available in 10.2.7 (planned release date will be July). If you want to test before, the github branches are: MDEV-12471 (Connector/C) bb-10.2- MDEV-12471 (Server)

            People

              georg Georg Richter
              ean Egon Andersen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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