Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
knz committed Apr 24, 2023
1 parent 26ac56a commit ea78588
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -769,23 +769,23 @@ COCKROACHSHORT := ./cockroachshort$(SUFFIX)
COCKROACHSQL := ./cockroach-sql$(SUFFIX)

LOG_TARGETS = \
pkg/util/log/severity/severity_generated.go \
pkg/util/log/channel/channel_generated.go \
pkg/util/log/eventpb/eventlog_channels_generated.go \
pkg/util/log/eventpb/json_encode_generated.go \
pkg/util/log/log_channels_generated.go
pkg/util/log/severity/severity_generated.go \
pkg/util/log/channel/channel_generated.go \
pkg/util/log/eventpb/eventlog_channels_generated.go \
pkg/util/log/eventpb/json_encode_generated.go \
pkg/util/log/log_channels_generated.go

SQLPARSER_TARGETS = \
pkg/sql/parser/sql.go \
pkg/sql/parser/helpmap_test.go \
pkg/sql/parser/help_messages.go \
pkg/sql/lexbase/tokens.go \
pkg/sql/lexbase/keywords.go \
pkg/sql/lexbase/reserved_keywords.go \
pkg/sql/plpgsql/parser/plpgsql.go \
pkg/sql/plpgsql/parser/lexbase/tokens.go \
pkg/sql/plpgsql/parser/lexbase/keywords.go \
pkg/sql/scanner/token_names_test.go
pkg/sql/parser/sql.go \
pkg/sql/parser/helpmap_test.go \
pkg/sql/parser/help_messages.go \
pkg/sql/lexbase/tokens.go \
pkg/sql/lexbase/keywords.go \
pkg/sql/lexbase/reserved_keywords.go \
pkg/sql/plpgsql/parser/plpgsql.go \
pkg/sql/plpgsql/parser/lexbase/tokens.go \
pkg/sql/plpgsql/parser/lexbase/keywords.go \
pkg/sql/scanner/token_names_test.go

PROTOBUF_TARGETS := bin/.go_protobuf_sources bin/.gw_protobuf_sources
$(PROTOBUF_TARGETS): fake-protobufs
Expand Down Expand Up @@ -1498,6 +1498,7 @@ pkg/sql/lexbase/tokens.go: pkg/sql/parser/gen/sql.go.tmp
echo; \
grep '^const [A-Z][_A-Z0-9]* ' $^) > $@.tmp || rm $@.tmp
mv -f $@.tmp $@

# The lex package is now the primary source for the token constant
# definitions. Modify the code generated by goyacc here to refer to
# the definitions in the lex package.
Expand Down
2 changes: 2 additions & 0 deletions pkg/sql/plpgsql/parser/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
# for reasoning and alternatives).

plpgsql.go
y.output
gen
2 changes: 2 additions & 0 deletions pkg/sql/plpgsql/parser/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ go_library(
"//pkg/sql/parser/statements",
"//pkg/sql/pgwire/pgcode",
"//pkg/sql/pgwire/pgerror",
"//pkg/sql/plpgsql/parser/lexbase",
"//pkg/sql/scanner",
"//pkg/sql/sem/plpgsqltree",
"//pkg/sql/sem/tree",
"//pkg/sql/types",
"@com_github_cockroachdb_errors//:errors",
"@com_github_cockroachdb_redact//:redact", # keep
],
)

Expand Down
5 changes: 4 additions & 1 deletion pkg/sql/plpgsql/parser/plpgsql.y
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ package parser
import (
"fmt"

"github.com/cockroachdb/cockroach/pkg/sql/plpgsql/parser/lexbase"
"github.com/cockroachdb/cockroach/pkg/sql/scanner"
"github.com/cockroachdb/cockroach/pkg/sql/sem/plpgsqltree"
"github.com/cockroachdb/errors"
"github.com/cockroachdb/redact"
)
%}

Expand Down Expand Up @@ -688,7 +690,8 @@ getdiag_item: unreserved_keyword {
case "returned_sqlstate":
$$.val = plpgsqltree.PlpgsqlGetdiagReturnedSqlstate;
default:
setErr(plpgsqllex, errors.New("unrecognized GET DIAGNOSTICS item " + $1 ))
// TODO(jane): Should this use an unimplemented error instead?
setErr(plpgsqllex, errors.Newf("unrecognized GET DIAGNOSTICS item: %s", redact.Safe($1)))
}
}
;
Expand Down

0 comments on commit ea78588

Please sign in to comment.