Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

Cannot commit a read statement (3 replies)

$
0
0
```
>>> import mysql.connector
>>> cnx = mysql.connector.connect(user="root")
>>> cur = cnx.cursor()
>>> cur.execute('select count(*) from test.test')
>>> cnx.commit()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/homebrew/lib/python3.9/site-packages/mysql/connector/connection.py", line 1229, in commit
self._execute_query("COMMIT")
File "/opt/homebrew/lib/python3.9/site-packages/mysql/connector/connection.py", line 1247, in _execute_query
self.handle_unread_result()
File "/opt/homebrew/lib/python3.9/site-packages/mysql/connector/connection.py", line 1455, in handle_unread_result
raise errors.InternalError("Unread result found")
mysql.connector.errors.InternalError: Unread result found
```

commit a select statement always return a "Unread result found" error. Is this expected? Same code works well with mysqlclient and PyMySQL.

Viewing all articles
Browse latest Browse all 384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>