diff --git a/go.mod b/go.mod index 65fea24837..85e82759b1 100644 --- a/go.mod +++ b/go.mod @@ -8,13 +8,13 @@ require ( github.com/PuerkitoBio/goquery v1.8.1 github.com/cockroachdb/apd/v2 v2.0.3-0.20200518165714-d020e156310a github.com/cockroachdb/errors v1.7.5 - github.com/dolthub/dolt/go v0.40.5-0.20241102040242-530b5771ea74 - github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d + github.com/dolthub/dolt/go v0.40.5-0.20241104143128-c2bb78c109df + github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20241104143128-c2bb78c109df github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662 - github.com/dolthub/go-mysql-server v0.18.2-0.20241101230148-2766041c6e96 + github.com/dolthub/go-mysql-server v0.18.2-0.20241104142123-e00c563047c0 github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216 - github.com/dolthub/vitess v0.0.0-20241028204000-267861bc75a0 + github.com/dolthub/vitess v0.0.0-20241104125316-860772ba6683 github.com/fatih/color v1.13.0 github.com/goccy/go-json v0.10.2 github.com/gogo/protobuf v1.3.2 diff --git a/go.sum b/go.sum index 5cb97e406e..26e4c335b5 100644 --- a/go.sum +++ b/go.sum @@ -214,18 +214,18 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dolthub/dolt/go v0.40.5-0.20241102040242-530b5771ea74 h1:Yv/fLhDt22lLJQ3VW4iXcg3CUWG0fhAMPR/qn/PNwck= -github.com/dolthub/dolt/go v0.40.5-0.20241102040242-530b5771ea74/go.mod h1:NecH5h4tFar7J3VcALwVnOzf7ILMKAAIdp5kFlT5w/I= -github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d h1:RZkQeYOrDrOWzCxaP2ttkvg4E2TM9n8lnEsIBLKjqkM= -github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d/go.mod h1:L5RDYZbC9BBWmoU2+TjTekeqqhFXX5EqH9ln00O0stY= +github.com/dolthub/dolt/go v0.40.5-0.20241104143128-c2bb78c109df h1:mz7NOUjQY8A1XxGyV9eE114usQ8vk08ncPjPT4G5wx8= +github.com/dolthub/dolt/go v0.40.5-0.20241104143128-c2bb78c109df/go.mod h1:j8ygGZQrrCQxDBmo0z2O5cj1Wja4DA26/aMjerDGIhw= +github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20241104143128-c2bb78c109df h1:xafyaNR+hSk5TwOhmNkhhrmOZKIOkxAOCiIEUzlIybc= +github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20241104143128-c2bb78c109df/go.mod h1:L5RDYZbC9BBWmoU2+TjTekeqqhFXX5EqH9ln00O0stY= github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 h1:u3PMzfF8RkKd3lB9pZ2bfn0qEG+1Gms9599cr0REMww= github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2/go.mod h1:mIEZOHnFx4ZMQeawhw9rhsj+0zwQj7adVsnBX7t+eKY= github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U= github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0= github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662 h1:aC17hZD6iwzBwwfO5M+3oBT5E5gGRiQPdn+vzpDXqIA= github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168= -github.com/dolthub/go-mysql-server v0.18.2-0.20241101230148-2766041c6e96 h1:pL21juk8jiM0qyvhjncyhC0UvNCspFlqiE9ETYmeVtc= -github.com/dolthub/go-mysql-server v0.18.2-0.20241101230148-2766041c6e96/go.mod h1:jlzVUA+tsjDw6YKbhRsCLHT3OVO6nn4BWrUanECTo3s= +github.com/dolthub/go-mysql-server v0.18.2-0.20241104142123-e00c563047c0 h1:89pFCcn78El3hYvNK11Vx9ez2bQAGSrMu6CLFO0BdXQ= +github.com/dolthub/go-mysql-server v0.18.2-0.20241104142123-e00c563047c0/go.mod h1:0xWs/FBE4xlhlOsAWoGh24SDRHemT7/U1nApu7SNRXg= github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI= github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q= github.com/dolthub/ishell v0.0.0-20240701202509-2b217167d718 h1:lT7hE5k+0nkBdj/1UOSFwjWpNxf+LCApbRHgnCA17XE= @@ -238,8 +238,8 @@ github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216 h1:JWkKRE4 github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216/go.mod h1:e/FIZVvT2IR53HBCAo41NjqgtEnjMJGKca3Y/dAmZaA= github.com/dolthub/swiss v0.1.0 h1:EaGQct3AqeP/MjASHLiH6i4TAmgbG/c4rA6a1bzCOPc= github.com/dolthub/swiss v0.1.0/go.mod h1:BeucyB08Vb1G9tumVN3Vp/pyY4AMUnr9p7Rz7wJ7kAQ= -github.com/dolthub/vitess v0.0.0-20241028204000-267861bc75a0 h1:eeKypNsi1nQmjWxSAAWT6tvRsDWdmll03BozAUUIE4E= -github.com/dolthub/vitess v0.0.0-20241028204000-267861bc75a0/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM= +github.com/dolthub/vitess v0.0.0-20241104125316-860772ba6683 h1:2/RJeUfNAXS7mbBnEr9C36htiCJHk5XldDPzhxtEsME= +github.com/dolthub/vitess v0.0.0-20241104125316-860772ba6683/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= diff --git a/server/node/alter_role.go b/server/node/alter_role.go index ee9de1e199..64aed49f87 100644 --- a/server/node/alter_role.go +++ b/server/node/alter_role.go @@ -39,11 +39,6 @@ var ErrVitessChildCount = errors.NewKind("invalid vitess child count, expected ` var _ sql.ExecSourceRel = (*AlterRole)(nil) var _ vitess.Injectable = (*AlterRole)(nil) -// CheckPrivileges implements the interface sql.ExecSourceRel. -func (c *AlterRole) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool { - return true -} - // Children implements the interface sql.ExecSourceRel. func (c *AlterRole) Children() []sql.Node { return nil diff --git a/server/node/context_root_finalizer.go b/server/node/context_root_finalizer.go index c6fcfd59dc..92d2446242 100644 --- a/server/node/context_root_finalizer.go +++ b/server/node/context_root_finalizer.go @@ -35,11 +35,6 @@ func NewContextRootFinalizer(child sql.Node) *ContextRootFinalizer { } } -// CheckPrivileges implements the interface sql.ExecSourceRel. -func (rf *ContextRootFinalizer) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool { - return rf.child.CheckPrivileges(ctx, opChecker) -} - // Child returns the single child of this node func (rf *ContextRootFinalizer) Child() sql.Node { return rf.child diff --git a/server/node/copy_from.go b/server/node/copy_from.go index d34488b1e7..977863207d 100644 --- a/server/node/copy_from.go +++ b/server/node/copy_from.go @@ -30,6 +30,8 @@ import ( "github.com/dolthub/doltgresql/postgres/parser/sem/tree" ) +// TODO: Privilege Checking: https://www.postgresql.org/docs/15/sql-copy.html + // CopyFrom handles the COPY ... FROM ... statement. type CopyFrom struct { DatabaseName string @@ -64,13 +66,6 @@ func NewCopyFrom(databaseName string, tableName doltdb.TableName, options tree.C } } -// CheckPrivileges implements the interface sql.ExecSourceRel. -func (cf *CopyFrom) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool { - // https://www.postgresql.org/docs/15/sql-copy.html - // ... database superusers or users who are granted one of the roles `pg_read_server_files`, `pg_write_server_files`, or `pg_execute_server_program` ... - return true -} - // Children implements the interface sql.ExecSourceRel. func (cf *CopyFrom) Children() []sql.Node { return nil diff --git a/server/node/create_domain.go b/server/node/create_domain.go index ad276d8e9a..0cdf983e33 100644 --- a/server/node/create_domain.go +++ b/server/node/create_domain.go @@ -41,11 +41,6 @@ type CreateDomain struct { var _ sql.ExecSourceRel = (*CreateDomain)(nil) var _ vitess.Injectable = (*CreateDomain)(nil) -// CheckPrivileges implements the interface sql.ExecSourceRel. -func (c *CreateDomain) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool { - return true -} - // Children implements the interface sql.ExecSourceRel. func (c *CreateDomain) Children() []sql.Node { return nil diff --git a/server/node/create_role.go b/server/node/create_role.go index 6fc681c8e7..e69ca9aa2d 100644 --- a/server/node/create_role.go +++ b/server/node/create_role.go @@ -51,11 +51,6 @@ type CreateRole struct { var _ sql.ExecSourceRel = (*CreateRole)(nil) var _ vitess.Injectable = (*CreateRole)(nil) -// CheckPrivileges implements the interface sql.ExecSourceRel. -func (c *CreateRole) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool { - return true -} - // Children implements the interface sql.ExecSourceRel. func (c *CreateRole) Children() []sql.Node { return nil diff --git a/server/node/create_sequence.go b/server/node/create_sequence.go index fffb154a5e..6a51e47ddd 100644 --- a/server/node/create_sequence.go +++ b/server/node/create_sequence.go @@ -46,12 +46,6 @@ func NewCreateSequence(ifNotExists bool, schema string, sequence *sequences.Sequ } } -// CheckPrivileges implements the interface sql.ExecSourceRel. -func (c *CreateSequence) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool { - // TODO: implement privilege checking - return true -} - // Children implements the interface sql.ExecSourceRel. func (c *CreateSequence) Children() []sql.Node { return nil diff --git a/server/node/create_table.go b/server/node/create_table.go index 34231da441..10c8d1487d 100644 --- a/server/node/create_table.go +++ b/server/node/create_table.go @@ -38,11 +38,6 @@ func NewCreateTable(createTable *plan.CreateTable, sequences []*CreateSequence) } } -// CheckPrivileges implements the interface sql.ExecSourceRel. -func (c *CreateTable) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool { - return c.gmsCreateTable.CheckPrivileges(ctx, opChecker) -} - // Children implements the interface sql.ExecSourceRel. func (c *CreateTable) Children() []sql.Node { return c.gmsCreateTable.Children() diff --git a/server/node/discard.go b/server/node/discard.go index 0408fd68cb..6ede1553b0 100755 --- a/server/node/discard.go +++ b/server/node/discard.go @@ -27,11 +27,6 @@ type DiscardStatement struct{} var _ vitess.Injectable = DiscardStatement{} var _ sql.ExecSourceRel = DiscardStatement{} -// CheckPrivileges implements the interface sql.ExecSourceRel. -func (d DiscardStatement) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool { - return true -} - // Children implements the interface sql.ExecSourceRel. func (d DiscardStatement) Children() []sql.Node { return nil diff --git a/server/node/drop_domain.go b/server/node/drop_domain.go index 393b0eb949..7368629ffa 100644 --- a/server/node/drop_domain.go +++ b/server/node/drop_domain.go @@ -48,11 +48,6 @@ func NewDropDomain(ifExists bool, db string, schema string, domain string, casca } } -// CheckPrivileges implements the interface sql.ExecSourceRel. -func (c *DropDomain) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool { - return true -} - // Children implements the interface sql.ExecSourceRel. func (c *DropDomain) Children() []sql.Node { return nil diff --git a/server/node/drop_role.go b/server/node/drop_role.go index be97f9d937..4a9a57941e 100644 --- a/server/node/drop_role.go +++ b/server/node/drop_role.go @@ -33,11 +33,6 @@ type DropRole struct { var _ sql.ExecSourceRel = (*DropRole)(nil) var _ vitess.Injectable = (*DropRole)(nil) -// CheckPrivileges implements the interface sql.ExecSourceRel. -func (c *DropRole) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool { - return true -} - // Children implements the interface sql.ExecSourceRel. func (c *DropRole) Children() []sql.Node { return nil diff --git a/server/node/drop_sequence.go b/server/node/drop_sequence.go index 5057d9eabc..759c3194a4 100644 --- a/server/node/drop_sequence.go +++ b/server/node/drop_sequence.go @@ -46,12 +46,6 @@ func NewDropSequence(ifExists bool, schema string, sequence string, cascade bool } } -// CheckPrivileges implements the interface sql.ExecSourceRel. -func (c *DropSequence) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool { - // TODO: implement privilege checking - return true -} - // Children implements the interface sql.ExecSourceRel. func (c *DropSequence) Children() []sql.Node { return nil