MySQL Forums
Forum List  »  Connector/Python

Re: OperationalError: (2013, 'Lost connection to MySQL server during query')
Posted by: Mikael Eiman
Date: July 02, 2006 03:07AM

I had the same, or at least a similar, problem. Turns out that when calling a stored procedure an extra result set is returned, and you need to discard that before executing your next query.

I did something like this:

cursor.callproc("myproc",[oneparam, anotherparam])
res = cursor.fetchall()
while cursor.nextset() != None:
> pass
print res

This will skip any additional result sets, but just a single nextset() should do.

Sorry about the indentation, the ">" is supposed to be a tab but the forum ignored it.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.