Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.1.4
-
None
-
Windows 11, PyCharm IDE with a virtualenv. Connecting to an Ubuntu LTS server with MariaDB 1:10.7.3+maria~focal running in Docker.
-
3.10.7
Description
----------------
|
Query: SELECT * FROM REDACTED.employees WHERE pin=%(auth)s
|
cursor.affected_rows: 1
|
cursor.rowcount: 1
|
----------------
|
----------------
|
Query: SELECT employee FROM REDACTED.customer_relations WHERE incremental=%(id)s
|
cursor.affected_rows: 1
|
cursor.rowcount: 1
|
----------------
|
----------------
|
Query: UPDATE REDACTED.customer_relations SET hidden=1 WHERE incremental=%(id)s
|
cursor.affected_rows: 0
|
cursor.rowcount: 0
|
----------------
|
I have a class that handles my database connection and pooling, above is the output directly from an instance of that class. I'm very confused as to why 'rowcount' and 'affected_rows' both return the same result, and neither return the correct rows when running 'UPDATE' on a row. The above is also called before I return the connection back to the pool. At first, I figured it was just MariaDB ignoring the UPDATE because the row wouldn't change. No matter the state of the existing data, both 'affected_rows' and 'rowcount' both return 0.
Edit: My code now randomly works, I apologize for any time I might've wasted. I do not see a clear way to close this issue or delete it. Thank you.