-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
sql, *: simplify remove dependencies on pgerror, util/log #37813
Conversation
62ecc5e
to
082ad10
Compare
eddb962
to
53e49e4
Compare
082ad10
to
39d319a
Compare
53e49e4
to
d93ccf7
Compare
39d319a
to
d406ed0
Compare
d93ccf7
to
5fe37e7
Compare
f9c340a
to
13559ad
Compare
LGTM to everything but the last commit; I'm happy to see these changes. |
Avoid a cyclic dependency (as usual) |
Also it's more readable: "pgcode.Foo" is shorter than "pgwire.CodeFoo" |
Do you remember what the dependency you were breaking was? In any case, LGTM |
5fe37e7
to
3b70f6d
Compare
13559ad
to
8095471
Compare
bf152aa
to
ef803ab
Compare
02d7cc4
to
4f93946
Compare
ef803ab
to
8e58782
Compare
4f93946
to
43b2d5e
Compare
8e58782
to
ae7ade0
Compare
43b2d5e
to
6f21e35
Compare
ae7ade0
to
511f01f
Compare
6f21e35
to
f557ea1
Compare
511f01f
to
dc2b1c1
Compare
f557ea1
to
134b2da
Compare
dc2b1c1
to
7c3c81a
Compare
134b2da
to
9766577
Compare
7c3c81a
to
684b49b
Compare
9766577
to
027161f
Compare
b47b2b1
to
516c985
Compare
A while ago I had changed many calls to `errors.Errorf`/`errors.New`/`fmt.Errorf`/`errors.Wrap` to use `pgerror` error constructors instead. The goal was to ensure the error objects were decorated with safe details suitable for reporting. However using those APIs also required a pg error code, even in cases where none was obviously available. So I chose then to use the pg code "CodeDataException" as a dummy value. Now that the `errors` library is able to annotate errors in all the good ways, the `pgerror` interface is not needed any more. This commit reverts the past change. This change is nearly all mechanical, using perl. The only manual change is to the function `wrapRowErr` in the `importccl` package. Release note: None
... instead of the aliased definitions in `pgerror`. (This change is entirely mechanical, using perl) Release note: None
Release note: None
... where appropriate. This drops the dependency on `util/log` in many cases. (This change was mechanical, using perl) Release note: None
... and remove pgwire/pgerror/codes.go Release note: None
Previously `teamcity-testrace.sh` would run `testrace` passing all the modified packages simultaneously in the PKG make var. This causes `go test` to issue all the tests concurrently, regardless of available hardware. If there are sufficiently many packages modified, this overloads the machines, makes test run much slower than usual, and triggers bad behavior (timeouts). This patch alleviates the potential problem by running the tests one after the other. Release note: None
684b49b
to
dc13807
Compare
516c985
to
6cd22cc
Compare
37121: errors: introduce a general-purpose modular error library with good properties r=knz a=knz This PR introduces an error library implemented after the principles laid out in #36987. It subsumes the following two PRs: - #38127 *: demonstrate uses of the errors library - review approval: #38127 (comment) - #37813 sql, *: simplify remove dependencies on pgerror, util/log - review approval: #37813 (comment) Release note: None Co-authored-by: Raphael 'kena' Poss <[email protected]>
These changes are mostly mechanical (I used grep and perl, followed by crlfmt).
This compacts the source code: overall -300 locs, and shorter lines.