Skip to content

fix error handling during querying result rows #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 23, 2019
Merged

fix error handling during querying result rows #429

merged 2 commits into from
Sep 23, 2019

Conversation

dhlin
Copy link
Contributor

@dhlin dhlin commented Sep 20, 2019

When issuing a long running request with the client, if the query get killed, conn.Execute will be hanging.

How to reproduce:

  1. issue such request below
conn, _ := client.Connect("127.0.0.1:3306", "root", "", "db")
conn.Ping()
r, err := conn.Execute(`select sleep(1000), id from table`)
if err != nil {
    fmt.Println(err)
    return
}
  1. use mysql cli to find the query id with show processlist; and kill the query with kill query id;

the program will hang on conn.Execute and never return.

@siddontang siddontang merged commit 7037937 into go-mysql-org:master Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants