Skip to content
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

program will crash when calling RowNumber() function of Result which is returned by DDL or insert/update/delete statement #577

Open
romberli opened this issue Apr 25, 2021 · 0 comments

Comments

@romberli
Copy link
Contributor

romberli commented Apr 25, 2021

program will panic when calling RowNumber() function of Result which is returned by DDL or insert/update/delete statement

how to repeat:

sql := `create table if not exists t01(id int);`
result, err := conn.Execute(sql)
if err != nil {
    fmt.Println(err.Error())
}
fmt.Println(result.RowNumber())

result.RowNumber() will cause panic, I know getting row number of those statements is meaningless,
but I think it's better to return zero rather than panic the whole program.

how to fix:
I've created a PR #578

@romberli romberli changed the title program will crash when running RowNumber() function of Result which is returned by DDL or insert/update/delete statement program will crash when calling RowNumber() function of Result which is returned by DDL or insert/update/delete statement Apr 25, 2021
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

No branches or pull requests

1 participant