Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-254

executemany insert final value NULL gives SystemError

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Incomplete
    • 1.1.6
    • N/A
    • Generic
    • None
    • 3.10

    Description

      Cannot insert a NULL into the final position, but inserting NULL in any other position is okay.

      This makes no sense!

      Steps to reproduce the error:

      import sys
      import mariadb
      NULL = mariadb.constants.INDICATOR.NULL
       
      conn = mariadb.connect(**db_credentials)
      cursor = conn.cursor()
       
      cursor.execute("DROP TABLE IF EXISTS ind1;")
      cursor.execute("CREATE TABLE ind1 (id1 int, id2 int);")
       
      # This command works:
      cursor.executemany(
          "INSERT INTO ind1 (id1, id2) VALUES (?,?)", [(NULL, 2)])
       
      # This command returns:
      # SystemError: <method '_execute_bulk' of 'mariadb.cursor' objects>
      #  returned NULL without setting an exception
      cursor.executemany(
          "INSERT INTO ind1 (id1, id2) VALUES (?,?)", [(2, NULL)])
       
      print(mariadb.__version__)
      # 1.1.6
      print(sys.version)
      # '3.10.9 | packaged by Anaconda, Inc. |
      # (main, Mar  8 2023, 10:42:25)
      # [MSC v.1916 64 bit (AMD64)]'
      print(mariadb.mariadbapi_version)
      # 3.3.4
      print(conn.server_info)
      # 10.7.7-MariaDB-1:10.7.7+maria~ubu2004-log
      

      Attachments

        Activity

          People

            georg Georg Richter
            MichaelCurrie Michael Currie
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.