Skip to content

Commit b03514a

Browse files
Parser: 25.2 snapshot (#17)
1 parent 4168c29 commit b03514a

File tree

607 files changed

+86880
-46294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

607 files changed

+86880
-46294
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v3
2121
with:
22-
go-version: 1.21
22+
go-version: 1.23
2323

2424
- name: Build
2525
run: go build -v ./...

go.mod

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,69 @@
11
module github.com/cockroachdb/cockroachdb-parser
22

3-
go 1.21.1
4-
5-
toolchain go1.21.3
3+
go 1.23.8
64

75
require (
86
github.com/bazelbuild/rules_go v0.46.0
97
github.com/biogo/store v0.0.0-20201120204734-aad293a2328f
108
github.com/blevesearch/snowballstem v0.9.0
119
github.com/cockroachdb/apd/v3 v3.1.0
12-
github.com/cockroachdb/errors v1.9.0
10+
github.com/cockroachdb/errors v1.11.3
1311
github.com/cockroachdb/gostdlib v1.19.0
14-
github.com/cockroachdb/redact v1.1.3
12+
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506
13+
github.com/cockroachdb/redact v1.1.5
14+
github.com/cockroachdb/version v0.0.0-20250314144055-3860cd14adf2
1515
github.com/dave/dst v0.27.2
1616
github.com/dustin/go-humanize v1.0.0
17+
github.com/elastic/gosigar v0.14.3
1718
github.com/gogo/protobuf v1.3.2
1819
github.com/golang/geo v0.0.0-20210211234256-740aa86cb551
19-
github.com/google/go-cmp v0.5.8
20+
github.com/google/go-cmp v0.7.0
2021
github.com/grpc-ecosystem/grpc-gateway v1.16.0
22+
github.com/jaegertracing/jaeger v1.18.1
2123
github.com/lib/pq v1.10.6
24+
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5
2225
github.com/pierrre/geohash v1.0.0
26+
github.com/pmezard/go-difflib v1.0.0
2327
github.com/sasha-s/go-deadlock v0.3.1
2428
github.com/spf13/pflag v1.0.5
25-
github.com/stretchr/testify v1.7.0
29+
github.com/stretchr/testify v1.10.0
2630
github.com/twpayne/go-geom v1.4.1
31+
go.opentelemetry.io/otel v1.36.0
32+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0
33+
go.opentelemetry.io/otel/exporters/zipkin v1.36.0
34+
go.opentelemetry.io/otel/sdk v1.36.0
35+
go.opentelemetry.io/otel/trace v1.36.0
2736
golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3
28-
golang.org/x/text v0.14.0
29-
golang.org/x/tools v0.17.0
37+
golang.org/x/net v0.40.0
38+
golang.org/x/sys v0.33.0
39+
golang.org/x/text v0.25.0
40+
golang.org/x/tools v0.26.0
41+
gonum.org/v1/gonum v0.16.0
42+
google.golang.org/grpc v1.72.1
43+
google.golang.org/protobuf v1.36.6
3044
)
3145

3246
require (
33-
github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f // indirect
47+
github.com/cenkalti/backoff/v5 v5.0.2 // indirect
3448
github.com/davecgh/go-spew v1.1.1 // indirect
35-
github.com/getsentry/sentry-go v0.12.0 // indirect
36-
github.com/golang/protobuf v1.5.3 // indirect
37-
github.com/kr/pretty v0.3.0 // indirect
49+
github.com/getsentry/sentry-go v0.27.0 // indirect
50+
github.com/go-logr/logr v1.4.2 // indirect
51+
github.com/go-logr/stdr v1.2.2 // indirect
52+
github.com/golang/protobuf v1.5.4 // indirect
53+
github.com/google/uuid v1.6.0 // indirect
54+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
55+
github.com/kr/pretty v0.3.1 // indirect
3856
github.com/kr/text v0.2.0 // indirect
39-
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
57+
github.com/openzipkin/zipkin-go v0.4.3 // indirect
4058
github.com/pkg/errors v0.9.1 // indirect
41-
github.com/pmezard/go-difflib v1.0.0 // indirect
42-
github.com/rogpeppe/go-internal v1.8.1 // indirect
59+
github.com/rogpeppe/go-internal v1.13.1 // indirect
4360
github.com/twpayne/go-kml v1.5.2 // indirect
44-
golang.org/x/mod v0.14.0 // indirect
45-
golang.org/x/sys v0.15.0 // indirect
46-
google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 // indirect
47-
google.golang.org/grpc v1.40.1 // indirect
48-
google.golang.org/protobuf v1.31.0 // indirect
49-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
61+
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
62+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 // indirect
63+
go.opentelemetry.io/otel/metric v1.36.0 // indirect
64+
go.opentelemetry.io/proto/otlp v1.6.0 // indirect
65+
golang.org/x/mod v0.21.0 // indirect
66+
golang.org/x/sync v0.14.0 // indirect
67+
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
68+
gopkg.in/yaml.v3 v3.0.1 // indirect
5069
)

go.sum

Lines changed: 423 additions & 249 deletions
Large diffs are not rendered by default.

parser_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ func TestParser(t *testing.T) {
1212
p, err := parser.ParseOne("CREATE TABLE t (a TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP)")
1313
require.NoError(t, err)
1414
f := tree.DefaultPrettyCfg()
15-
f.Pretty(p.AST)
15+
t.Log(f.Pretty(p.AST))
1616
}

patches/0002-fix-quote-names.sql renamed to patches/0002-fix-quote-names.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/pkg/sql/sem/tree/type_name.go b/pkg/sql/sem/tree/type_name.go
2-
index 898009a..5d4423a 100644
2+
index 10cd908..98daa0e 100644
33
--- a/pkg/sql/sem/tree/type_name.go
44
+++ b/pkg/sql/sem/tree/type_name.go
5-
@@ -56,8 +56,7 @@ func (t *TypeName) String() string {
5+
@@ -42,8 +42,7 @@ func (t *TypeName) Format(ctx *FmtCtx) {
66

77
// SQLString implements the ResolvableTypeReference interface.
88
func (t *TypeName) SQLString() string {
@@ -11,8 +11,8 @@ index 898009a..5d4423a 100644
1111
+ return AsStringWithFlags(t, FmtSimple)
1212
}
1313

14-
// FQString renders the type name in full, not omitting the prefix
15-
@@ -250,14 +249,12 @@ func (node *ArrayTypeReference) Format(ctx *FmtCtx) {
14+
func (t *TypeName) objectName() {}
15+
@@ -240,14 +239,12 @@ func (node *ArrayTypeReference) Format(ctx *FmtCtx) {
1616

1717
// SQLString implements the ResolvableTypeReference interface.
1818
func (node *ArrayTypeReference) SQLString() string {

patches/0004-enc-always-quoted.patch

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
diff --git a/pkg/sql/lexbase/encode.go b/pkg/sql/lexbase/encode.go
2+
index 0083555..47b9a37 100644
3+
--- a/pkg/sql/lexbase/encode.go
4+
+++ b/pkg/sql/lexbase/encode.go
5+
@@ -49,6 +49,11 @@ const (
6+
// EncFirstFreeFlagBit needs to remain unused; it is used as base
7+
// bit offset for tree.FmtFlags.
8+
EncFirstFreeFlagBit
9+
+
10+
+ // EncAlwaysQuoted makes sure the string is always wrapped with quotes.
11+
+ // This is used only to construct a statement against Oracle source,
12+
+ // as Oracle is case insensitive if object name is not quoted.
13+
+ EncAlwaysQuoted
14+
)
15+
16+
// EncodeRestrictedSQLIdent writes the identifier in s to buf. The
17+
@@ -56,8 +61,7 @@ const (
18+
// contains special characters, or the identifier is a reserved SQL
19+
// keyword.
20+
func EncodeRestrictedSQLIdent(buf *bytes.Buffer, s string, flags EncodeFlags) {
21+
- if flags.HasFlags(EncBareIdentifiers) ||
22+
- (IsBareIdentifier(s) && (flags.HasFlags(EncBareReservedKeywords) || !isReservedKeyword(s))) {
23+
+ if !flags.HasFlags(EncAlwaysQuoted) && (flags.HasFlags(EncBareIdentifiers) || (!isReservedKeyword(s) && IsBareIdentifier(s))) {
24+
buf.WriteString(s)
25+
return
26+
}
27+
@@ -68,7 +72,7 @@ func EncodeRestrictedSQLIdent(buf *bytes.Buffer, s string, flags EncodeFlags) {
28+
// The identifier is only quoted if the flags don't tell otherwise and
29+
// the identifier contains special characters.
30+
func EncodeUnrestrictedSQLIdent(buf *bytes.Buffer, s string, flags EncodeFlags) {
31+
- if flags.HasFlags(EncBareIdentifiers) || IsBareIdentifier(s) {
32+
+ if !flags.HasFlags(EncAlwaysQuoted) && (flags.HasFlags(EncBareIdentifiers) || IsBareIdentifier(s)) {
33+
buf.WriteString(s)
34+
return
35+
}

patches/0004-fix-bazel-compl.patch

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)