diff --git a/AUTHORS b/AUTHORS index c311a429698c..8bf18e3c8818 100644 --- a/AUTHORS +++ b/AUTHORS @@ -342,6 +342,7 @@ Yang Yuting yangliang9004 Yevgeniy Miretskiy Yosi Attias +Yufen Huang yuhit Yulei Xiao <21739034@qq.com> YZ Chin diff --git a/docs/generated/eventlog.md b/docs/generated/eventlog.md index 8bf61fb533a9..e13805d53450 100644 --- a/docs/generated/eventlog.md +++ b/docs/generated/eventlog.md @@ -1030,6 +1030,30 @@ encounters a problem and is reversed. | `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | | `MutationID` | The descriptor mutation that this schema change was processing. | no | +### `set_schema` + +An event of type `set_schema` is recorded when a table, view, sequence or type's schema is changed. + + +| Field | Description | Sensitive | +|--|--|--| +| `DescriptorName` | The old name of the affected descriptor. | yes | +| `NewDescriptorName` | The new name of the affected descriptor. | yes | +| `DescriptorType` | The descriptor type being changed (table, view, sequence, type). | yes | + + +#### Common fields + +| Field | Description | Sensitive | +|--|--|--| +| `Timestamp` | The timestamp of the event. Expressed as nanoseconds since the Unix epoch. | no | +| `EventType` | The type of the event. | no | +| `Statement` | A normalized copy of the SQL statement that triggered the event. | yes | +| `User` | The user account that triggered the event. | yes | +| `DescriptorID` | The primary object descriptor affected by the operation. Set to zero for operations that don't affect descriptors. | no | +| `ApplicationName` | The application name for the session where the event was emitted. This is included in the event to ease filtering of logging output by application. | yes | +| `PlaceholderValues` | The mapping of SQL placeholders to their values, for prepared statements. | yes | + ### `truncate_table` An event of type `truncate_table` is recorded when a table is truncated. diff --git a/pkg/sql/alter_table.go b/pkg/sql/alter_table.go index e159a79d068f..f24346f6119a 100644 --- a/pkg/sql/alter_table.go +++ b/pkg/sql/alter_table.go @@ -444,7 +444,7 @@ func (n *alterTableNode) startExec(params runParams) error { } droppedViews = append(droppedViews, cascadedViews...) - droppedViews = append(droppedViews, qualifiedView.String()) + droppedViews = append(droppedViews, qualifiedView.FQString()) } // We cannot remove this column if there are computed columns that use it. diff --git a/pkg/sql/alter_table_owner.go b/pkg/sql/alter_table_owner.go index cf114f6c45e5..c54138154a79 100644 --- a/pkg/sql/alter_table_owner.go +++ b/pkg/sql/alter_table_owner.go @@ -121,7 +121,7 @@ func (p *planner) checkCanAlterTableAndSetNewOwner( return p.logEvent(ctx, desc.ID, &eventpb.AlterTableOwner{ - TableName: tn.String(), + TableName: tn.FQString(), Owner: newOwner.Normalized(), }) } diff --git a/pkg/sql/alter_table_set_schema.go b/pkg/sql/alter_table_set_schema.go index af72213a3600..cfd9c8514360 100644 --- a/pkg/sql/alter_table_set_schema.go +++ b/pkg/sql/alter_table_set_schema.go @@ -21,6 +21,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" "github.com/cockroachdb/cockroach/pkg/sql/privilege" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" + "github.com/cockroachdb/cockroach/pkg/util/log/eventpb" ) type alterTableSetSchemaNode struct { @@ -100,6 +101,12 @@ func (n *alterTableSetSchemaNode) startExec(params runParams) error { schemaID := tableDesc.GetParentSchemaID() databaseID := tableDesc.GetParentID() + kind := tree.GetTableType(tableDesc.IsSequence(), tableDesc.IsView(), tableDesc.GetIsMaterializedView()) + oldName, err := p.getQualifiedTableName(ctx, tableDesc) + if err != nil { + return err + } + desiredSchemaID, err := p.prepareSetSchema(ctx, tableDesc, n.newSchema) if err != nil { return err @@ -140,7 +147,25 @@ func (n *alterTableSetSchemaNode) startExec(params runParams) error { newTbKey := catalogkv.MakeObjectNameKey(ctx, p.ExecCfg().Settings, databaseID, desiredSchemaID, tableDesc.Name) - return p.writeNameKey(ctx, newTbKey, tableDesc.ID) + if err := p.writeNameKey(ctx, newTbKey, tableDesc.ID); err != nil { + return err + } + + newName, err := p.getQualifiedTableName(ctx, tableDesc) + if err != nil { + return err + } + + return p.logEvent(ctx, + desiredSchemaID, + &eventpb.SetSchema{ + CommonEventDetails: eventpb.CommonEventDetails{}, + CommonSQLEventDetails: eventpb.CommonSQLEventDetails{}, + DescriptorName: oldName.FQString(), + NewDescriptorName: newName.FQString(), + DescriptorType: kind, + }, + ) } // ReadingOwnWrites implements the planNodeReadingOwnWrites interface. diff --git a/pkg/sql/alter_type.go b/pkg/sql/alter_type.go index 9d404178aa8a..c09a530d5990 100644 --- a/pkg/sql/alter_type.go +++ b/pkg/sql/alter_type.go @@ -297,6 +297,11 @@ func (p *planner) setTypeSchema(ctx context.Context, n *alterTypeNode, schema st typeDesc := n.desc schemaID := typeDesc.GetParentSchemaID() + oldName, err := p.getQualifiedTypeName(ctx, typeDesc) + if err != nil { + return err + } + desiredSchemaID, err := p.prepareSetSchema(ctx, typeDesc, schema) if err != nil { return err @@ -321,8 +326,26 @@ func (p *planner) setTypeSchema(ctx context.Context, n *alterTypeNode, schema st return err } - return p.performRenameTypeDesc( + if err := p.performRenameTypeDesc( ctx, arrayDesc, arrayDesc.Name, desiredSchemaID, tree.AsStringWithFQNames(n.n, p.Ann()), + ); err != nil { + return err + } + + newName, err := p.getQualifiedTypeName(ctx, typeDesc) + if err != nil { + return err + } + + return p.logEvent(ctx, + desiredSchemaID, + &eventpb.SetSchema{ + CommonEventDetails: eventpb.CommonEventDetails{}, + CommonSQLEventDetails: eventpb.CommonSQLEventDetails{}, + DescriptorName: oldName.FQString(), + NewDescriptorName: newName.FQString(), + DescriptorType: "type", + }, ) } diff --git a/pkg/sql/comment_on_column.go b/pkg/sql/comment_on_column.go index 9a891c60943d..7005b414b8fd 100644 --- a/pkg/sql/comment_on_column.go +++ b/pkg/sql/comment_on_column.go @@ -102,7 +102,7 @@ func (n *commentOnColumnNode) startExec(params runParams) error { return params.p.logEvent(params.ctx, n.tableDesc.ID, &eventpb.CommentOnColumn{ - TableName: tn.String(), + TableName: tn.FQString(), ColumnName: string(n.n.ColumnItem.ColumnName), Comment: comment, NullComment: n.n.Comment == nil, diff --git a/pkg/sql/comment_on_index.go b/pkg/sql/comment_on_index.go index d61ea4abe77a..ae1cbe76d19d 100644 --- a/pkg/sql/comment_on_index.go +++ b/pkg/sql/comment_on_index.go @@ -78,7 +78,7 @@ func (n *commentOnIndexNode) startExec(params runParams) error { return params.p.logEvent(params.ctx, n.tableDesc.ID, &eventpb.CommentOnIndex{ - TableName: tn.String(), + TableName: tn.FQString(), IndexName: string(n.n.Index.Index), Comment: comment, NullComment: n.n.Comment == nil, diff --git a/pkg/sql/drop_index.go b/pkg/sql/drop_index.go index 89e42f1f2e93..d4e0df5cefb8 100644 --- a/pkg/sql/drop_index.go +++ b/pkg/sql/drop_index.go @@ -430,7 +430,7 @@ func (p *planner) dropIndexByName( return err } - droppedViews = append(droppedViews, qualifiedView.String()) + droppedViews = append(droppedViews, qualifiedView.FQString()) droppedViews = append(droppedViews, cascadedViews...) } } diff --git a/pkg/sql/drop_table.go b/pkg/sql/drop_table.go index 5035eb60b866..342937650c7e 100644 --- a/pkg/sql/drop_table.go +++ b/pkg/sql/drop_table.go @@ -353,7 +353,7 @@ func (p *planner) dropTableImpl( } droppedViews = append(droppedViews, cascadedViews...) - droppedViews = append(droppedViews, qualifiedView.String()) + droppedViews = append(droppedViews, qualifiedView.FQString()) } err := p.removeTableComments(ctx, tableDesc) diff --git a/pkg/sql/drop_view.go b/pkg/sql/drop_view.go index 01a5ed59256b..1642c663142a 100644 --- a/pkg/sql/drop_view.go +++ b/pkg/sql/drop_view.go @@ -234,7 +234,7 @@ func (p *planner) dropViewImpl( return cascadeDroppedViews, err } cascadeDroppedViews = append(cascadeDroppedViews, cascadedViews...) - cascadeDroppedViews = append(cascadeDroppedViews, qualifiedView.String()) + cascadeDroppedViews = append(cascadeDroppedViews, qualifiedView.FQString()) } } diff --git a/pkg/sql/logictest/testdata/logic_test/event_log b/pkg/sql/logictest/testdata/logic_test/event_log index d9acae288c15..be7d72ee061c 100644 --- a/pkg/sql/logictest/testdata/logic_test/event_log +++ b/pkg/sql/logictest/testdata/logic_test/event_log @@ -951,6 +951,40 @@ WHERE "eventType" = 'comment_on_table' ---- 1 {"Comment": "This is a table.", "EventType": "comment_on_table", "Statement": "COMMENT ON TABLE defaultdb.public.a IS 'This is a table.'", "TableName": "defaultdb.public.a", "User": "root"} +# Test the event logs generated by commands that set schemas. +subtest set_schema + +statement ok +ALTER TABLE a SET SCHEMA testing + +statement ok +CREATE SEQUENCE s + +statement ok +CREATE SCHEMA test_sc + +statement ok +ALTER SEQUENCE s SET SCHEMA testing + +statement ok +CREATE VIEW v AS SELECT 1 + +statement ok +ALTER VIEW v SET SCHEMA test_sc + +query IT +SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID' +FROM system.eventlog +WHERE "eventType" = 'set_schema' +ORDER BY "timestamp", info +---- +1 {"DescriptorName": "defaultdb.public.eventlog", "DescriptorType": "type", "EventType": "set_schema", "NewDescriptorName": "defaultdb.testing.eventlog", "Statement": "ALTER TYPE defaultdb.public.eventlog SET SCHEMA testing", "User": "root"} +1 {"DescriptorName": "defaultdb.testing.eventlog", "DescriptorType": "type", "EventType": "set_schema", "NewDescriptorName": "defaultdb.public.eventlog", "Statement": "ALTER TYPE defaultdb.testing.eventlog SET SCHEMA public", "User": "root"} +1 {"DescriptorName": "defaultdb.public.a", "DescriptorType": "table", "EventType": "set_schema", "NewDescriptorName": "defaultdb.testing.a", "Statement": "ALTER TABLE a SET SCHEMA testing", "User": "root"} +1 {"DescriptorName": "defaultdb.public.s", "DescriptorType": "sequence", "EventType": "set_schema", "NewDescriptorName": "defaultdb.testing.s", "Statement": "ALTER SEQUENCE s SET SCHEMA testing", "User": "root"} +1 {"DescriptorName": "defaultdb.public.v", "DescriptorType": "view", "EventType": "set_schema", "NewDescriptorName": "defaultdb.test_sc.v", "Statement": "ALTER VIEW v SET SCHEMA test_sc", "User": "root"} + + # Test the event logs generated by commands that drop views. subtest eventlog_dropped_views diff --git a/pkg/sql/reparent_database.go b/pkg/sql/reparent_database.go index f076c1cf8447..295bdf971b0c 100644 --- a/pkg/sql/reparent_database.go +++ b/pkg/sql/reparent_database.go @@ -191,18 +191,18 @@ func (n *reparentDatabaseNode) startExec(params runParams) error { for _, ref := range tbl.GetDependedOnBy() { dep, err := p.Descriptors().GetMutableTableVersionByID(ctx, ref.ID, p.txn) if err != nil { - return errors.Wrapf(err, errStr, n.db.Name, tblName.String()) + return errors.Wrapf(err, errStr, n.db.Name, tblName.FQString()) } fqName, err := p.getQualifiedTableName(ctx, dep) if err != nil { return errors.Wrapf(err, errStr, n.db.Name, dep.Name) } - names = append(names, fqName.String()) + names = append(names, fqName.FQString()) } return sqlerrors.NewDependentObjectErrorf( "could not convert database %q into schema because %q has dependent objects %v", n.db.Name, - tblName.String(), + tblName.FQString(), names, ) } diff --git a/pkg/sql/resolver.go b/pkg/sql/resolver.go index d8fc88e08665..8306ab18132e 100644 --- a/pkg/sql/resolver.go +++ b/pkg/sql/resolver.go @@ -448,6 +448,33 @@ func (p *planner) getQualifiedSchemaName( }, nil } +// getQualifiedTypeName returns the database-qualified name of the type +// represented by the provided descriptor. +func (p *planner) getQualifiedTypeName( + ctx context.Context, desc catalog.TypeDescriptor, +) (*tree.TypeName, error) { + dbDesc, err := p.Descriptors().GetImmutableDatabaseByID(ctx, p.txn, desc.GetParentID(), tree.DatabaseLookupFlags{ + Required: true, + }) + if err != nil { + return nil, err + } + + schemaID := desc.GetParentSchemaID() + resolvedSchema, err := p.Descriptors().GetImmutableSchemaByID(ctx, p.txn, schemaID, tree.SchemaLookupFlags{}) + if err != nil { + return nil, err + } + + typeName := tree.MakeNewQualifiedTypeName( + dbDesc.GetName(), + resolvedSchema.Name, + desc.GetName(), + ) + + return &typeName, nil +} + // findTableContainingIndex returns the descriptor of a table // containing the index of the given name. // This is used by expandMutableIndexName(). diff --git a/pkg/util/log/eventpb/ddl_events.pb.go b/pkg/util/log/eventpb/ddl_events.pb.go index 8f468a6fc7ff..fdca8ca376cf 100644 --- a/pkg/util/log/eventpb/ddl_events.pb.go +++ b/pkg/util/log/eventpb/ddl_events.pb.go @@ -32,7 +32,7 @@ func (m *CreateDatabase) Reset() { *m = CreateDatabase{} } func (m *CreateDatabase) String() string { return proto.CompactTextString(m) } func (*CreateDatabase) ProtoMessage() {} func (*CreateDatabase) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{0} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{0} } func (m *CreateDatabase) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -71,7 +71,7 @@ func (m *DropDatabase) Reset() { *m = DropDatabase{} } func (m *DropDatabase) String() string { return proto.CompactTextString(m) } func (*DropDatabase) ProtoMessage() {} func (*DropDatabase) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{1} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{1} } func (m *DropDatabase) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -110,7 +110,7 @@ func (m *AlterDatabaseAddRegion) Reset() { *m = AlterDatabaseAddRegion{} func (m *AlterDatabaseAddRegion) String() string { return proto.CompactTextString(m) } func (*AlterDatabaseAddRegion) ProtoMessage() {} func (*AlterDatabaseAddRegion) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{2} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{2} } func (m *AlterDatabaseAddRegion) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -149,7 +149,7 @@ func (m *AlterDatabasePrimaryRegion) Reset() { *m = AlterDatabasePrimary func (m *AlterDatabasePrimaryRegion) String() string { return proto.CompactTextString(m) } func (*AlterDatabasePrimaryRegion) ProtoMessage() {} func (*AlterDatabasePrimaryRegion) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{3} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{3} } func (m *AlterDatabasePrimaryRegion) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -188,7 +188,7 @@ func (m *AlterDatabaseSurvivalGoal) Reset() { *m = AlterDatabaseSurvival func (m *AlterDatabaseSurvivalGoal) String() string { return proto.CompactTextString(m) } func (*AlterDatabaseSurvivalGoal) ProtoMessage() {} func (*AlterDatabaseSurvivalGoal) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{4} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{4} } func (m *AlterDatabaseSurvivalGoal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -227,7 +227,7 @@ func (m *RenameDatabase) Reset() { *m = RenameDatabase{} } func (m *RenameDatabase) String() string { return proto.CompactTextString(m) } func (*RenameDatabase) ProtoMessage() {} func (*RenameDatabase) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{5} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{5} } func (m *RenameDatabase) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -266,7 +266,7 @@ func (m *ConvertToSchema) Reset() { *m = ConvertToSchema{} } func (m *ConvertToSchema) String() string { return proto.CompactTextString(m) } func (*ConvertToSchema) ProtoMessage() {} func (*ConvertToSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{6} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{6} } func (m *ConvertToSchema) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,7 +305,7 @@ func (m *CreateSchema) Reset() { *m = CreateSchema{} } func (m *CreateSchema) String() string { return proto.CompactTextString(m) } func (*CreateSchema) ProtoMessage() {} func (*CreateSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{7} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{7} } func (m *CreateSchema) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -342,7 +342,7 @@ func (m *DropSchema) Reset() { *m = DropSchema{} } func (m *DropSchema) String() string { return proto.CompactTextString(m) } func (*DropSchema) ProtoMessage() {} func (*DropSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{8} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{8} } func (m *DropSchema) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -381,7 +381,7 @@ func (m *RenameSchema) Reset() { *m = RenameSchema{} } func (m *RenameSchema) String() string { return proto.CompactTextString(m) } func (*RenameSchema) ProtoMessage() {} func (*RenameSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{9} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{9} } func (m *RenameSchema) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -406,6 +406,47 @@ func (m *RenameSchema) XXX_DiscardUnknown() { var xxx_messageInfo_RenameSchema proto.InternalMessageInfo +// SetSchema is recorded when a table, view, sequence or type's schema is changed. +type SetSchema struct { + CommonEventDetails `protobuf:"bytes,1,opt,name=common,proto3,embedded=common" json:""` + CommonSQLEventDetails `protobuf:"bytes,2,opt,name=sql,proto3,embedded=sql" json:""` + // The old name of the affected descriptor. + DescriptorName string `protobuf:"bytes,3,opt,name=descriptor_name,json=descriptorName,proto3" json:",omitempty"` + // The new name of the affected descriptor. + NewDescriptorName string `protobuf:"bytes,4,opt,name=new_descriptor_name,json=newDescriptorName,proto3" json:",omitempty"` + // The descriptor type being changed (table, view, sequence, type). + DescriptorType string `protobuf:"bytes,5,opt,name=descriptor_type,json=descriptorType,proto3" json:",omitempty"` +} + +func (m *SetSchema) Reset() { *m = SetSchema{} } +func (m *SetSchema) String() string { return proto.CompactTextString(m) } +func (*SetSchema) ProtoMessage() {} +func (*SetSchema) Descriptor() ([]byte, []int) { + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{10} +} +func (m *SetSchema) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SetSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (dst *SetSchema) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetSchema.Merge(dst, src) +} +func (m *SetSchema) XXX_Size() int { + return m.Size() +} +func (m *SetSchema) XXX_DiscardUnknown() { + xxx_messageInfo_SetSchema.DiscardUnknown(m) +} + +var xxx_messageInfo_SetSchema proto.InternalMessageInfo + // CreateTable is recorded when a table is created. type CreateTable struct { CommonEventDetails `protobuf:"bytes,1,opt,name=common,proto3,embedded=common" json:""` @@ -420,7 +461,7 @@ func (m *CreateTable) Reset() { *m = CreateTable{} } func (m *CreateTable) String() string { return proto.CompactTextString(m) } func (*CreateTable) ProtoMessage() {} func (*CreateTable) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{10} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{11} } func (m *CreateTable) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -459,7 +500,7 @@ func (m *DropTable) Reset() { *m = DropTable{} } func (m *DropTable) String() string { return proto.CompactTextString(m) } func (*DropTable) ProtoMessage() {} func (*DropTable) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{11} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{12} } func (m *DropTable) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -498,7 +539,7 @@ func (m *RenameTable) Reset() { *m = RenameTable{} } func (m *RenameTable) String() string { return proto.CompactTextString(m) } func (*RenameTable) ProtoMessage() {} func (*RenameTable) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{12} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{13} } func (m *RenameTable) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -535,7 +576,7 @@ func (m *TruncateTable) Reset() { *m = TruncateTable{} } func (m *TruncateTable) String() string { return proto.CompactTextString(m) } func (*TruncateTable) ProtoMessage() {} func (*TruncateTable) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{13} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{14} } func (m *TruncateTable) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -576,7 +617,7 @@ func (m *AlterTable) Reset() { *m = AlterTable{} } func (m *AlterTable) String() string { return proto.CompactTextString(m) } func (*AlterTable) ProtoMessage() {} func (*AlterTable) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{14} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{15} } func (m *AlterTable) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -619,7 +660,7 @@ func (m *CommentOnColumn) Reset() { *m = CommentOnColumn{} } func (m *CommentOnColumn) String() string { return proto.CompactTextString(m) } func (*CommentOnColumn) ProtoMessage() {} func (*CommentOnColumn) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{15} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{16} } func (m *CommentOnColumn) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -660,7 +701,7 @@ func (m *CommentOnDatabase) Reset() { *m = CommentOnDatabase{} } func (m *CommentOnDatabase) String() string { return proto.CompactTextString(m) } func (*CommentOnDatabase) ProtoMessage() {} func (*CommentOnDatabase) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{16} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{17} } func (m *CommentOnDatabase) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -701,7 +742,7 @@ func (m *CommentOnTable) Reset() { *m = CommentOnTable{} } func (m *CommentOnTable) String() string { return proto.CompactTextString(m) } func (*CommentOnTable) ProtoMessage() {} func (*CommentOnTable) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{17} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{18} } func (m *CommentOnTable) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -744,7 +785,7 @@ func (m *CommentOnIndex) Reset() { *m = CommentOnIndex{} } func (m *CommentOnIndex) String() string { return proto.CompactTextString(m) } func (*CommentOnIndex) ProtoMessage() {} func (*CommentOnIndex) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{18} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{19} } func (m *CommentOnIndex) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -785,7 +826,7 @@ func (m *CreateIndex) Reset() { *m = CreateIndex{} } func (m *CreateIndex) String() string { return proto.CompactTextString(m) } func (*CreateIndex) ProtoMessage() {} func (*CreateIndex) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{19} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{20} } func (m *CreateIndex) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -828,7 +869,7 @@ func (m *DropIndex) Reset() { *m = DropIndex{} } func (m *DropIndex) String() string { return proto.CompactTextString(m) } func (*DropIndex) ProtoMessage() {} func (*DropIndex) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{20} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{21} } func (m *DropIndex) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -869,7 +910,7 @@ func (m *AlterIndex) Reset() { *m = AlterIndex{} } func (m *AlterIndex) String() string { return proto.CompactTextString(m) } func (*AlterIndex) ProtoMessage() {} func (*AlterIndex) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{21} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{22} } func (m *AlterIndex) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -910,7 +951,7 @@ func (m *CreateView) Reset() { *m = CreateView{} } func (m *CreateView) String() string { return proto.CompactTextString(m) } func (*CreateView) ProtoMessage() {} func (*CreateView) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{22} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{23} } func (m *CreateView) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -949,7 +990,7 @@ func (m *DropView) Reset() { *m = DropView{} } func (m *DropView) String() string { return proto.CompactTextString(m) } func (*DropView) ProtoMessage() {} func (*DropView) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{23} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{24} } func (m *DropView) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -988,7 +1029,7 @@ func (m *CreateSequence) Reset() { *m = CreateSequence{} } func (m *CreateSequence) String() string { return proto.CompactTextString(m) } func (*CreateSequence) ProtoMessage() {} func (*CreateSequence) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{24} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{25} } func (m *CreateSequence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1025,7 +1066,7 @@ func (m *DropSequence) Reset() { *m = DropSequence{} } func (m *DropSequence) String() string { return proto.CompactTextString(m) } func (*DropSequence) ProtoMessage() {} func (*DropSequence) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{25} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{26} } func (m *DropSequence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1062,7 +1103,7 @@ func (m *AlterSequence) Reset() { *m = AlterSequence{} } func (m *AlterSequence) String() string { return proto.CompactTextString(m) } func (*AlterSequence) ProtoMessage() {} func (*AlterSequence) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{26} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{27} } func (m *AlterSequence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1110,7 +1151,7 @@ func (m *CommonSchemaChangeEventDetails) Reset() { *m = CommonSchemaChan func (m *CommonSchemaChangeEventDetails) String() string { return proto.CompactTextString(m) } func (*CommonSchemaChangeEventDetails) ProtoMessage() {} func (*CommonSchemaChangeEventDetails) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{27} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{28} } func (m *CommonSchemaChangeEventDetails) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1151,7 +1192,7 @@ func (m *ReverseSchemaChange) Reset() { *m = ReverseSchemaChange{} } func (m *ReverseSchemaChange) String() string { return proto.CompactTextString(m) } func (*ReverseSchemaChange) ProtoMessage() {} func (*ReverseSchemaChange) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{28} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{29} } func (m *ReverseSchemaChange) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1187,7 +1228,7 @@ func (m *FinishSchemaChange) Reset() { *m = FinishSchemaChange{} } func (m *FinishSchemaChange) String() string { return proto.CompactTextString(m) } func (*FinishSchemaChange) ProtoMessage() {} func (*FinishSchemaChange) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{29} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{30} } func (m *FinishSchemaChange) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1223,7 +1264,7 @@ func (m *FinishSchemaChangeRollback) Reset() { *m = FinishSchemaChangeRo func (m *FinishSchemaChangeRollback) String() string { return proto.CompactTextString(m) } func (*FinishSchemaChangeRollback) ProtoMessage() {} func (*FinishSchemaChangeRollback) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{30} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{31} } func (m *FinishSchemaChangeRollback) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1262,7 +1303,7 @@ func (m *CreateType) Reset() { *m = CreateType{} } func (m *CreateType) String() string { return proto.CompactTextString(m) } func (*CreateType) ProtoMessage() {} func (*CreateType) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{31} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{32} } func (m *CreateType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1299,7 +1340,7 @@ func (m *DropType) Reset() { *m = DropType{} } func (m *DropType) String() string { return proto.CompactTextString(m) } func (*DropType) ProtoMessage() {} func (*DropType) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{32} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{33} } func (m *DropType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1336,7 +1377,7 @@ func (m *AlterType) Reset() { *m = AlterType{} } func (m *AlterType) String() string { return proto.CompactTextString(m) } func (*AlterType) ProtoMessage() {} func (*AlterType) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{33} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{34} } func (m *AlterType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1375,7 +1416,7 @@ func (m *RenameType) Reset() { *m = RenameType{} } func (m *RenameType) String() string { return proto.CompactTextString(m) } func (*RenameType) ProtoMessage() {} func (*RenameType) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{34} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{35} } func (m *RenameType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1416,7 +1457,7 @@ func (m *CreateStatistics) Reset() { *m = CreateStatistics{} } func (m *CreateStatistics) String() string { return proto.CompactTextString(m) } func (*CreateStatistics) ProtoMessage() {} func (*CreateStatistics) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{35} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{36} } func (m *CreateStatistics) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1456,7 +1497,7 @@ func (m *UnsafeUpsertDescriptor) Reset() { *m = UnsafeUpsertDescriptor{} func (m *UnsafeUpsertDescriptor) String() string { return proto.CompactTextString(m) } func (*UnsafeUpsertDescriptor) ProtoMessage() {} func (*UnsafeUpsertDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{36} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{37} } func (m *UnsafeUpsertDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1500,7 +1541,7 @@ func (m *UnsafeDeleteDescriptor) Reset() { *m = UnsafeDeleteDescriptor{} func (m *UnsafeDeleteDescriptor) String() string { return proto.CompactTextString(m) } func (*UnsafeDeleteDescriptor) ProtoMessage() {} func (*UnsafeDeleteDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{37} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{38} } func (m *UnsafeDeleteDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1546,7 +1587,7 @@ func (m *UnsafeUpsertNamespaceEntry) Reset() { *m = UnsafeUpsertNamespac func (m *UnsafeUpsertNamespaceEntry) String() string { return proto.CompactTextString(m) } func (*UnsafeUpsertNamespaceEntry) ProtoMessage() {} func (*UnsafeUpsertNamespaceEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{38} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{39} } func (m *UnsafeUpsertNamespaceEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1590,7 +1631,7 @@ func (m *UnsafeDeleteNamespaceEntry) Reset() { *m = UnsafeDeleteNamespac func (m *UnsafeDeleteNamespaceEntry) String() string { return proto.CompactTextString(m) } func (*UnsafeDeleteNamespaceEntry) ProtoMessage() {} func (*UnsafeDeleteNamespaceEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_ddl_events_92b10d126f5d7d5a, []int{39} + return fileDescriptor_ddl_events_c32332d2c9b04c72, []int{40} } func (m *UnsafeDeleteNamespaceEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1626,6 +1667,7 @@ func init() { proto.RegisterType((*CreateSchema)(nil), "cockroach.util.log.eventpb.CreateSchema") proto.RegisterType((*DropSchema)(nil), "cockroach.util.log.eventpb.DropSchema") proto.RegisterType((*RenameSchema)(nil), "cockroach.util.log.eventpb.RenameSchema") + proto.RegisterType((*SetSchema)(nil), "cockroach.util.log.eventpb.SetSchema") proto.RegisterType((*CreateTable)(nil), "cockroach.util.log.eventpb.CreateTable") proto.RegisterType((*DropTable)(nil), "cockroach.util.log.eventpb.DropTable") proto.RegisterType((*RenameTable)(nil), "cockroach.util.log.eventpb.RenameTable") @@ -2114,7 +2156,7 @@ func (m *RenameSchema) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *CreateTable) Marshal() (dAtA []byte, err error) { +func (m *SetSchema) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -2124,7 +2166,7 @@ func (m *CreateTable) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CreateTable) MarshalTo(dAtA []byte) (int, error) { +func (m *SetSchema) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int @@ -2145,6 +2187,58 @@ func (m *CreateTable) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n22 + if len(m.DescriptorName) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintDdlEvents(dAtA, i, uint64(len(m.DescriptorName))) + i += copy(dAtA[i:], m.DescriptorName) + } + if len(m.NewDescriptorName) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintDdlEvents(dAtA, i, uint64(len(m.NewDescriptorName))) + i += copy(dAtA[i:], m.NewDescriptorName) + } + if len(m.DescriptorType) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintDdlEvents(dAtA, i, uint64(len(m.DescriptorType))) + i += copy(dAtA[i:], m.DescriptorType) + } + return i, nil +} + +func (m *CreateTable) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateTable) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) + n23, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n23 + dAtA[i] = 0x12 + i++ + i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) + n24, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n24 if len(m.TableName) > 0 { dAtA[i] = 0x1a i++ @@ -2178,19 +2272,19 @@ func (m *DropTable) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n23, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n25, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n23 + i += n25 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n24, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n26, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n24 + i += n26 if len(m.TableName) > 0 { dAtA[i] = 0x1a i++ @@ -2233,19 +2327,19 @@ func (m *RenameTable) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n25, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n27, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n25 + i += n27 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n26, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n28, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n26 + i += n28 if len(m.TableName) > 0 { dAtA[i] = 0x1a i++ @@ -2279,19 +2373,19 @@ func (m *TruncateTable) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n27, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n29, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n27 + i += n29 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n28, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n30, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n28 + i += n30 if len(m.TableName) > 0 { dAtA[i] = 0x1a i++ @@ -2319,19 +2413,19 @@ func (m *AlterTable) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n29, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n31, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n29 + i += n31 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n30, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n32, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n30 + i += n32 if len(m.TableName) > 0 { dAtA[i] = 0x1a i++ @@ -2379,19 +2473,19 @@ func (m *CommentOnColumn) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n31, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n33, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n31 + i += n33 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n32, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n34, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n32 + i += n34 if len(m.TableName) > 0 { dAtA[i] = 0x1a i++ @@ -2441,19 +2535,19 @@ func (m *CommentOnDatabase) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n33, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n35, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n33 + i += n35 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n34, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n36, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n34 + i += n36 if len(m.DatabaseName) > 0 { dAtA[i] = 0x1a i++ @@ -2497,19 +2591,19 @@ func (m *CommentOnTable) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n35, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n37, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n35 + i += n37 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n36, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n38, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n36 + i += n38 if len(m.TableName) > 0 { dAtA[i] = 0x1a i++ @@ -2553,19 +2647,19 @@ func (m *CommentOnIndex) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n37, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n39, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n37 + i += n39 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n38, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n40, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n38 + i += n40 if len(m.TableName) > 0 { dAtA[i] = 0x1a i++ @@ -2615,19 +2709,19 @@ func (m *CreateIndex) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n39, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n41, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n39 + i += n41 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n40, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n42, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n40 + i += n42 if len(m.TableName) > 0 { dAtA[i] = 0x1a i++ @@ -2666,19 +2760,19 @@ func (m *DropIndex) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n41, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n43, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n41 + i += n43 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n42, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n44, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n42 + i += n44 if len(m.TableName) > 0 { dAtA[i] = 0x1a i++ @@ -2732,19 +2826,19 @@ func (m *AlterIndex) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n43, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n45, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n43 + i += n45 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n44, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n46, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n44 + i += n46 if len(m.TableName) > 0 { dAtA[i] = 0x1a i++ @@ -2783,19 +2877,19 @@ func (m *CreateView) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n45, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n47, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n45 + i += n47 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n46, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n48, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n46 + i += n48 if len(m.ViewName) > 0 { dAtA[i] = 0x1a i++ @@ -2835,19 +2929,19 @@ func (m *DropView) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n47, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n49, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n47 + i += n49 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n48, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n50, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n48 + i += n50 if len(m.ViewName) > 0 { dAtA[i] = 0x1a i++ @@ -2890,19 +2984,19 @@ func (m *CreateSequence) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n49, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n51, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n49 + i += n51 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n50, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n52, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n50 + i += n52 if len(m.SequenceName) > 0 { dAtA[i] = 0x1a i++ @@ -2936,19 +3030,19 @@ func (m *DropSequence) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n51, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n53, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n51 + i += n53 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n52, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n54, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n52 + i += n54 if len(m.SequenceName) > 0 { dAtA[i] = 0x1a i++ @@ -2976,19 +3070,19 @@ func (m *AlterSequence) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n53, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n55, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n53 + i += n55 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n54, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n56, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n54 + i += n56 if len(m.SequenceName) > 0 { dAtA[i] = 0x1a i++ @@ -3049,19 +3143,19 @@ func (m *ReverseSchemaChange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n55, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n57, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n55 + i += n57 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSchemaChangeEventDetails.Size())) - n56, err := m.CommonSchemaChangeEventDetails.MarshalTo(dAtA[i:]) + n58, err := m.CommonSchemaChangeEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n56 + i += n58 if len(m.Error) > 0 { dAtA[i] = 0x22 i++ @@ -3095,19 +3189,19 @@ func (m *FinishSchemaChange) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n57, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n59, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n57 + i += n59 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSchemaChangeEventDetails.Size())) - n58, err := m.CommonSchemaChangeEventDetails.MarshalTo(dAtA[i:]) + n60, err := m.CommonSchemaChangeEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n58 + i += n60 return i, nil } @@ -3129,19 +3223,19 @@ func (m *FinishSchemaChangeRollback) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n59, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n61, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n59 + i += n61 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSchemaChangeEventDetails.Size())) - n60, err := m.CommonSchemaChangeEventDetails.MarshalTo(dAtA[i:]) + n62, err := m.CommonSchemaChangeEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n60 + i += n62 return i, nil } @@ -3163,19 +3257,19 @@ func (m *CreateType) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n61, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n63, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n61 + i += n63 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n62, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n64, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n62 + i += n64 if len(m.TypeName) > 0 { dAtA[i] = 0x22 i++ @@ -3209,19 +3303,19 @@ func (m *DropType) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n63, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n65, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n63 + i += n65 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n64, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n66, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n64 + i += n66 if len(m.TypeName) > 0 { dAtA[i] = 0x1a i++ @@ -3249,19 +3343,19 @@ func (m *AlterType) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n65, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n67, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n65 + i += n67 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n66, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n68, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n66 + i += n68 if len(m.TypeName) > 0 { dAtA[i] = 0x1a i++ @@ -3289,19 +3383,19 @@ func (m *RenameType) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n67, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n69, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n67 + i += n69 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n68, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n70, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n68 + i += n70 if len(m.TypeName) > 0 { dAtA[i] = 0x1a i++ @@ -3335,19 +3429,19 @@ func (m *CreateStatistics) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n69, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n71, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n69 + i += n71 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n70, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n72, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n70 + i += n72 if len(m.TableName) > 0 { dAtA[i] = 0x1a i++ @@ -3375,19 +3469,19 @@ func (m *UnsafeUpsertDescriptor) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n71, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n73, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n71 + i += n73 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n72, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n74, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n72 + i += n74 if len(m.PreviousDescriptor) > 0 { dAtA[i] = 0x1a i++ @@ -3437,19 +3531,19 @@ func (m *UnsafeDeleteDescriptor) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n73, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n75, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n73 + i += n75 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n74, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n76, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n74 + i += n76 if m.ParentID != 0 { dAtA[i] = 0x18 i++ @@ -3503,19 +3597,19 @@ func (m *UnsafeUpsertNamespaceEntry) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n75, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n77, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n75 + i += n77 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n76, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n78, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n76 + i += n78 if m.ParentID != 0 { dAtA[i] = 0x18 i++ @@ -3584,19 +3678,19 @@ func (m *UnsafeDeleteNamespaceEntry) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonEventDetails.Size())) - n77, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) + n79, err := m.CommonEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n77 + i += n79 dAtA[i] = 0x12 i++ i = encodeVarintDdlEvents(dAtA, i, uint64(m.CommonSQLEventDetails.Size())) - n78, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) + n80, err := m.CommonSQLEventDetails.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n78 + i += n80 if m.ParentID != 0 { dAtA[i] = 0x18 i++ @@ -3845,6 +3939,31 @@ func (m *RenameSchema) Size() (n int) { return n } +func (m *SetSchema) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.CommonEventDetails.Size() + n += 1 + l + sovDdlEvents(uint64(l)) + l = m.CommonSQLEventDetails.Size() + n += 1 + l + sovDdlEvents(uint64(l)) + l = len(m.DescriptorName) + if l > 0 { + n += 1 + l + sovDdlEvents(uint64(l)) + } + l = len(m.NewDescriptorName) + if l > 0 { + n += 1 + l + sovDdlEvents(uint64(l)) + } + l = len(m.DescriptorType) + if l > 0 { + n += 1 + l + sovDdlEvents(uint64(l)) + } + return n +} + func (m *CreateTable) Size() (n int) { if m == nil { return 0 @@ -6155,6 +6274,203 @@ func (m *RenameSchema) Unmarshal(dAtA []byte) error { } return nil } +func (m *SetSchema) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDdlEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SetSchema: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SetSchema: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommonEventDetails", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDdlEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDdlEvents + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CommonEventDetails.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommonSQLEventDetails", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDdlEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDdlEvents + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CommonSQLEventDetails.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DescriptorName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDdlEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDdlEvents + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DescriptorName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewDescriptorName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDdlEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDdlEvents + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewDescriptorName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DescriptorType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDdlEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDdlEvents + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DescriptorType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDdlEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDdlEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *CreateTable) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -11484,105 +11800,108 @@ var ( ) func init() { - proto.RegisterFile("util/log/eventpb/ddl_events.proto", fileDescriptor_ddl_events_92b10d126f5d7d5a) -} - -var fileDescriptor_ddl_events_92b10d126f5d7d5a = []byte{ - // 1529 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5b, 0xcd, 0x6f, 0x1b, 0x45, - 0x1b, 0xcf, 0xae, 0xf3, 0x61, 0x3f, 0xb6, 0xd3, 0x64, 0xd3, 0x56, 0x79, 0xa3, 0xf7, 0xb5, 0xf3, - 0xae, 0x7a, 0xc8, 0xab, 0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- 0x4e, 0x98, 0x19, 0x4e, 0xde, 0x67, 0x32, 0xfc, 0x6b, 0x17, 0x79, 0xe5, 0xba, 0xdb, 0xb0, 0x1a, - 0xba, 0xfd, 0x32, 0xd1, 0xed, 0x88, 0x73, 0xb7, 0x0c, 0x69, 0xcf, 0xb7, 0x56, 0xab, 0x12, 0xdd, - 0x1e, 0xc0, 0x5a, 0xca, 0x0b, 0x51, 0xa2, 0x7e, 0x2a, 0xc3, 0x74, 0x09, 0xb1, 0x67, 0x1c, 0x91, - 0x72, 0x76, 0x01, 0x66, 0x31, 0x6a, 0x6a, 0xbb, 0x05, 0xfb, 0x33, 0x75, 0x02, 0xa3, 0x66, 0x21, - 0x5c, 0xf9, 0x3f, 0x97, 0xe1, 0xc4, 0x2a, 0xc1, 0x0d, 0xe4, 0xd2, 0x0a, 0x11, 0xf5, 0x2d, 0xfa, - 0xf9, 0xb8, 0x8b, 0x2d, 0x47, 0x77, 0x11, 0xa6, 0x83, 0xf2, 0x31, 0xc4, 0xd7, 0x35, 0x0e, 0x54, - 0xdf, 0x95, 0x21, 0x25, 0x86, 0x83, 0x51, 0xa3, 0x2b, 0x0f, 0x49, 0xbf, 0xdd, 0x0d, 0x21, 0x0b, - 0x04, 0x84, 0x53, 0x75, 0x06, 0x26, 0x48, 0x13, 0x23, 0x77, 0x00, 0x39, 0x62, 0x51, 0xfd, 0x55, - 0x02, 0x60, 0xc3, 0x43, 0xd4, 0xe9, 0x50, 0x3f, 0x96, 0x21, 0x25, 0x0a, 0x4b, 0xe4, 0x3d, 0xff, - 0x2c, 0xb0, 0x4a, 0xa1, 0x85, 0x85, 0xfa, 0xc7, 0x40, 0x1a, 0xa3, 0x66, 0xb9, 0x4b, 0xd1, 0x3b, - 0x32, 0x24, 0x45, 0x72, 0x54, 0xf4, 0x0d, 0x7b, 0x84, 0x0a, 0xef, 0x59, 0x00, 0xca, 0x7e, 0xf1, - 0x30, 0x82, 0x12, 0x1c, 0x71, 0x80, 0xcc, 0xb8, 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- 0xd0, 0xef, 0x64, 0x98, 0xee, 0x10, 0x1a, 0xed, 0xc2, 0xf1, 0x44, 0x79, 0xfc, 0x2b, 0xcc, 0x63, - 0x11, 0x9b, 0xe8, 0xcd, 0xc8, 0xf2, 0x78, 0x16, 0xc0, 0x62, 0x06, 0x0e, 0x2b, 0x08, 0x09, 0x8e, - 0x78, 0xf2, 0xf5, 0xe0, 0x97, 0xce, 0xcc, 0x7c, 0xcc, 0x79, 0x88, 0xf3, 0x3d, 0x3d, 0x72, 0xe2, - 0x60, 0x3d, 0x52, 0x7d, 0x2b, 0x26, 0x66, 0xef, 0x63, 0x4e, 0x0f, 0x8d, 0x53, 0xe5, 0xfc, 0xa0, - 0xb9, 0x63, 0x92, 0xcd, 0x1d, 0xfd, 0xe7, 0x8c, 0x9f, 0x83, 0x89, 0xee, 0xd8, 0x11, 0x87, 0x17, - 0xdc, 0x5f, 0xca, 0x00, 0xa2, 0x64, 0x30, 0x92, 0x47, 0x87, 0xd4, 0xff, 0x43, 0x82, 0x05, 0xcc, - 0x30, 0x4e, 0xe3, 0x0c, 0xf0, 0xf8, 0x7b, 0x6c, 0x46, 0x3c, 0x57, 0xb9, 0x55, 0x47, 0xee, 0xf6, - 0x80, 0xea, 0xcc, 0x1f, 0xba, 0xce, 0x00, 0xea, 0x27, 0x32, 0xc4, 0x59, 0x7c, 0x46, 0x98, 0xb7, - 0xc3, 0xd8, 0x8f, 0x7f, 0x20, 0x07, 0x37, 0xa0, 0x65, 0xb4, 0x55, 0x47, 0xd8, 0x18, 0xad, 0x01, - 0xd5, 0xf3, 0x7f, 0xf4, 0xd0, 0x01, 0x35, 0x00, 0x1d, 0xe0, 0x40, 0xe7, 0x37, 0x49, 0xdc, 0x93, - 0x1e, 0x0d, 0x52, 0xd4, 0xdf, 0x25, 0x48, 0xf3, 0xda, 0x7d, 0x44, 0xec, 0xdd, 0x91, 0x20, 0xe3, - 0x3f, 0x81, 0x1f, 0x69, 0xae, 0x6e, 0xea, 0xb8, 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2a, 0xdb, 0x0e, - 0x1a, 0xa9, 0xce, 0x4e, 0xb7, 0x9d, 0xa1, 0x67, 0xc1, 0x71, 0x06, 0xd8, 0xdd, 0xa4, 0x26, 0x86, - 0x35, 0xa9, 0xfb, 0x92, 0x18, 0x71, 0x46, 0x98, 0x88, 0xd8, 0x70, 0x22, 0xd4, 0x07, 0x12, 0x24, - 0xc4, 0x31, 0x71, 0x74, 0x6d, 0xfc, 0x50, 0x06, 0xf0, 0xaf, 0x44, 0x22, 0x6b, 0xa4, 0x72, 0x1e, - 0xd2, 0xfc, 0x3e, 0x64, 0x9f, 0x14, 0x48, 0x62, 0xd4, 0xac, 0x04, 0xc4, 0x3c, 0x92, 0x60, 0xc6, - 0x9f, 0x4d, 0x59, 0x4f, 0xf3, 0xa8, 0x65, 0x78, 0x91, 0xbd, 0x10, 0x79, 0x3f, 0x06, 0xa7, 0xaf, - 0x63, 0x4f, 0xbf, 0x89, 0xae, 0x3b, 0x1e, 0x72, 0x69, 0x77, 0x48, 0x18, 0x1d, 0x93, 0x5f, 0x84, - 0x39, 0xc7, 0x45, 0x0d, 0x8b, 0xd4, 0x3d, 0xad, 0x3b, 0xc8, 0x0c, 0xb0, 0x5d, 0x09, 0xa0, 0x21, - 0x4b, 0x9f, 0x11, 0xb7, 0x66, 0x21, 0xd9, 0xc1, 0x97, 0xd1, 0x21, 0xb1, 0x33, 0x30, 0x71, 0x93, - 0xb8, 0x86, 0xe8, 0xfb, 0xbd, 0x87, 0x70, 0x62, 0x51, 0x39, 0x07, 0x29, 0xfe, 0x41, 0xc3, 0x84, - 0x5a, 0x06, 0xe2, 0x27, 0x76, 0x7d, 0x22, 0x90, 0x63, 0xae, 0x70, 0x88, 0xfa, 0x4d, 0xc7, 0x29, - 0x05, 0x64, 0x23, 0x8a, 0x46, 0xd1, 0x29, 0xcf, 0x41, 0x42, 0xbc, 0xf9, 0xd2, 0x1d, 0x21, 0x17, - 0xd8, 0x60, 0x24, 0xde, 0x72, 0xe9, 0x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xed, 0x64, 0xc6, - 0x5e, 0x9f, 0xf2, 0x59, 0xdd, 0x98, 0xe4, 0xff, 0x31, 0xb0, 0xfc, 0x4f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x9e, 0x47, 0x80, 0x8f, 0xa7, 0x30, 0x00, 0x00, + proto.RegisterFile("util/log/eventpb/ddl_events.proto", fileDescriptor_ddl_events_c32332d2c9b04c72) +} + +var fileDescriptor_ddl_events_c32332d2c9b04c72 = []byte{ + // 1571 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x9b, 0xcd, 0x6f, 0x1b, 0xc5, + 0x1b, 0xc7, 0xb3, 0xeb, 0xbc, 0xd8, 0x8f, 0x5f, 0x9a, 0x6c, 0xda, 0x2a, 0xbf, 0xe8, 0x87, 0x1d, + 0x56, 0x3d, 0x04, 0x41, 0x13, 0xb5, 0x01, 0x2a, 0x15, 0x15, 0xd4, 0xc4, 0x01, 0x19, 0x95, 0xb6, + 0x89, 0xdd, 0x0a, 0x71, 0xb1, 0x36, 0xbb, 0xd3, 0x64, 0xe9, 0x7a, 0x66, 0xb3, 0x3b, 0xb6, 0xf1, + 0x1f, 0x80, 0x84, 0x84, 0x84, 0x10, 0x42, 0x5c, 0xb8, 0x70, 0x40, 0xaa, 0xc4, 0x01, 0x24, 0x2e, + 0x48, 0x88, 0x1b, 0x20, 0x7a, 0x00, 0x54, 0xc1, 0xa5, 0x27, 0xab, 0x75, 0xa4, 0x56, 0xaa, 0x80, + 0x03, 0x42, 0xe2, 0x8a, 0x66, 0x66, 0xd7, 0x5e, 0xc7, 0x5e, 0xa7, 0x91, 0xd2, 0x83, 0x37, 0xb9, + 0x39, 0xde, 0xef, 0x33, 0xe3, 0xe7, 0x33, 0x33, 0xcf, 0xf3, 0xcc, 0xcc, 0x06, 0x9e, 0xae, 0x52, + 0xd3, 0x5a, 0xb4, 0xc8, 0xe6, 0x22, 0xaa, 0x21, 0x4c, 0xed, 0x8d, 0x45, 0xc3, 0xb0, 0xca, 0xfc, + 0xb3, 0xbb, 0x60, 0x3b, 0x84, 0x12, 0x65, 0x56, 0x27, 0xfa, 0x4d, 0x87, 0x68, 0xfa, 0xd6, 0x02, + 0x13, 0x2f, 0x58, 0x64, 0x73, 0xc1, 0x13, 0xcf, 0x1e, 0xdf, 0x24, 0x9b, 0x84, 0xcb, 0x16, 0xd9, + 0x27, 0x61, 0x31, 0xfb, 0x54, 0x4f, 0xa3, 0xc1, 0x06, 0xd5, 0xbf, 0x24, 0xc8, 0xac, 0x38, 0x48, + 0xa3, 0x28, 0xaf, 0x51, 0x6d, 0x43, 0x73, 0x91, 0x52, 0x82, 0x71, 0x9d, 0x54, 0x2a, 0x04, 0xcf, + 0x48, 0x73, 0xd2, 0x7c, 0xf2, 0xec, 0xc2, 0x42, 0x78, 0xa7, 0x0b, 0x2b, 0x5c, 0xb9, 0xca, 0xfe, + 0xca, 0x23, 0xaa, 0x99, 0x96, 0xbb, 0x9c, 0xba, 0xdd, 0xcc, 0x8d, 0xdc, 0x69, 0xe6, 0xa4, 0x47, + 0xcd, 0xdc, 0xc8, 0xba, 0xd7, 0x96, 0xb2, 0x06, 0x31, 0x77, 0xdb, 0x9a, 0x91, 0x79, 0x93, 0x67, + 0xf6, 0x6e, 0xb2, 0xb8, 0x76, 0x69, 0x40, 0xab, 0xac, 0x2d, 0x65, 0x09, 0xd2, 0x86, 0xf7, 0xa3, + 0xcb, 0x58, 0xab, 0xa0, 0x99, 0xd8, 0x9c, 0x34, 0x9f, 0x58, 0xce, 0x3c, 0x6a, 0xe6, 0xe0, 0x39, + 0x52, 0x31, 0x29, 0xaa, 0xd8, 0xb4, 0xb1, 0x9e, 0xf2, 0x45, 0x97, 0xb5, 0x0a, 0x52, 0xbf, 0x96, + 0x21, 0x95, 0x77, 0x88, 0x7d, 0x38, 0xdc, 0x55, 0xf2, 0x70, 0xd2, 0x70, 0x88, 0x6d, 0x23, 0x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0d, 0x2e, 0x2d, 0xb6, 0xde, 0x5c, 0x5b, 0xd3, 0xd1, 0x2a, + 0xa6, 0x4e, 0xe3, 0x68, 0x24, 0x0f, 0x7c, 0x24, 0x2f, 0x40, 0xb2, 0x1d, 0x07, 0x4c, 0x83, 0x8f, + 0xa7, 0xb7, 0x6f, 0xb9, 0xea, 0x7d, 0xdd, 0xbb, 0x6f, 0xf1, 0x0d, 0x0a, 0x46, 0x67, 0x22, 0x4c, + 0x0c, 0x9a, 0x08, 0x2f, 0xc1, 0xd4, 0x0d, 0xcd, 0xb4, 0x90, 0x51, 0xae, 0x69, 0x96, 0x69, 0xf0, + 0x4d, 0xcf, 0x4c, 0xbc, 0xaf, 0xc5, 0xa4, 0x10, 0x5e, 0x6f, 0xeb, 0x98, 0x71, 0xc7, 0xaa, 0xcc, + 0x37, 0x10, 0xee, 0x4c, 0xa2, 0xaf, 0x4b, 0x93, 0x1d, 0xe1, 0x2a, 0xd7, 0xa9, 0x3f, 0xc5, 0xfc, + 0xf9, 0x24, 0xa2, 0xc2, 0xd1, 0x7c, 0x1a, 0xd2, 0xc8, 0xb0, 0xfc, 0xcc, 0xed, 0xfb, 0xd9, 0x91, + 0xdb, 0xad, 0xac, 0x74, 0xa7, 0x95, 0x95, 0xee, 0xb6, 0xb2, 0xd2, 0xbd, 0x56, 0x56, 0xfa, 0x70, + 0x27, 0x3b, 0x72, 0x67, 0x27, 0x3b, 0x72, 0x77, 0x27, 0x3b, 0xf2, 0xd6, 0x84, 0x47, 0x75, 0x63, + 0x9c, 0xff, 0x6b, 0xc6, 0xd2, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x44, 0x7e, 0x1a, 0xa6, 0x10, + 0x32, 0x00, 0x00, } diff --git a/pkg/util/log/eventpb/ddl_events.proto b/pkg/util/log/eventpb/ddl_events.proto index 6619c3211d53..d2884a6ca6b3 100644 --- a/pkg/util/log/eventpb/ddl_events.proto +++ b/pkg/util/log/eventpb/ddl_events.proto @@ -128,6 +128,18 @@ message RenameSchema { string new_schema_name = 4 [(gogoproto.jsontag) = ",omitempty"]; } +// SetSchema is recorded when a table, view, sequence or type's schema is changed. +message SetSchema { + CommonEventDetails common = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; + CommonSQLEventDetails sql = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; + // The old name of the affected descriptor. + string descriptor_name = 3 [(gogoproto.jsontag) = ",omitempty"]; + // The new name of the affected descriptor. + string new_descriptor_name = 4 [(gogoproto.jsontag) = ",omitempty"]; + // The descriptor type being changed (table, view, sequence, type). + string descriptor_type = 5 [(gogoproto.jsontag) = ",omitempty"]; +} + // CreateTable is recorded when a table is created. message CreateTable { CommonEventDetails common = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true]; diff --git a/pkg/util/log/eventpb/eventlog_channels_generated.go b/pkg/util/log/eventpb/eventlog_channels_generated.go index 76fb3587ae5d..0eb9c6d6be9a 100644 --- a/pkg/util/log/eventpb/eventlog_channels_generated.go +++ b/pkg/util/log/eventpb/eventlog_channels_generated.go @@ -130,6 +130,9 @@ func (m *RenameType) LoggingChannel() logpb.Channel { return logpb.Channel_SQL_S // LoggingChannel implements the EventPayload interface. func (m *ReverseSchemaChange) LoggingChannel() logpb.Channel { return logpb.Channel_SQL_SCHEMA } +// LoggingChannel implements the EventPayload interface. +func (m *SetSchema) LoggingChannel() logpb.Channel { return logpb.Channel_SQL_SCHEMA } + // LoggingChannel implements the EventPayload interface. func (m *TruncateTable) LoggingChannel() logpb.Channel { return logpb.Channel_SQL_SCHEMA } diff --git a/pkg/util/log/eventpb/json_encode_generated.go b/pkg/util/log/eventpb/json_encode_generated.go index f54bbd4c7d99..8c61085768e8 100644 --- a/pkg/util/log/eventpb/json_encode_generated.go +++ b/pkg/util/log/eventpb/json_encode_generated.go @@ -2218,6 +2218,52 @@ func (m *SetClusterSetting) AppendJSONFields(printComma bool, b redact.Redactabl return printComma, b } +// AppendJSONFields implements the EventPayload interface. +func (m *SetSchema) AppendJSONFields(printComma bool, b redact.RedactableBytes) (bool, redact.RedactableBytes) { + + printComma, b = m.CommonEventDetails.AppendJSONFields(printComma, b) + + printComma, b = m.CommonSQLEventDetails.AppendJSONFields(printComma, b) + + if m.DescriptorName != "" { + if printComma { + b = append(b, ',') + } + printComma = true + b = append(b, "\"DescriptorName\":\""...) + b = append(b, redact.StartMarker()...) + b = redact.RedactableBytes(jsonbytes.EncodeString([]byte(b), string(redact.EscapeMarkers([]byte(m.DescriptorName))))) + b = append(b, redact.EndMarker()...) + b = append(b, '"') + } + + if m.NewDescriptorName != "" { + if printComma { + b = append(b, ',') + } + printComma = true + b = append(b, "\"NewDescriptorName\":\""...) + b = append(b, redact.StartMarker()...) + b = redact.RedactableBytes(jsonbytes.EncodeString([]byte(b), string(redact.EscapeMarkers([]byte(m.NewDescriptorName))))) + b = append(b, redact.EndMarker()...) + b = append(b, '"') + } + + if m.DescriptorType != "" { + if printComma { + b = append(b, ',') + } + printComma = true + b = append(b, "\"DescriptorType\":\""...) + b = append(b, redact.StartMarker()...) + b = redact.RedactableBytes(jsonbytes.EncodeString([]byte(b), string(redact.EscapeMarkers([]byte(m.DescriptorType))))) + b = append(b, redact.EndMarker()...) + b = append(b, '"') + } + + return printComma, b +} + // AppendJSONFields implements the EventPayload interface. func (m *SetZoneConfig) AppendJSONFields(printComma bool, b redact.RedactableBytes) (bool, redact.RedactableBytes) {