'Unread result found' error with pyDAL and MySQL

61 views
Skip to first unread message

Giovanni B.

unread,
Feb 15, 2020, 6:32:05 AM2/15/20
to web2py-users
Hello!

I'm currently using pyDAL in a stand-alone application and I'm suffering a problem while trying to interface my code to MySQL databases.
Let's take into account this simple code snippet:
from pydal import DAL, Field

db
= DAL('mysql://user:pass...@127.0.0.1:3306/my_db')
db
.define_table('my_table', Field('my_field_1', 'id'), Field('my_field_2', 'string'))
It raises the following exception:
mysql.connector.errors.InternalError: Unread result found
Poking around with Google, I have found that the problem can be solved by setting buffered=True
in the mySQL cursor definition, however I actually don't know how to do this within pyDAL.

Using Python 3.7.6, pyDAL 20191227.1, MySQL Community Server 8.0.16.
Any suggestions?

Thanks in advance!

Massimo Di Pierro

unread,
Feb 16, 2020, 8:17:06 PM2/16/20
to web2py-users
I pushed a revision that should allow you todo:

DAL(..., driver_args={'cursor_buffered': True})"

(UNTESTED!)

On Saturday, 15 February 2020 03:32:05 UTC-8, Giovanni B. wrote:
Hello!

I'm currently using pyDAL in a stand-alone application and I'm suffering a problem while trying to interface my code to MySQL databases.
Let's take into account this simple code snippet:
from pydal import DAL, Field

db
.define_table('my_table', Field('my_field_1', 'id'), Field('my_field_2', 'string'))
Reply all
Reply to author
Forward
0 new messages