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

Add SQLState to MySQLError #1321

Merged
merged 3 commits into from Apr 13, 2022

Conversation

thopos
Copy link
Contributor

@thopos thopos commented Apr 6, 2022

Description

Allow library users to distinguish user-defined from client / server errors.

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

Copy link
Contributor

@shogo82148 shogo82148 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it needs some little memory allocations, but not so frequently.
#1322 is acceptable for me.

@jmhodges @arnehormann @methane How do you think about it?

packets.go Outdated Show resolved Hide resolved
@thopos thopos force-pushed the report-sqlstate-in-MySQLError branch from 4ab8a7a to 14893f1 Compare April 6, 2022 13:06
packets.go Outdated Show resolved Hide resolved
errors.go Outdated Show resolved Hide resolved
@thopos thopos force-pushed the report-sqlstate-in-MySQLError branch from 14893f1 to c0031c2 Compare April 11, 2022 10:31
shogo82148
shogo82148 previously approved these changes Apr 12, 2022
Copy link
Contributor

@shogo82148 shogo82148 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

errors.go Outdated Show resolved Hide resolved
Copy link
Member

@methane methane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove IsWithSQLState.

to allow library users to distinguish user-defined from client / server errors
@thopos thopos force-pushed the report-sqlstate-in-MySQLError branch from c0031c2 to 0e8599a Compare April 12, 2022 09:32
@methane methane changed the title Report sqlstate in my sql error Add SQLState to MySQLError Apr 13, 2022
errors.go Outdated Show resolved Hide resolved
@methane methane merged commit ad9fa14 into go-sql-driver:master Apr 13, 2022
@thopos
Copy link
Contributor Author

thopos commented Apr 13, 2022

Thank you @shogo82148 and @methane for your patience and thorough review.

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.

None yet

3 participants