Skip to content

calling cursor.nextset() after cursor.fetchone() can cause query hang #526

Description

@darkag

hello,

while trying to implement a workaround for this issue on apache airflow (cf. this issue. I've found that the following code:

cursor.execute(sql)
cursor.fetchall()
while cursor.nextset():
        cursor.fetchone()

causes execution hang when sql is two insert queries and the second one causes an error or if the second query is a select the error is not caused by the first rows returned by this select (like when you select col1 / col2 and col2 is 0 for some rows).

It seems that in this case the errormessage is not processed neither in fetchone nor in flush_to_end_of_result function making this one waits for a END_OF_RESULT_RESPONSES message that will never come.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions