Skip to content

Conversation

acazacu
Copy link

@acazacu acazacu commented Aug 16, 2022

The MySQLCursor.executemany() method implements a sentinel for detecting batch insert operations and grouping multiple INSERT queries into a significantly more performant single INSERT query with multiple values.

The current definition of the RE is faulty, causing the sentinel to fail in correctly identifying batch INSERT operations. This fault seems to be due to a regression introduced in ddf6b13, released as part of v8.0.30.

As can be seen in diff#ddf6b13, while the .format() invocation was removed from cursor.py#L52, the escaping curly braces for the RE quantifier defined were left behind. Lacking the .format() invocation the previously escaping curly braces to the RE quantifier now defined at lib/mysql/connector/cursor.py#L59 have become part of the RE itself, thus breaking the sentinel to always fail identifying batch INSERT operations.

This PR fixes the above described regression. The associated MySQL issue tracker bug: https://bugs.mysql.com/bug.php?id=108145&thanks=2&notify=195

@mysql-oca-bot
Copy link

Hi, thank you for submitting this pull request. In order to consider your code we need you to sign the Oracle Contribution Agreement (OCA). Please review the details and follow the instructions at https://oca.opensource.oracle.com/
Please make sure to include your MySQL bug system user (email) in the returned form.
Thanks

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Please confirm this code is submitted under the terms of the OCA (Oracle's Contribution Agreement) you have previously signed by cutting and pasting the following text as a comment:
"I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it."
Thanks

@acazacu
Copy link
Author

acazacu commented Aug 30, 2022

I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow
bug http://bugs.mysql.com/bug.php?id=108335 for updates.
Thanks

@PH89
Copy link

PH89 commented Oct 16, 2022

This bug is still present in version 8.0.31.
Can this be merged finally ?

bariscimen added a commit to bariscimen/mysql-connector-python that referenced this pull request Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants