From d65cd6e41e56ac009f7a4d1e179aadcdc61db18a Mon Sep 17 00:00:00 2001 From: King-Dylan <702299521@qq.com> Date: Mon, 18 Aug 2025 10:33:40 -0700 Subject: [PATCH 1/2] proto: add fields for --- go-tipb/explain.pb.go | 201 +++++++++++++++++++++++++++--------------- proto/explain.proto | 5 +- 2 files changed, 135 insertions(+), 71 deletions(-) diff --git a/go-tipb/explain.pb.go b/go-tipb/explain.pb.go index f8d49181..2ee310e2 100644 --- a/go-tipb/explain.pb.go +++ b/go-tipb/explain.pb.go @@ -127,14 +127,15 @@ func (OperatorLabel) EnumDescriptor() ([]byte, []int) { } type ExplainData struct { - Main *ExplainOperator `protobuf:"bytes,1,opt,name=main,proto3" json:"main,omitempty"` - Ctes []*ExplainOperator `protobuf:"bytes,2,rep,name=ctes,proto3" json:"ctes,omitempty"` + Main *ExplainOperator `protobuf:"bytes,1,opt,name=main,proto3" json:"main,omitempty"` + Ctes []*ExplainOperator `protobuf:"bytes,2,rep,name=ctes,proto3" json:"ctes,omitempty"` + Subqueries []*ExplainOperator `protobuf:"bytes,3,rep,name=subqueries,proto3" json:"subqueries,omitempty"` // with_runtime_stats represents if runtime stats are available. // If not available, the act_rows, *_exec_info, memory_bytes and disk_bytes should not be used. - WithRuntimeStats bool `protobuf:"varint,3,opt,name=with_runtime_stats,json=withRuntimeStats,proto3" json:"with_runtime_stats,omitempty"` + WithRuntimeStats bool `protobuf:"varint,4,opt,name=with_runtime_stats,json=withRuntimeStats,proto3" json:"with_runtime_stats,omitempty"` // If discarded_due_to_too_long is true. The main and ctes fields should be empty and should not be used. // This field can be changed to a enum or int if we need to represent more states in the future. - DiscardedDueToTooLong bool `protobuf:"varint,4,opt,name=discarded_due_to_too_long,json=discardedDueToTooLong,proto3" json:"discarded_due_to_too_long,omitempty"` + DiscardedDueToTooLong bool `protobuf:"varint,5,opt,name=discarded_due_to_too_long,json=discardedDueToTooLong,proto3" json:"discarded_due_to_too_long,omitempty"` } func (m *ExplainData) Reset() { *m = ExplainData{} } @@ -184,6 +185,13 @@ func (m *ExplainData) GetCtes() []*ExplainOperator { return nil } +func (m *ExplainData) GetSubqueries() []*ExplainOperator { + if m != nil { + return m.Subqueries + } + return nil +} + func (m *ExplainData) GetWithRuntimeStats() bool { if m != nil { return m.WithRuntimeStats @@ -730,68 +738,69 @@ func init() { func init() { proto.RegisterFile("explain.proto", fileDescriptor_4242acda8806438c) } var fileDescriptor_4242acda8806438c = []byte{ - // 975 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcf, 0x6e, 0xe3, 0xb6, - 0x13, 0x36, 0x63, 0x27, 0xb6, 0x46, 0x96, 0xad, 0x70, 0x93, 0xdf, 0xcf, 0x09, 0xba, 0x86, 0xeb, - 0x45, 0x01, 0x37, 0x29, 0xbc, 0x68, 0x7a, 0x69, 0x80, 0xf6, 0xb0, 0xd9, 0x2c, 0x9a, 0x05, 0x16, - 0xcd, 0x42, 0xc9, 0xa5, 0x87, 0x42, 0xa0, 0x28, 0xc6, 0x61, 0x2d, 0x8b, 0x82, 0x48, 0x6d, 0xe2, - 0xb7, 0x68, 0x4f, 0xed, 0xbd, 0x97, 0x3e, 0x4a, 0x81, 0x5e, 0xf6, 0xb8, 0xc7, 0x22, 0x79, 0x91, - 0x82, 0xa4, 0xe4, 0x28, 0x41, 0x91, 0x05, 0x7a, 0x1b, 0x7e, 0xdf, 0x37, 0x7f, 0x34, 0x43, 0x8e, - 0xc0, 0x63, 0xd7, 0x59, 0x42, 0x78, 0x3a, 0xcd, 0x72, 0xa1, 0x04, 0x6e, 0x29, 0x9e, 0x45, 0xbb, - 0x5b, 0x33, 0x31, 0x13, 0x06, 0x78, 0xae, 0x2d, 0xcb, 0xed, 0xf6, 0xf3, 0x42, 0x2a, 0x63, 0x5a, - 0x60, 0xfc, 0x17, 0x02, 0xf7, 0x95, 0x75, 0x3f, 0x26, 0x8a, 0xe0,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 0x49, 0xee, - 0xda, 0x58, 0x2d, 0x28, 0x8f, 0x24, 0xc9, 0x2a, 0x87, 0xc4, 0x43, 0x80, 0x9a, 0xa4, 0x65, 0x6e, - 0x66, 0x0d, 0x19, 0xff, 0x82, 0xc0, 0x7f, 0x38, 0xb4, 0xff, 0x50, 0xcd, 0x3e, 0xb4, 0x79, 0x1a, - 0xb3, 0x6b, 0x66, 0x17, 0x8e, 0x7b, 0xb0, 0x69, 0xdb, 0xf3, 0x5a, 0x83, 0x36, 0x76, 0x50, 0x29, - 0x3e, 0x5a, 0x13, 0x05, 0xb7, 0xe6, 0xf7, 0xaf, 0x2b, 0xd1, 0xac, 0xac, 0xc4, 0x6e, 0x73, 0x27, - 0x30, 0xb6, 0x5e, 0xdb, 0x5c, 0x86, 0x34, 0x29, 0xa4, 0x62, 0x39, 0x8b, 0x43, 0x93, 0xae, 0x5a, - 0xdb, 0x5c, 0xbe, 0xac, 0x08, 0x13, 0x7b, 0xef, 0x05, 0x74, 0xaa, 0x9d, 0x84, 0x5d, 0x68, 0x17, - 0xe9, 0x3c, 0x15, 0x57, 0xa9, 0xdf, 0xc0, 0x1d, 0x68, 0xe9, 0x97, 0xeb, 0x23, 0xdc, 0x86, 0x26, - 0x15, 0x99, 0xbf, 0x86, 0xbb, 0xd0, 0x89, 0x88, 0xa2, 0x97, 0x2f, 0x45, 0xe6, 0x37, 0x35, 0xbc, - 0xc8, 0x32, 0xbf, 0xb5, 0xf7, 0x2d, 0x38, 0xab, 0x45, 0x85, 0xfb, 0xe0, 0x16, 0xa9, 0xcc, 0x18, - 0xe5, 0x17, 0x9c, 0xc5, 0x36, 0x8e, 0xe2, 0x71, 0xe4, 0x23, 0x6b, 0xcd, 0xdf, 0xf9, 0x6b, 0x3a, - 0x91, 0xe2, 0x17, 0x09, 0x91, 0x97, 0x7e, 0x73, 0xef, 0x07, 0xf0, 0xee, 0xed, 0x63, 0xec, 0xc0, - 0x3a, 0x5b, 0x64, 0x6a, 0xe9, 0x37, 0xb0, 0x07, 0x4e, 0x54, 0xf0, 0x24, 0x3e, 0xe3, 0x31, 0xf3, - 0x91, 0x3e, 0x66, 0xb9, 0x88, 0x98, 0x39, 0x9a, 0x7a, 0x24, 0x63, 0xb1, 0x1e, 0xb3, 0xdf, 0xc4, - 0x9b, 0xe0, 0xe5, 0x8c, 0x16, 0xb9, 0xe4, 0xef, 0x98, 0x81, 0x5a, 0x47, 0x87, 0x1f, 0xfe, 0xe8, - 0xa0, 0x3f, 0x6f, 0x86, 0xe8, 0xfd, 0xcd, 0x10, 0xfd, 0x7d, 0x33, 0x44, 0x3f, 0xdf, 0x0e, 0x1b, - 0xbf, 0xdd, 0x0e, 0x1b, 0xef, 0x6f, 0x87, 0x8d, 0x0f, 0xb7, 0xc3, 0x06, 0x6c, 0x53, 0xb1, 0x98, - 0x66, 0x3c, 0x9d, 0x51, 0x92, 0x4d, 0x75, 0x9d, 0x66, 0x5e, 0x6f, 0x51, 0xb4, 0x61, 0xfe, 0xb4, - 0x5f, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x0f, 0x31, 0xf7, 0xa7, 0x07, 0x00, 0x00, + // 991 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0x41, 0x6f, 0xdb, 0x36, + 0x14, 0xc7, 0xad, 0xd8, 0x89, 0xa5, 0x67, 0xcb, 0x56, 0xd8, 0x64, 0x73, 0x82, 0xd5, 0xf0, 0x5c, + 0x0c, 0xc8, 0x92, 0xc1, 0xc5, 0x32, 0x0c, 0x58, 0x80, 0xed, 0xd0, 0x34, 0xc5, 0x52, 0xa0, 0x58, + 0x0a, 0x25, 0x97, 0x1d, 0x06, 0x81, 0xa2, 0x18, 0x87, 0x8b, 0x2c, 0x6a, 0x24, 0xd5, 0xc4, 0xd7, + 0x7d, 0x82, 0xed, 0xb4, 0xdd, 0x77, 0xd9, 0x47, 0xd9, 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 0x00, 0xff, 0xff, 0x55, 0x43, 0x82, 0xb2, 0xde, 0x07, 0x00, 0x00, } func (m *ExplainData) Marshal() (dAtA []byte, err error) { @@ -822,7 +831,7 @@ func (m *ExplainData) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x20 + dAtA[i] = 0x28 } if m.WithRuntimeStats { i-- @@ -832,7 +841,21 @@ func (m *ExplainData) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x18 + dAtA[i] = 0x20 + } + if len(m.Subqueries) > 0 { + for iNdEx := len(m.Subqueries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Subqueries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExplain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } } if len(m.Ctes) > 0 { for iNdEx := len(m.Ctes) - 1; iNdEx >= 0; iNdEx-- { @@ -1341,6 +1364,12 @@ func (m *ExplainData) Size() (n int) { n += 1 + l + sovExplain(uint64(l)) } } + if len(m.Subqueries) > 0 { + for _, e := range m.Subqueries { + l = e.Size() + n += 1 + l + sovExplain(uint64(l)) + } + } if m.WithRuntimeStats { n += 2 } @@ -1673,6 +1702,40 @@ func (m *ExplainData) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subqueries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExplain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthExplain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthExplain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subqueries = append(m.Subqueries, &ExplainOperator{}) + if err := m.Subqueries[len(m.Subqueries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field WithRuntimeStats", wireType) } @@ -1692,7 +1755,7 @@ func (m *ExplainData) Unmarshal(dAtA []byte) error { } } m.WithRuntimeStats = bool(v != 0) - case 4: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field DiscardedDueToTooLong", wireType) } diff --git a/proto/explain.proto b/proto/explain.proto index bd95de8a..b4cd91f6 100644 --- a/proto/explain.proto +++ b/proto/explain.proto @@ -19,12 +19,13 @@ option (rustproto.lite_runtime_all) = true; message ExplainData { ExplainOperator main = 1; repeated ExplainOperator ctes = 2; + repeated ExplainOperator subqueries = 3; // with_runtime_stats represents if runtime stats are available. // If not available, the act_rows, *_exec_info, memory_bytes and disk_bytes should not be used. - bool with_runtime_stats = 3; + bool with_runtime_stats = 4; // If discarded_due_to_too_long is true. The main and ctes fields should be empty and should not be used. // This field can be changed to a enum or int if we need to represent more states in the future. - bool discarded_due_to_too_long = 4; + bool discarded_due_to_too_long = 5; } message ExplainOperator { From 621b691090992cdfbc5ebcb9f902451afa0f59a0 Mon Sep 17 00:00:00 2001 From: King-Dylan <702299521@qq.com> Date: Mon, 18 Aug 2025 23:29:04 -0700 Subject: [PATCH 2/2] fix test --- go-tipb/explain.pb.go | 240 +++++++++++++++++++++--------------------- proto/explain.proto | 6 +- 2 files changed, 123 insertions(+), 123 deletions(-) diff --git a/go-tipb/explain.pb.go b/go-tipb/explain.pb.go index 2ee310e2..2bdc9442 100644 --- a/go-tipb/explain.pb.go +++ b/go-tipb/explain.pb.go @@ -127,15 +127,15 @@ func (OperatorLabel) EnumDescriptor() ([]byte, []int) { } type ExplainData struct { - Main *ExplainOperator `protobuf:"bytes,1,opt,name=main,proto3" json:"main,omitempty"` - Ctes []*ExplainOperator `protobuf:"bytes,2,rep,name=ctes,proto3" json:"ctes,omitempty"` - Subqueries []*ExplainOperator `protobuf:"bytes,3,rep,name=subqueries,proto3" json:"subqueries,omitempty"` + Main *ExplainOperator `protobuf:"bytes,1,opt,name=main,proto3" json:"main,omitempty"` + Ctes []*ExplainOperator `protobuf:"bytes,2,rep,name=ctes,proto3" json:"ctes,omitempty"` // with_runtime_stats represents if runtime stats are available. // If not available, the act_rows, *_exec_info, memory_bytes and disk_bytes should not be used. - WithRuntimeStats bool `protobuf:"varint,4,opt,name=with_runtime_stats,json=withRuntimeStats,proto3" json:"with_runtime_stats,omitempty"` + WithRuntimeStats bool `protobuf:"varint,3,opt,name=with_runtime_stats,json=withRuntimeStats,proto3" json:"with_runtime_stats,omitempty"` // If discarded_due_to_too_long is true. The main and ctes fields should be empty and should not be used. // This field can be changed to a enum or int if we need to represent more states in the future. - DiscardedDueToTooLong bool `protobuf:"varint,5,opt,name=discarded_due_to_too_long,json=discardedDueToTooLong,proto3" json:"discarded_due_to_too_long,omitempty"` + DiscardedDueToTooLong bool `protobuf:"varint,4,opt,name=discarded_due_to_too_long,json=discardedDueToTooLong,proto3" json:"discarded_due_to_too_long,omitempty"` + Subqueries []*ExplainOperator `protobuf:"bytes,5,rep,name=subqueries,proto3" json:"subqueries,omitempty"` } func (m *ExplainData) Reset() { *m = ExplainData{} } @@ -185,13 +185,6 @@ func (m *ExplainData) GetCtes() []*ExplainOperator { return nil } -func (m *ExplainData) GetSubqueries() []*ExplainOperator { - if m != nil { - return m.Subqueries - } - return nil -} - func (m *ExplainData) GetWithRuntimeStats() bool { if m != nil { return m.WithRuntimeStats @@ -206,6 +199,13 @@ func (m *ExplainData) GetDiscardedDueToTooLong() bool { return false } +func (m *ExplainData) GetSubqueries() []*ExplainOperator { + if m != nil { + return m.Subqueries + } + return nil +} + type ExplainOperator struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Children []*ExplainOperator `protobuf:"bytes,2,rep,name=children,proto3" json:"children,omitempty"` @@ -738,69 +738,69 @@ func init() { func init() { proto.RegisterFile("explain.proto", fileDescriptor_4242acda8806438c) } var fileDescriptor_4242acda8806438c = []byte{ - // 991 bytes of a gzipped FileDescriptorProto + // 992 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0x41, 0x6f, 0xdb, 0x36, - 0x14, 0xc7, 0xad, 0xd8, 0x89, 0xa5, 0x67, 0xcb, 0x56, 0xd8, 0x64, 0x73, 0x82, 0xd5, 0xf0, 0x5c, - 0x0c, 0xc8, 0x92, 0xc1, 0xc5, 0x32, 0x0c, 0x58, 0x80, 0xed, 0xd0, 0x34, 0xc5, 0x52, 0xa0, 0x58, + 0x14, 0xc7, 0xad, 0xd8, 0x89, 0xad, 0x27, 0xcb, 0x56, 0xd8, 0x64, 0x73, 0x82, 0xd5, 0xf0, 0x5c, + 0x0c, 0xf0, 0x92, 0xc1, 0xc5, 0x32, 0x0c, 0x58, 0x80, 0xed, 0xd0, 0x34, 0xc5, 0x52, 0xa0, 0x58, 0x0a, 0x25, 0x97, 0x1d, 0x06, 0x81, 0xa2, 0x18, 0x87, 0x8b, 0x2c, 0x6a, 0x24, 0xd5, 0xc4, 0xd7, 0x7d, 0x82, 0xed, 0xb4, 0xdd, 0x77, 0xd9, 0x47, 0xd9, 0xb1, 0xc7, 0x1e, 0x87, 0xe4, 0x8b, 0x0c, - 0x24, 0x25, 0x47, 0x09, 0x06, 0x17, 0xe8, 0xed, 0xf1, 0xfd, 0x7f, 0xef, 0xf1, 0xbd, 0x47, 0x8a, - 0x02, 0x9f, 0x5e, 0xe7, 0x29, 0x66, 0xd9, 0x24, 0x17, 0x5c, 0x71, 0xd4, 0x52, 0x2c, 0x8f, 0xb7, - 0x37, 0xa6, 0x7c, 0xca, 0x8d, 0xe3, 0xa9, 0xb6, 0xac, 0xb6, 0xdd, 0x17, 0x85, 0x54, 0xc6, 0xb4, - 0x8e, 0xf1, 0xaf, 0x2b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xc7, 0x5a, 0x97, 0x6f, 0x82, 0x15, 0xbd, 0x91, - 0x62, 0xe7, 0x29, 0x96, 0x17, 0x41, 0x73, 0xf7, 0x47, 0xf0, 0xef, 0xbd, 0xc7, 0xc8, 0x83, 0x55, - 0x3a, 0xcb, 0xd5, 0x3c, 0x68, 0x20, 0x1f, 0xbc, 0xb8, 0x60, 0x69, 0x72, 0xca, 0x12, 0x1a, 0x38, - 0x7a, 0x99, 0x0b, 0x1e, 0x53, 0xb3, 0x34, 0xf5, 0x48, 0x4a, 0x13, 0x7d, 0xcc, 0x41, 0x13, 0xad, - 0x83, 0x2f, 0x28, 0x29, 0x84, 0x64, 0x6f, 0xa8, 0x71, 0xb5, 0x0e, 0x0f, 0xde, 0xfd, 0xed, 0x3a, - 0xff, 0xdc, 0x0c, 0x9d, 0xb7, 0x37, 0x43, 0xe7, 0xdf, 0x9b, 0xa1, 0xf3, 0xdb, 0xed, 0xb0, 0xf1, - 0xe7, 0xed, 0xb0, 0xf1, 0xf6, 0x76, 0xd8, 0x78, 0x77, 0x3b, 0x6c, 0xc0, 0x26, 0xe1, 0xb3, 0x49, - 0xce, 0xb2, 0x29, 0xc1, 0xf9, 0x44, 0xd7, 0x69, 0xce, 0xeb, 0xb5, 0x13, 0xaf, 0x99, 0x1f, 0xf4, - 0x57, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x55, 0x43, 0x82, 0xb2, 0xde, 0x07, 0x00, 0x00, + 0x24, 0x25, 0x47, 0x09, 0x86, 0x14, 0xe8, 0xed, 0xf1, 0xfd, 0x7f, 0xef, 0xf1, 0xf1, 0x91, 0x7a, + 0x02, 0x9f, 0x5e, 0xe5, 0x29, 0x66, 0xd9, 0x34, 0x17, 0x5c, 0x71, 0xd4, 0x52, 0x2c, 0x8f, 0xb7, + 0x37, 0x66, 0x7c, 0xc6, 0x8d, 0xe3, 0xa9, 0xb6, 0xac, 0xb6, 0xdd, 0x17, 0x85, 0x54, 0xc6, 0xb4, + 0x8e, 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, 0x04, 0x2b, 0x7a, + 0x23, 0xc5, 0xce, 0x52, 0x2c, 0xcf, 0x83, 0xe6, 0xce, 0x8f, 0xe0, 0xdf, 0x99, 0xc7, 0xc8, 0x85, + 0x55, 0x3a, 0xcf, 0xd5, 0x22, 0x68, 0x20, 0x1f, 0xdc, 0xb8, 0x60, 0x69, 0x72, 0xc2, 0x12, 0x1a, + 0x38, 0x7a, 0x99, 0x0b, 0x1e, 0x53, 0xb3, 0x34, 0xf5, 0x48, 0x4a, 0x13, 0x7d, 0xcd, 0x41, 0x13, + 0xad, 0x83, 0x2f, 0x28, 0x29, 0x84, 0x64, 0x6f, 0xa8, 0x71, 0xb5, 0x0e, 0xf6, 0xdf, 0xfd, 0xdd, + 0x71, 0xfe, 0xb9, 0x1e, 0x3a, 0x6f, 0xaf, 0x87, 0xce, 0xbf, 0xd7, 0x43, 0xe7, 0xb7, 0x9b, 0x61, + 0xe3, 0xcf, 0x9b, 0x61, 0xe3, 0xed, 0xcd, 0xb0, 0xf1, 0xee, 0x66, 0xd8, 0x80, 0x4d, 0xc2, 0xe7, + 0xd3, 0x9c, 0x65, 0x33, 0x82, 0xf3, 0xa9, 0xae, 0xd3, 0xdc, 0xd7, 0x6b, 0x27, 0x5e, 0x33, 0x3f, + 0xe8, 0xaf, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x13, 0xd3, 0x59, 0xde, 0x07, 0x00, 0x00, } func (m *ExplainData) Marshal() (dAtA []byte, err error) { @@ -823,6 +823,20 @@ func (m *ExplainData) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Subqueries) > 0 { + for iNdEx := len(m.Subqueries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Subqueries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintExplain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } if m.DiscardedDueToTooLong { i-- if m.DiscardedDueToTooLong { @@ -831,7 +845,7 @@ func (m *ExplainData) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x28 + dAtA[i] = 0x20 } if m.WithRuntimeStats { i-- @@ -841,21 +855,7 @@ func (m *ExplainData) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x20 - } - if len(m.Subqueries) > 0 { - for iNdEx := len(m.Subqueries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Subqueries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintExplain(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } + dAtA[i] = 0x18 } if len(m.Ctes) > 0 { for iNdEx := len(m.Ctes) - 1; iNdEx >= 0; iNdEx-- { @@ -1364,18 +1364,18 @@ func (m *ExplainData) Size() (n int) { n += 1 + l + sovExplain(uint64(l)) } } - if len(m.Subqueries) > 0 { - for _, e := range m.Subqueries { - l = e.Size() - n += 1 + l + sovExplain(uint64(l)) - } - } if m.WithRuntimeStats { n += 2 } if m.DiscardedDueToTooLong { n += 2 } + if len(m.Subqueries) > 0 { + for _, e := range m.Subqueries { + l = e.Size() + n += 1 + l + sovExplain(uint64(l)) + } + } return n } @@ -1702,10 +1702,10 @@ func (m *ExplainData) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subqueries", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithRuntimeStats", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExplain @@ -1715,29 +1715,15 @@ func (m *ExplainData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthExplain - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthExplain - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subqueries = append(m.Subqueries, &ExplainOperator{}) - if err := m.Subqueries[len(m.Subqueries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex + m.WithRuntimeStats = bool(v != 0) case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithRuntimeStats", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DiscardedDueToTooLong", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -1754,12 +1740,12 @@ func (m *ExplainData) Unmarshal(dAtA []byte) error { break } } - m.WithRuntimeStats = bool(v != 0) + m.DiscardedDueToTooLong = bool(v != 0) case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DiscardedDueToTooLong", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subqueries", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowExplain @@ -1769,12 +1755,26 @@ func (m *ExplainData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.DiscardedDueToTooLong = bool(v != 0) + if msglen < 0 { + return ErrInvalidLengthExplain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthExplain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subqueries = append(m.Subqueries, &ExplainOperator{}) + if err := m.Subqueries[len(m.Subqueries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipExplain(dAtA[iNdEx:]) diff --git a/proto/explain.proto b/proto/explain.proto index b4cd91f6..0881b48c 100644 --- a/proto/explain.proto +++ b/proto/explain.proto @@ -19,13 +19,13 @@ option (rustproto.lite_runtime_all) = true; message ExplainData { ExplainOperator main = 1; repeated ExplainOperator ctes = 2; - repeated ExplainOperator subqueries = 3; // with_runtime_stats represents if runtime stats are available. // If not available, the act_rows, *_exec_info, memory_bytes and disk_bytes should not be used. - bool with_runtime_stats = 4; + bool with_runtime_stats = 3; // If discarded_due_to_too_long is true. The main and ctes fields should be empty and should not be used. // This field can be changed to a enum or int if we need to represent more states in the future. - bool discarded_due_to_too_long = 5; + bool discarded_due_to_too_long = 4; + repeated ExplainOperator subqueries = 5; } message ExplainOperator {