@@ -37,7 +37,6 @@ import (
3737 "github.com/cockroachdb/cockroach/pkg/util/errorutil/unimplemented"
3838 "github.com/cockroachdb/cockroach/pkg/util/intsets"
3939 "github.com/cockroachdb/cockroach/pkg/util/json"
40- "github.com/cockroachdb/cockroach/pkg/util/timeutil"
4140 "github.com/cockroachdb/errors"
4241 "github.com/golang/geo/s1"
4342 "github.com/twpayne/go-geom"
@@ -2200,11 +2199,10 @@ Flags shown square brackets after the geometry type have the following meaning:
22002199 tree.Overload {
22012200 Types : tree.ParamTypes {{Name : "geometry" , Typ : types .Geometry }, {Name : "npoints" , Typ : types .Int4 }},
22022201 ReturnType : tree .FixedReturnType (types .Geometry ),
2203- Fn : func (_ context.Context , _ * eval.Context , args tree.Datums ) (tree.Datum , error ) {
2202+ Fn : func (_ context.Context , evalCtx * eval.Context , args tree.Datums ) (tree.Datum , error ) {
22042203 geometry := tree .MustBeDGeometry (args [0 ]).Geometry
22052204 npoints := int (tree .MustBeDInt (args [1 ]))
2206- seed := timeutil .Now ().Unix ()
2207- generatedPoints , err := geomfn .GenerateRandomPoints (geometry , npoints , rand .New (rand .NewSource (seed )))
2205+ generatedPoints , err := geomfn .GenerateRandomPoints (geometry , npoints , evalCtx .GetRNG ())
22082206 if err != nil {
22092207 if errors .Is (err , geomfn .ErrGenerateRandomPointsInvalidPoints ) {
22102208 return tree .DNull , nil
0 commit comments