[CONPY-112] commands out of sync error w/ simple rollback if cursor is not cloed Created: 2020-09-12 Updated: 2020-09-13 Resolved: 2020-09-13 |
|
| Status: | Closed |
| Project: | MariaDB Connector/Python |
| Component/s: | DBAPI 2.0 |
| Affects Version/s: | 1.0.1 |
| Fix Version/s: | 1.0.2, N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Mike Bayer | Assignee: | Georg Richter |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
fedora 31, mariadb server 10.3.22 |
||
| Description |
|
the following program throws the above mentioned error:
if the cursor is closed first, no error is raised. using other DBAPI drivers such as mysqlclient, mysql-connector, and pymysql, no error is raised with the identical program, generally it's not standard behavior that rollback() fails if a cursor is open, and also if this were part of mariadb-connector's contract, it should raise an informative error that the cursor was not closed when it should have been. I'm also getting segfaults in some similar cases however i dont have a reproducer for that right now. |
| Comments |
| Comment by Georg Richter [ 2020-09-13 ] | |||||||||||||||||||||||||||||||||||||
|
Hi Mike, thanks for your bug report. By default MariaDB Connector/C uses unbuffered result sets (like pymysql.cursor.SSCursor), in SQLAlchemy mariadbconnector.py dialect I added therefore in do_execute a buffered=True (looks like it was removed?!). When using unbuffered cursor in pymysql, I'm getting also an error:, and rollback wasn't executed correctly:
| |||||||||||||||||||||||||||||||||||||
| Comment by Mike Bayer [ 2020-09-13 ] | |||||||||||||||||||||||||||||||||||||
|
ah there you go, the buffered=True got taken out. then there's no bug here (though IMO buffered should be the default), sorry for the noise. | |||||||||||||||||||||||||||||||||||||
| Comment by Mike Bayer [ 2020-09-13 ] | |||||||||||||||||||||||||||||||||||||
|
we do the "buffered / unbuffered" thing at the cursor() level , looks like mariadb connector supports that as well, so that's a better hook for us. thanks! | |||||||||||||||||||||||||||||||||||||
| Comment by Georg Richter [ 2020-09-13 ] | |||||||||||||||||||||||||||||||||||||
|
You're welcome - closing the issue |