Skip to content

Commit

Permalink
*: update pingcap/errors version (#51854)
Browse files Browse the repository at this point in the history
  • Loading branch information
D3Hunter authored Mar 18, 2024
1 parent eea1213 commit c5359ca
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
12 changes: 6 additions & 6 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5897,13 +5897,13 @@ def go_deps():
name = "com_github_pingcap_errors",
build_file_proto_mode = "disable_global",
importpath = "github.com/pingcap/errors",
sha256 = "0223d4f1e587bf6c0cf65fca39ada14d89501a56be1dd0f6a067a7bc628c8938",
strip_prefix = "github.com/pingcap/[email protected].20240311081613-f97970b88865",
sha256 = "99d36c5e5649442d9923d4b1cd7f1242faaf4071844c2e3c77497230b3f38cd7",
strip_prefix = "github.com/pingcap/[email protected].20240318064555-6bd07397691f",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20240311081613-f97970b88865.zip",
"http://ats.apps.svc/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20240311081613-f97970b88865.zip",
"https://cache.hawkingrei.com/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20240311081613-f97970b88865.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20240311081613-f97970b88865.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20240318064555-6bd07397691f.zip",
"http://ats.apps.svc/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20240318064555-6bd07397691f.zip",
"https://cache.hawkingrei.com/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20240318064555-6bd07397691f.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/errors/com_github_pingcap_errors-v0.11.5-0.20240318064555-6bd07397691f.zip",
],
)
go_repository(
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ require (
github.com/otiai10/copy v1.2.0
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
github.com/pingcap/badger v1.5.1-0.20230103063557-828f39b09b6d
github.com/pingcap/errors v0.11.5-0.20240311081613-f97970b88865
github.com/pingcap/errors v0.11.5-0.20240318064555-6bd07397691f
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c
github.com/pingcap/fn v1.0.0
github.com/pingcap/kvproto v0.0.0-20240227073058-929ab83f9754
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,8 @@ github.com/pingcap/badger v1.5.1-0.20230103063557-828f39b09b6d/go.mod h1:p8QnkZn
github.com/pingcap/errors v0.11.0/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
github.com/pingcap/errors v0.11.5-0.20190809092503-95897b64e011/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
github.com/pingcap/errors v0.11.5-0.20240311081613-f97970b88865 h1:xzbnMPvFtnqLsY5HLALUov6JU1ONyfQUXVurE/Nqb8Y=
github.com/pingcap/errors v0.11.5-0.20240311081613-f97970b88865/go.mod h1:X2r9ueLEUZgtx2cIogM0v4Zj5uvvzhuuiu7Pn8HzMPg=
github.com/pingcap/errors v0.11.5-0.20240318064555-6bd07397691f h1:FxA+NgsdHNOv+/hZGxUh8Gb3WuZqgqmxDwztEOiA1v4=
github.com/pingcap/errors v0.11.5-0.20240318064555-6bd07397691f/go.mod h1:X2r9ueLEUZgtx2cIogM0v4Zj5uvvzhuuiu7Pn8HzMPg=
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c h1:CgbKAHto5CQgWM9fSBIvaxsJHuGP0uM74HXtv3MyyGQ=
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c/go.mod h1:4qGtCB0QK0wBzKtFEGDhxXnSnbQApw1gc9siScUl8ew=
github.com/pingcap/fn v1.0.0 h1:CyA6AxcOZkQh52wIqYlAmaVmF6EvrcqFywP463pjA8g=
Expand Down
10 changes: 4 additions & 6 deletions pkg/util/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,10 @@ func SyntaxWarn(err error) error {
}
logutil.BgLogger().Debug("syntax error", zap.Error(err))

// If the warn is already a terror with stack, pass it through.
if errors.HasStack(err) {
cause := errors.Cause(err)
if _, ok := cause.(*terror.Error); ok {
return err
}
// If the "err" is already a terror, pass it through.
cause := errors.Cause(err)
if _, ok := cause.(*terror.Error); ok {
return err
}

return parser.ErrParse.FastGenByArgs(syntaxErrorPrefix, err.Error())
Expand Down
2 changes: 1 addition & 1 deletion tests/integrationtest/r/expression/misc.result
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ Warning 8061 Optimizer hint unknown_hint is not supported by TiDB and is ignored
select 1 from /*+ test1() */ t;
1
Level Code Message
Warning 1064 You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use [parser:8066]Optimizer hint can only be followed by certain keywords like SELECT, INSERT, etc.
Warning 8066 Optimizer hint can only be followed by certain keywords like SELECT, INSERT, etc.
drop table if exists t;
create table t(a bigint, b double, c decimal, d varchar(20), e datetime, f time, g json);
insert into t values(1, 1.1, 2.2, "abc", "2018-10-24", NOW(), "12");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ select count(*) /*+ stream_agg() */ from t where a > 1;
count(*) /*+ stream_agg()
0
Level Code Message
Warning 1064 You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use [parser:8066]Optimizer hint can only be followed by certain keywords like SELECT, INSERT, etc.
Warning 8066 Optimizer hint can only be followed by certain keywords like SELECT, INSERT, etc.
select count(*) from (select count(*) as a /*+ stream_agg() */ from t where b > 1 group by b) t1 where a > 1;
count(*)
0
Level Code Message
Warning 1064 You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use [parser:8066]Optimizer hint can only be followed by certain keywords like SELECT, INSERT, etc.
Warning 8066 Optimizer hint can only be followed by certain keywords like SELECT, INSERT, etc.
set tidb_cost_model_version=2;
drop table if exists t, t1, th;
drop view if exists v, v1;
Expand Down

0 comments on commit c5359ca

Please sign in to comment.