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

second executemany fails with "Commands out of sync" if using the same cursor

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.4
    • 1.1.5
    • DBAPI 2.0
    • None

    Description

      on actual 1.1 branch. if i run a second executemany, command fails with "Commands out of sync; you can't run this command now"
      If this second executemany runs on another cursor, command run successfully.

      example to reproduce change test "test_inserttuple" in test_cursor to run 2 x executemany:

          def test_inserttuple(self):
              if is_maxscale():
                  self.skipTest("MAXSCALE doesn't support BULK yet")
              cursor = self.connection.cursor()
              cursor.execute("CREATE TEMPORARY TABLE test_inserttuple ("
                             "id int, name varchar(64), "
                             "city varchar(64))")
              params = ((1, u"Jack", u"Boston"),
                        (2, u"Martin", u"Ohio"),
                        (3, u"James", u"Washington"),
                        (4, u"Rasmus", u"Helsinki"),
                        (5, u"Andrey", u"Sofia"))
              cursor.executemany("INSERT INTO test_inserttuple VALUES (?,?,?)",
                                 params)
              cursor.executemany("INSERT INTO test_inserttuple VALUES (?,?,?)",
                                 params)
              cursor = self.connection.cursor()
              cursor.execute("SELECT name FROM test_inserttuple ORDER BY id DESC")
              row = cursor.fetchone()
              self.assertEqual("Andrey", row[0])
              del cursor
      

      Attachments

        Activity

          People

            georg Georg Richter
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.