Skip to content

Commit

Permalink
Merge #60515 #60762
Browse files Browse the repository at this point in the history
60515: geo/wkt: add support for parsing geometrycollections with Z and M dims r=otan a=andyyang890

This patch extends the capabilities of the WKT parser to include
parsing of geometrycollections with Z and M dimensions.

Refs: #53091

Release note: None

60762: sql: ensure graceful rollbacks if the ADD REGION async job fails r=otan a=arulajmani

Previously, we assumed that the async component of an
`ALTER DATABASE ... ADD REGION` wouldn't fail. This isn't really true
though, because users may cancel jobs or we may be dropping regions in
the same txn that fails validation.

We have validation that ensures every region (READ ONLY or PUBLIC) on
the multi-region type descriptor is also present on the database
descriptor's region config (and vice-versa). If we realize that a region
can't be promoted from READ ONLY to PUBLIC, we must also remove it from
the database descriptor's region config (in addition removing it from
the type descriptor). Prior to this patch we didn't do so, and cleanup
could potentially fail validation. This patch fixes that behavior. This
is a temporary band-aid until we stop denormalizing region values and
have a single source of truth.

Release note: None

Co-authored-by: Andy Yang <[email protected]>
Co-authored-by: arulajmani <[email protected]>
3 people committed Feb 19, 2021
3 parents 3e4d80d + 163909d + e654937 commit 83e70ce
Showing 8 changed files with 1,589 additions and 533 deletions.
1 change: 1 addition & 0 deletions pkg/geo/geo.go
Original file line number Diff line number Diff line change
@@ -831,6 +831,7 @@ func validateGeomT(t geom.T) error {
}
}
case *geom.GeometryCollection:
// TODO(ayang): verify that the geometries all have the same Layout
for i := 0; i < t.NumGeoms(); i++ {
if err := validateGeomT(t.Geom(i)); err != nil {
return errors.Wrapf(err, "invalid GeometryCollection component at position %d", i+1)
Loading

0 comments on commit 83e70ce

Please sign in to comment.