diff --git a/go/mysql/schema.go b/go/mysql/schema.go index a85d140fef9..4221386c674 100644 --- a/go/mysql/schema.go +++ b/go/mysql/schema.go @@ -23,12 +23,7 @@ import ( querypb "vitess.io/vitess/go/vt/proto/query" ) -// This file provides a few utility variables and methods, mostly for tests. -// The assumptions made about the types of fields and data returned -// by MySQl are validated in schema_test.go. This way all tests -// can use these variables and methods to simulate a MySQL server -// (using fakesqldb/ package for instance) and still be guaranteed correct -// data. +// This file contains the mysql queries used by different parts of the code. const ( // BaseShowPrimary is the base query for fetching primary key info. diff --git a/go/vt/proto/query/query.pb.go b/go/vt/proto/query/query.pb.go index c2bede30ad7..29302b4e662 100644 --- a/go/vt/proto/query/query.pb.go +++ b/go/vt/proto/query/query.pb.go @@ -475,6 +475,56 @@ func (TransactionState) EnumDescriptor() ([]byte, []int) { return file_query_proto_rawDescGZIP(), []int{3} } +// SchemaTableType represents the type of table requested. +type SchemaTableType int32 + +const ( + SchemaTableType_VIEWS SchemaTableType = 0 + SchemaTableType_TABLES SchemaTableType = 1 + SchemaTableType_ALL SchemaTableType = 2 +) + +// Enum value maps for SchemaTableType. +var ( + SchemaTableType_name = map[int32]string{ + 0: "VIEWS", + 1: "TABLES", + 2: "ALL", + } + SchemaTableType_value = map[string]int32{ + "VIEWS": 0, + "TABLES": 1, + "ALL": 2, + } +) + +func (x SchemaTableType) Enum() *SchemaTableType { + p := new(SchemaTableType) + *p = x + return p +} + +func (x SchemaTableType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SchemaTableType) Descriptor() protoreflect.EnumDescriptor { + return file_query_proto_enumTypes[4].Descriptor() +} + +func (SchemaTableType) Type() protoreflect.EnumType { + return &file_query_proto_enumTypes[4] +} + +func (x SchemaTableType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SchemaTableType.Descriptor instead. +func (SchemaTableType) EnumDescriptor() ([]byte, []int) { + return file_query_proto_rawDescGZIP(), []int{4} +} + type ExecuteOptions_IncludedFields int32 const ( @@ -508,11 +558,11 @@ func (x ExecuteOptions_IncludedFields) String() string { } func (ExecuteOptions_IncludedFields) Descriptor() protoreflect.EnumDescriptor { - return file_query_proto_enumTypes[4].Descriptor() + return file_query_proto_enumTypes[5].Descriptor() } func (ExecuteOptions_IncludedFields) Type() protoreflect.EnumType { - return &file_query_proto_enumTypes[4] + return &file_query_proto_enumTypes[5] } func (x ExecuteOptions_IncludedFields) Number() protoreflect.EnumNumber { @@ -560,11 +610,11 @@ func (x ExecuteOptions_Workload) String() string { } func (ExecuteOptions_Workload) Descriptor() protoreflect.EnumDescriptor { - return file_query_proto_enumTypes[5].Descriptor() + return file_query_proto_enumTypes[6].Descriptor() } func (ExecuteOptions_Workload) Type() protoreflect.EnumType { - return &file_query_proto_enumTypes[5] + return &file_query_proto_enumTypes[6] } func (x ExecuteOptions_Workload) Number() protoreflect.EnumNumber { @@ -625,11 +675,11 @@ func (x ExecuteOptions_TransactionIsolation) String() string { } func (ExecuteOptions_TransactionIsolation) Descriptor() protoreflect.EnumDescriptor { - return file_query_proto_enumTypes[6].Descriptor() + return file_query_proto_enumTypes[7].Descriptor() } func (ExecuteOptions_TransactionIsolation) Type() protoreflect.EnumType { - return &file_query_proto_enumTypes[6] + return &file_query_proto_enumTypes[7] } func (x ExecuteOptions_TransactionIsolation) Number() protoreflect.EnumNumber { @@ -686,11 +736,11 @@ func (x ExecuteOptions_PlannerVersion) String() string { } func (ExecuteOptions_PlannerVersion) Descriptor() protoreflect.EnumDescriptor { - return file_query_proto_enumTypes[7].Descriptor() + return file_query_proto_enumTypes[8].Descriptor() } func (ExecuteOptions_PlannerVersion) Type() protoreflect.EnumType { - return &file_query_proto_enumTypes[7] + return &file_query_proto_enumTypes[8] } func (x ExecuteOptions_PlannerVersion) Number() protoreflect.EnumNumber { @@ -738,11 +788,11 @@ func (x ExecuteOptions_Consolidator) String() string { } func (ExecuteOptions_Consolidator) Descriptor() protoreflect.EnumDescriptor { - return file_query_proto_enumTypes[8].Descriptor() + return file_query_proto_enumTypes[9].Descriptor() } func (ExecuteOptions_Consolidator) Type() protoreflect.EnumType { - return &file_query_proto_enumTypes[8] + return &file_query_proto_enumTypes[9] } func (x ExecuteOptions_Consolidator) Number() protoreflect.EnumNumber { @@ -787,11 +837,11 @@ func (x ExecuteOptions_TransactionAccessMode) String() string { } func (ExecuteOptions_TransactionAccessMode) Descriptor() protoreflect.EnumDescriptor { - return file_query_proto_enumTypes[9].Descriptor() + return file_query_proto_enumTypes[10].Descriptor() } func (ExecuteOptions_TransactionAccessMode) Type() protoreflect.EnumType { - return &file_query_proto_enumTypes[9] + return &file_query_proto_enumTypes[10] } func (x ExecuteOptions_TransactionAccessMode) Number() protoreflect.EnumNumber { @@ -837,11 +887,11 @@ func (x StreamEvent_Statement_Category) String() string { } func (StreamEvent_Statement_Category) Descriptor() protoreflect.EnumDescriptor { - return file_query_proto_enumTypes[10].Descriptor() + return file_query_proto_enumTypes[11].Descriptor() } func (StreamEvent_Statement_Category) Type() protoreflect.EnumType { - return &file_query_proto_enumTypes[10] + return &file_query_proto_enumTypes[11] } func (x StreamEvent_Statement_Category) Number() protoreflect.EnumNumber { @@ -5365,6 +5415,119 @@ func (x *TransactionMetadata) GetParticipants() []*Target { return nil } +// GetSchemaRequest is the payload to GetSchema +type GetSchemaRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Target *Target `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` + TableType SchemaTableType `protobuf:"varint,2,opt,name=table_type,json=tableType,proto3,enum=query.SchemaTableType" json:"table_type,omitempty"` + TableNames []string `protobuf:"bytes,3,rep,name=table_names,json=tableNames,proto3" json:"table_names,omitempty"` +} + +func (x *GetSchemaRequest) Reset() { + *x = GetSchemaRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_query_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetSchemaRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSchemaRequest) ProtoMessage() {} + +func (x *GetSchemaRequest) ProtoReflect() protoreflect.Message { + mi := &file_query_proto_msgTypes[62] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSchemaRequest.ProtoReflect.Descriptor instead. +func (*GetSchemaRequest) Descriptor() ([]byte, []int) { + return file_query_proto_rawDescGZIP(), []int{62} +} + +func (x *GetSchemaRequest) GetTarget() *Target { + if x != nil { + return x.Target + } + return nil +} + +func (x *GetSchemaRequest) GetTableType() SchemaTableType { + if x != nil { + return x.TableType + } + return SchemaTableType_VIEWS +} + +func (x *GetSchemaRequest) GetTableNames() []string { + if x != nil { + return x.TableNames + } + return nil +} + +// GetSchemaResponse is the returned value from GetSchema +type GetSchemaResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // this is for the schema definition for the requested tables. + TableDefinition map[string]string `protobuf:"bytes,2,rep,name=table_definition,json=tableDefinition,proto3" json:"table_definition,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *GetSchemaResponse) Reset() { + *x = GetSchemaResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_query_proto_msgTypes[63] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetSchemaResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSchemaResponse) ProtoMessage() {} + +func (x *GetSchemaResponse) ProtoReflect() protoreflect.Message { + mi := &file_query_proto_msgTypes[63] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSchemaResponse.ProtoReflect.Descriptor instead. +func (*GetSchemaResponse) Descriptor() ([]byte, []int) { + return file_query_proto_rawDescGZIP(), []int{63} +} + +func (x *GetSchemaResponse) GetTableDefinition() map[string]string { + if x != nil { + return x.TableDefinition + } + return nil +} + // One individual Statement in a transaction. type StreamEvent_Statement struct { state protoimpl.MessageState @@ -5384,7 +5547,7 @@ type StreamEvent_Statement struct { func (x *StreamEvent_Statement) Reset() { *x = StreamEvent_Statement{} if protoimpl.UnsafeEnabled { - mi := &file_query_proto_msgTypes[63] + mi := &file_query_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5397,7 +5560,7 @@ func (x *StreamEvent_Statement) String() string { func (*StreamEvent_Statement) ProtoMessage() {} func (x *StreamEvent_Statement) ProtoReflect() protoreflect.Message { - mi := &file_query_proto_msgTypes[63] + mi := &file_query_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6267,76 +6430,100 @@ var file_query_proto_rawDesc = []byte{ 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x31, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x2a, - 0x92, 0x03, 0x0a, 0x09, 0x4d, 0x79, 0x53, 0x71, 0x6c, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x09, 0x0a, - 0x05, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x4f, 0x54, 0x5f, - 0x4e, 0x55, 0x4c, 0x4c, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x50, - 0x52, 0x49, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x02, 0x12, 0x13, 0x0a, - 0x0f, 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, - 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x50, 0x4c, 0x45, 0x5f, 0x4b, - 0x45, 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x08, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x4c, 0x4f, - 0x42, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x10, 0x12, 0x11, 0x0a, 0x0d, 0x55, 0x4e, 0x53, 0x49, - 0x47, 0x4e, 0x45, 0x44, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x20, 0x12, 0x11, 0x0a, 0x0d, 0x5a, - 0x45, 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x4c, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x40, 0x12, 0x10, - 0x0a, 0x0b, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x01, - 0x12, 0x0e, 0x0a, 0x09, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x02, - 0x12, 0x18, 0x0a, 0x13, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x49, 0x4e, 0x43, 0x52, 0x45, 0x4d, 0x45, - 0x4e, 0x54, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x04, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x49, - 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x08, 0x12, - 0x0d, 0x0a, 0x08, 0x53, 0x45, 0x54, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x10, 0x12, 0x1a, - 0x0a, 0x15, 0x4e, 0x4f, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x56, 0x41, 0x4c, - 0x55, 0x45, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x20, 0x12, 0x17, 0x0a, 0x12, 0x4f, 0x4e, - 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x4e, 0x4f, 0x57, 0x5f, 0x46, 0x4c, 0x41, 0x47, - 0x10, 0x80, 0x40, 0x12, 0x0e, 0x0a, 0x08, 0x4e, 0x55, 0x4d, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, - 0x80, 0x80, 0x02, 0x12, 0x13, 0x0a, 0x0d, 0x50, 0x41, 0x52, 0x54, 0x5f, 0x4b, 0x45, 0x59, 0x5f, - 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x01, 0x12, 0x10, 0x0a, 0x0a, 0x47, 0x52, 0x4f, 0x55, - 0x50, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x02, 0x12, 0x11, 0x0a, 0x0b, 0x55, 0x4e, - 0x49, 0x51, 0x55, 0x45, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x04, 0x12, 0x11, 0x0a, - 0x0b, 0x42, 0x49, 0x4e, 0x43, 0x4d, 0x50, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x08, - 0x1a, 0x02, 0x10, 0x01, 0x2a, 0x6b, 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x08, 0x0a, 0x04, - 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0a, 0x49, 0x53, 0x49, 0x4e, 0x54, 0x45, - 0x47, 0x52, 0x41, 0x4c, 0x10, 0x80, 0x02, 0x12, 0x0f, 0x0a, 0x0a, 0x49, 0x53, 0x55, 0x4e, 0x53, - 0x49, 0x47, 0x4e, 0x45, 0x44, 0x10, 0x80, 0x04, 0x12, 0x0c, 0x0a, 0x07, 0x49, 0x53, 0x46, 0x4c, - 0x4f, 0x41, 0x54, 0x10, 0x80, 0x08, 0x12, 0x0d, 0x0a, 0x08, 0x49, 0x53, 0x51, 0x55, 0x4f, 0x54, - 0x45, 0x44, 0x10, 0x80, 0x10, 0x12, 0x0b, 0x0a, 0x06, 0x49, 0x53, 0x54, 0x45, 0x58, 0x54, 0x10, - 0x80, 0x20, 0x12, 0x0d, 0x0a, 0x08, 0x49, 0x53, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x80, - 0x40, 0x2a, 0xc0, 0x03, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x55, - 0x4c, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x04, 0x49, 0x4e, 0x54, - 0x38, 0x10, 0x81, 0x02, 0x12, 0x0a, 0x0a, 0x05, 0x55, 0x49, 0x4e, 0x54, 0x38, 0x10, 0x82, 0x06, - 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, 0x83, 0x02, 0x12, 0x0b, 0x0a, 0x06, - 0x55, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, 0x84, 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, - 0x32, 0x34, 0x10, 0x85, 0x02, 0x12, 0x0b, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x32, 0x34, 0x10, - 0x86, 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x87, 0x02, 0x12, 0x0b, - 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x88, 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, - 0x4e, 0x54, 0x36, 0x34, 0x10, 0x89, 0x02, 0x12, 0x0b, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, - 0x34, 0x10, 0x8a, 0x06, 0x12, 0x0c, 0x0a, 0x07, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x33, 0x32, 0x10, - 0x8b, 0x08, 0x12, 0x0c, 0x0a, 0x07, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x36, 0x34, 0x10, 0x8c, 0x08, - 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x8d, 0x10, - 0x12, 0x09, 0x0a, 0x04, 0x44, 0x41, 0x54, 0x45, 0x10, 0x8e, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x54, - 0x49, 0x4d, 0x45, 0x10, 0x8f, 0x10, 0x12, 0x0d, 0x0a, 0x08, 0x44, 0x41, 0x54, 0x45, 0x54, 0x49, - 0x4d, 0x45, 0x10, 0x90, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x59, 0x45, 0x41, 0x52, 0x10, 0x91, 0x06, - 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x43, 0x49, 0x4d, 0x41, 0x4c, 0x10, 0x12, 0x12, 0x09, 0x0a, - 0x04, 0x54, 0x45, 0x58, 0x54, 0x10, 0x93, 0x30, 0x12, 0x09, 0x0a, 0x04, 0x42, 0x4c, 0x4f, 0x42, - 0x10, 0x94, 0x50, 0x12, 0x0c, 0x0a, 0x07, 0x56, 0x41, 0x52, 0x43, 0x48, 0x41, 0x52, 0x10, 0x95, - 0x30, 0x12, 0x0e, 0x0a, 0x09, 0x56, 0x41, 0x52, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x96, - 0x50, 0x12, 0x09, 0x0a, 0x04, 0x43, 0x48, 0x41, 0x52, 0x10, 0x97, 0x30, 0x12, 0x0b, 0x0a, 0x06, - 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x98, 0x50, 0x12, 0x08, 0x0a, 0x03, 0x42, 0x49, 0x54, - 0x10, 0x99, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x9a, 0x10, 0x12, 0x08, - 0x0a, 0x03, 0x53, 0x45, 0x54, 0x10, 0x9b, 0x10, 0x12, 0x09, 0x0a, 0x05, 0x54, 0x55, 0x50, 0x4c, - 0x45, 0x10, 0x1c, 0x12, 0x0d, 0x0a, 0x08, 0x47, 0x45, 0x4f, 0x4d, 0x45, 0x54, 0x52, 0x59, 0x10, - 0x9d, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x9e, 0x10, 0x12, 0x0e, 0x0a, - 0x0a, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x1f, 0x12, 0x0b, 0x0a, - 0x06, 0x48, 0x45, 0x58, 0x4e, 0x55, 0x4d, 0x10, 0xa0, 0x20, 0x12, 0x0b, 0x0a, 0x06, 0x48, 0x45, - 0x58, 0x56, 0x41, 0x4c, 0x10, 0xa1, 0x20, 0x12, 0x0b, 0x0a, 0x06, 0x42, 0x49, 0x54, 0x4e, 0x55, - 0x4d, 0x10, 0xa2, 0x20, 0x2a, 0x46, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, - 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x45, 0x50, 0x41, 0x52, 0x45, - 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x02, 0x12, 0x0c, - 0x0a, 0x08, 0x52, 0x4f, 0x4c, 0x4c, 0x42, 0x41, 0x43, 0x4b, 0x10, 0x03, 0x42, 0x35, 0x0a, 0x0f, - 0x69, 0x6f, 0x2e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5a, - 0x22, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, - 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x22, + 0x91, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x35, 0x0a, 0x0a, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x16, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x1a, 0x42, 0x0a, 0x14, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x92, 0x03, 0x0a, 0x09, 0x4d, 0x79, 0x53, 0x71, + 0x6c, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x10, 0x00, + 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x4f, 0x54, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x5f, 0x46, 0x4c, 0x41, + 0x47, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x52, 0x49, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x46, + 0x4c, 0x41, 0x47, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x5f, + 0x4b, 0x45, 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x4d, 0x55, + 0x4c, 0x54, 0x49, 0x50, 0x4c, 0x45, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, + 0x08, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x10, + 0x12, 0x11, 0x0a, 0x0d, 0x55, 0x4e, 0x53, 0x49, 0x47, 0x4e, 0x45, 0x44, 0x5f, 0x46, 0x4c, 0x41, + 0x47, 0x10, 0x20, 0x12, 0x11, 0x0a, 0x0d, 0x5a, 0x45, 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x4c, 0x5f, + 0x46, 0x4c, 0x41, 0x47, 0x10, 0x40, 0x12, 0x10, 0x0a, 0x0b, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, + 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x01, 0x12, 0x0e, 0x0a, 0x09, 0x45, 0x4e, 0x55, 0x4d, + 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x02, 0x12, 0x18, 0x0a, 0x13, 0x41, 0x55, 0x54, 0x4f, + 0x5f, 0x49, 0x4e, 0x43, 0x52, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, + 0x80, 0x04, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, + 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x08, 0x12, 0x0d, 0x0a, 0x08, 0x53, 0x45, 0x54, 0x5f, 0x46, + 0x4c, 0x41, 0x47, 0x10, 0x80, 0x10, 0x12, 0x1a, 0x0a, 0x15, 0x4e, 0x4f, 0x5f, 0x44, 0x45, 0x46, + 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, + 0x80, 0x20, 0x12, 0x17, 0x0a, 0x12, 0x4f, 0x4e, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, + 0x4e, 0x4f, 0x57, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x40, 0x12, 0x0e, 0x0a, 0x08, 0x4e, + 0x55, 0x4d, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x02, 0x12, 0x13, 0x0a, 0x0d, 0x50, + 0x41, 0x52, 0x54, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x01, + 0x12, 0x10, 0x0a, 0x0a, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, + 0x80, 0x02, 0x12, 0x11, 0x0a, 0x0b, 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x5f, 0x46, 0x4c, 0x41, + 0x47, 0x10, 0x80, 0x80, 0x04, 0x12, 0x11, 0x0a, 0x0b, 0x42, 0x49, 0x4e, 0x43, 0x4d, 0x50, 0x5f, + 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x08, 0x1a, 0x02, 0x10, 0x01, 0x2a, 0x6b, 0x0a, 0x04, + 0x46, 0x6c, 0x61, 0x67, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0f, + 0x0a, 0x0a, 0x49, 0x53, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x52, 0x41, 0x4c, 0x10, 0x80, 0x02, 0x12, + 0x0f, 0x0a, 0x0a, 0x49, 0x53, 0x55, 0x4e, 0x53, 0x49, 0x47, 0x4e, 0x45, 0x44, 0x10, 0x80, 0x04, + 0x12, 0x0c, 0x0a, 0x07, 0x49, 0x53, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x80, 0x08, 0x12, 0x0d, + 0x0a, 0x08, 0x49, 0x53, 0x51, 0x55, 0x4f, 0x54, 0x45, 0x44, 0x10, 0x80, 0x10, 0x12, 0x0b, 0x0a, + 0x06, 0x49, 0x53, 0x54, 0x45, 0x58, 0x54, 0x10, 0x80, 0x20, 0x12, 0x0d, 0x0a, 0x08, 0x49, 0x53, + 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x80, 0x40, 0x2a, 0xc0, 0x03, 0x0a, 0x04, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x55, 0x4c, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, + 0x00, 0x12, 0x09, 0x0a, 0x04, 0x49, 0x4e, 0x54, 0x38, 0x10, 0x81, 0x02, 0x12, 0x0a, 0x0a, 0x05, + 0x55, 0x49, 0x4e, 0x54, 0x38, 0x10, 0x82, 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x31, + 0x36, 0x10, 0x83, 0x02, 0x12, 0x0b, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, 0x84, + 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x32, 0x34, 0x10, 0x85, 0x02, 0x12, 0x0b, 0x0a, + 0x06, 0x55, 0x49, 0x4e, 0x54, 0x32, 0x34, 0x10, 0x86, 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, + 0x54, 0x33, 0x32, 0x10, 0x87, 0x02, 0x12, 0x0b, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, + 0x10, 0x88, 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x89, 0x02, 0x12, + 0x0b, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x8a, 0x06, 0x12, 0x0c, 0x0a, 0x07, + 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x33, 0x32, 0x10, 0x8b, 0x08, 0x12, 0x0c, 0x0a, 0x07, 0x46, 0x4c, + 0x4f, 0x41, 0x54, 0x36, 0x34, 0x10, 0x8c, 0x08, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, + 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x8d, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x44, 0x41, 0x54, 0x45, + 0x10, 0x8e, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x8f, 0x10, 0x12, 0x0d, + 0x0a, 0x08, 0x44, 0x41, 0x54, 0x45, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x90, 0x10, 0x12, 0x09, 0x0a, + 0x04, 0x59, 0x45, 0x41, 0x52, 0x10, 0x91, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x43, 0x49, + 0x4d, 0x41, 0x4c, 0x10, 0x12, 0x12, 0x09, 0x0a, 0x04, 0x54, 0x45, 0x58, 0x54, 0x10, 0x93, 0x30, + 0x12, 0x09, 0x0a, 0x04, 0x42, 0x4c, 0x4f, 0x42, 0x10, 0x94, 0x50, 0x12, 0x0c, 0x0a, 0x07, 0x56, + 0x41, 0x52, 0x43, 0x48, 0x41, 0x52, 0x10, 0x95, 0x30, 0x12, 0x0e, 0x0a, 0x09, 0x56, 0x41, 0x52, + 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x96, 0x50, 0x12, 0x09, 0x0a, 0x04, 0x43, 0x48, 0x41, + 0x52, 0x10, 0x97, 0x30, 0x12, 0x0b, 0x0a, 0x06, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x98, + 0x50, 0x12, 0x08, 0x0a, 0x03, 0x42, 0x49, 0x54, 0x10, 0x99, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x45, + 0x4e, 0x55, 0x4d, 0x10, 0x9a, 0x10, 0x12, 0x08, 0x0a, 0x03, 0x53, 0x45, 0x54, 0x10, 0x9b, 0x10, + 0x12, 0x09, 0x0a, 0x05, 0x54, 0x55, 0x50, 0x4c, 0x45, 0x10, 0x1c, 0x12, 0x0d, 0x0a, 0x08, 0x47, + 0x45, 0x4f, 0x4d, 0x45, 0x54, 0x52, 0x59, 0x10, 0x9d, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x4a, 0x53, + 0x4f, 0x4e, 0x10, 0x9e, 0x10, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, + 0x49, 0x4f, 0x4e, 0x10, 0x1f, 0x12, 0x0b, 0x0a, 0x06, 0x48, 0x45, 0x58, 0x4e, 0x55, 0x4d, 0x10, + 0xa0, 0x20, 0x12, 0x0b, 0x0a, 0x06, 0x48, 0x45, 0x58, 0x56, 0x41, 0x4c, 0x10, 0xa1, 0x20, 0x12, + 0x0b, 0x0a, 0x06, 0x42, 0x49, 0x54, 0x4e, 0x55, 0x4d, 0x10, 0xa2, 0x20, 0x2a, 0x46, 0x0a, 0x10, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, + 0x07, 0x50, 0x52, 0x45, 0x50, 0x41, 0x52, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, + 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x4f, 0x4c, 0x4c, 0x42, 0x41, + 0x43, 0x4b, 0x10, 0x03, 0x2a, 0x31, 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x49, 0x45, 0x57, 0x53, + 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x53, 0x10, 0x01, 0x12, 0x07, + 0x0a, 0x03, 0x41, 0x4c, 0x4c, 0x10, 0x02, 0x42, 0x35, 0x0a, 0x0f, 0x69, 0x6f, 0x2e, 0x76, 0x69, + 0x74, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x22, 0x76, 0x69, 0x74, 0x65, + 0x73, 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, + 0x76, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6351,231 +6538,238 @@ func file_query_proto_rawDescGZIP() []byte { return file_query_proto_rawDescData } -var file_query_proto_enumTypes = make([]protoimpl.EnumInfo, 11) -var file_query_proto_msgTypes = make([]protoimpl.MessageInfo, 64) +var file_query_proto_enumTypes = make([]protoimpl.EnumInfo, 12) +var file_query_proto_msgTypes = make([]protoimpl.MessageInfo, 67) var file_query_proto_goTypes = []interface{}{ (MySqlFlag)(0), // 0: query.MySqlFlag (Flag)(0), // 1: query.Flag (Type)(0), // 2: query.Type (TransactionState)(0), // 3: query.TransactionState - (ExecuteOptions_IncludedFields)(0), // 4: query.ExecuteOptions.IncludedFields - (ExecuteOptions_Workload)(0), // 5: query.ExecuteOptions.Workload - (ExecuteOptions_TransactionIsolation)(0), // 6: query.ExecuteOptions.TransactionIsolation - (ExecuteOptions_PlannerVersion)(0), // 7: query.ExecuteOptions.PlannerVersion - (ExecuteOptions_Consolidator)(0), // 8: query.ExecuteOptions.Consolidator - (ExecuteOptions_TransactionAccessMode)(0), // 9: query.ExecuteOptions.TransactionAccessMode - (StreamEvent_Statement_Category)(0), // 10: query.StreamEvent.Statement.Category - (*Target)(nil), // 11: query.Target - (*VTGateCallerID)(nil), // 12: query.VTGateCallerID - (*EventToken)(nil), // 13: query.EventToken - (*Value)(nil), // 14: query.Value - (*BindVariable)(nil), // 15: query.BindVariable - (*BoundQuery)(nil), // 16: query.BoundQuery - (*ExecuteOptions)(nil), // 17: query.ExecuteOptions - (*Field)(nil), // 18: query.Field - (*Row)(nil), // 19: query.Row - (*QueryResult)(nil), // 20: query.QueryResult - (*QueryWarning)(nil), // 21: query.QueryWarning - (*StreamEvent)(nil), // 22: query.StreamEvent - (*ExecuteRequest)(nil), // 23: query.ExecuteRequest - (*ExecuteResponse)(nil), // 24: query.ExecuteResponse - (*ResultWithError)(nil), // 25: query.ResultWithError - (*StreamExecuteRequest)(nil), // 26: query.StreamExecuteRequest - (*StreamExecuteResponse)(nil), // 27: query.StreamExecuteResponse - (*BeginRequest)(nil), // 28: query.BeginRequest - (*BeginResponse)(nil), // 29: query.BeginResponse - (*CommitRequest)(nil), // 30: query.CommitRequest - (*CommitResponse)(nil), // 31: query.CommitResponse - (*RollbackRequest)(nil), // 32: query.RollbackRequest - (*RollbackResponse)(nil), // 33: query.RollbackResponse - (*PrepareRequest)(nil), // 34: query.PrepareRequest - (*PrepareResponse)(nil), // 35: query.PrepareResponse - (*CommitPreparedRequest)(nil), // 36: query.CommitPreparedRequest - (*CommitPreparedResponse)(nil), // 37: query.CommitPreparedResponse - (*RollbackPreparedRequest)(nil), // 38: query.RollbackPreparedRequest - (*RollbackPreparedResponse)(nil), // 39: query.RollbackPreparedResponse - (*CreateTransactionRequest)(nil), // 40: query.CreateTransactionRequest - (*CreateTransactionResponse)(nil), // 41: query.CreateTransactionResponse - (*StartCommitRequest)(nil), // 42: query.StartCommitRequest - (*StartCommitResponse)(nil), // 43: query.StartCommitResponse - (*SetRollbackRequest)(nil), // 44: query.SetRollbackRequest - (*SetRollbackResponse)(nil), // 45: query.SetRollbackResponse - (*ConcludeTransactionRequest)(nil), // 46: query.ConcludeTransactionRequest - (*ConcludeTransactionResponse)(nil), // 47: query.ConcludeTransactionResponse - (*ReadTransactionRequest)(nil), // 48: query.ReadTransactionRequest - (*ReadTransactionResponse)(nil), // 49: query.ReadTransactionResponse - (*BeginExecuteRequest)(nil), // 50: query.BeginExecuteRequest - (*BeginExecuteResponse)(nil), // 51: query.BeginExecuteResponse - (*BeginStreamExecuteRequest)(nil), // 52: query.BeginStreamExecuteRequest - (*BeginStreamExecuteResponse)(nil), // 53: query.BeginStreamExecuteResponse - (*MessageStreamRequest)(nil), // 54: query.MessageStreamRequest - (*MessageStreamResponse)(nil), // 55: query.MessageStreamResponse - (*MessageAckRequest)(nil), // 56: query.MessageAckRequest - (*MessageAckResponse)(nil), // 57: query.MessageAckResponse - (*ReserveExecuteRequest)(nil), // 58: query.ReserveExecuteRequest - (*ReserveExecuteResponse)(nil), // 59: query.ReserveExecuteResponse - (*ReserveStreamExecuteRequest)(nil), // 60: query.ReserveStreamExecuteRequest - (*ReserveStreamExecuteResponse)(nil), // 61: query.ReserveStreamExecuteResponse - (*ReserveBeginExecuteRequest)(nil), // 62: query.ReserveBeginExecuteRequest - (*ReserveBeginExecuteResponse)(nil), // 63: query.ReserveBeginExecuteResponse - (*ReserveBeginStreamExecuteRequest)(nil), // 64: query.ReserveBeginStreamExecuteRequest - (*ReserveBeginStreamExecuteResponse)(nil), // 65: query.ReserveBeginStreamExecuteResponse - (*ReleaseRequest)(nil), // 66: query.ReleaseRequest - (*ReleaseResponse)(nil), // 67: query.ReleaseResponse - (*StreamHealthRequest)(nil), // 68: query.StreamHealthRequest - (*RealtimeStats)(nil), // 69: query.RealtimeStats - (*AggregateStats)(nil), // 70: query.AggregateStats - (*StreamHealthResponse)(nil), // 71: query.StreamHealthResponse - (*TransactionMetadata)(nil), // 72: query.TransactionMetadata - nil, // 73: query.BoundQuery.BindVariablesEntry - (*StreamEvent_Statement)(nil), // 74: query.StreamEvent.Statement - (topodata.TabletType)(0), // 75: topodata.TabletType - (*vtrpc.CallerID)(nil), // 76: vtrpc.CallerID - (*vtrpc.RPCError)(nil), // 77: vtrpc.RPCError - (*topodata.TabletAlias)(nil), // 78: topodata.TabletAlias + (SchemaTableType)(0), // 4: query.SchemaTableType + (ExecuteOptions_IncludedFields)(0), // 5: query.ExecuteOptions.IncludedFields + (ExecuteOptions_Workload)(0), // 6: query.ExecuteOptions.Workload + (ExecuteOptions_TransactionIsolation)(0), // 7: query.ExecuteOptions.TransactionIsolation + (ExecuteOptions_PlannerVersion)(0), // 8: query.ExecuteOptions.PlannerVersion + (ExecuteOptions_Consolidator)(0), // 9: query.ExecuteOptions.Consolidator + (ExecuteOptions_TransactionAccessMode)(0), // 10: query.ExecuteOptions.TransactionAccessMode + (StreamEvent_Statement_Category)(0), // 11: query.StreamEvent.Statement.Category + (*Target)(nil), // 12: query.Target + (*VTGateCallerID)(nil), // 13: query.VTGateCallerID + (*EventToken)(nil), // 14: query.EventToken + (*Value)(nil), // 15: query.Value + (*BindVariable)(nil), // 16: query.BindVariable + (*BoundQuery)(nil), // 17: query.BoundQuery + (*ExecuteOptions)(nil), // 18: query.ExecuteOptions + (*Field)(nil), // 19: query.Field + (*Row)(nil), // 20: query.Row + (*QueryResult)(nil), // 21: query.QueryResult + (*QueryWarning)(nil), // 22: query.QueryWarning + (*StreamEvent)(nil), // 23: query.StreamEvent + (*ExecuteRequest)(nil), // 24: query.ExecuteRequest + (*ExecuteResponse)(nil), // 25: query.ExecuteResponse + (*ResultWithError)(nil), // 26: query.ResultWithError + (*StreamExecuteRequest)(nil), // 27: query.StreamExecuteRequest + (*StreamExecuteResponse)(nil), // 28: query.StreamExecuteResponse + (*BeginRequest)(nil), // 29: query.BeginRequest + (*BeginResponse)(nil), // 30: query.BeginResponse + (*CommitRequest)(nil), // 31: query.CommitRequest + (*CommitResponse)(nil), // 32: query.CommitResponse + (*RollbackRequest)(nil), // 33: query.RollbackRequest + (*RollbackResponse)(nil), // 34: query.RollbackResponse + (*PrepareRequest)(nil), // 35: query.PrepareRequest + (*PrepareResponse)(nil), // 36: query.PrepareResponse + (*CommitPreparedRequest)(nil), // 37: query.CommitPreparedRequest + (*CommitPreparedResponse)(nil), // 38: query.CommitPreparedResponse + (*RollbackPreparedRequest)(nil), // 39: query.RollbackPreparedRequest + (*RollbackPreparedResponse)(nil), // 40: query.RollbackPreparedResponse + (*CreateTransactionRequest)(nil), // 41: query.CreateTransactionRequest + (*CreateTransactionResponse)(nil), // 42: query.CreateTransactionResponse + (*StartCommitRequest)(nil), // 43: query.StartCommitRequest + (*StartCommitResponse)(nil), // 44: query.StartCommitResponse + (*SetRollbackRequest)(nil), // 45: query.SetRollbackRequest + (*SetRollbackResponse)(nil), // 46: query.SetRollbackResponse + (*ConcludeTransactionRequest)(nil), // 47: query.ConcludeTransactionRequest + (*ConcludeTransactionResponse)(nil), // 48: query.ConcludeTransactionResponse + (*ReadTransactionRequest)(nil), // 49: query.ReadTransactionRequest + (*ReadTransactionResponse)(nil), // 50: query.ReadTransactionResponse + (*BeginExecuteRequest)(nil), // 51: query.BeginExecuteRequest + (*BeginExecuteResponse)(nil), // 52: query.BeginExecuteResponse + (*BeginStreamExecuteRequest)(nil), // 53: query.BeginStreamExecuteRequest + (*BeginStreamExecuteResponse)(nil), // 54: query.BeginStreamExecuteResponse + (*MessageStreamRequest)(nil), // 55: query.MessageStreamRequest + (*MessageStreamResponse)(nil), // 56: query.MessageStreamResponse + (*MessageAckRequest)(nil), // 57: query.MessageAckRequest + (*MessageAckResponse)(nil), // 58: query.MessageAckResponse + (*ReserveExecuteRequest)(nil), // 59: query.ReserveExecuteRequest + (*ReserveExecuteResponse)(nil), // 60: query.ReserveExecuteResponse + (*ReserveStreamExecuteRequest)(nil), // 61: query.ReserveStreamExecuteRequest + (*ReserveStreamExecuteResponse)(nil), // 62: query.ReserveStreamExecuteResponse + (*ReserveBeginExecuteRequest)(nil), // 63: query.ReserveBeginExecuteRequest + (*ReserveBeginExecuteResponse)(nil), // 64: query.ReserveBeginExecuteResponse + (*ReserveBeginStreamExecuteRequest)(nil), // 65: query.ReserveBeginStreamExecuteRequest + (*ReserveBeginStreamExecuteResponse)(nil), // 66: query.ReserveBeginStreamExecuteResponse + (*ReleaseRequest)(nil), // 67: query.ReleaseRequest + (*ReleaseResponse)(nil), // 68: query.ReleaseResponse + (*StreamHealthRequest)(nil), // 69: query.StreamHealthRequest + (*RealtimeStats)(nil), // 70: query.RealtimeStats + (*AggregateStats)(nil), // 71: query.AggregateStats + (*StreamHealthResponse)(nil), // 72: query.StreamHealthResponse + (*TransactionMetadata)(nil), // 73: query.TransactionMetadata + (*GetSchemaRequest)(nil), // 74: query.GetSchemaRequest + (*GetSchemaResponse)(nil), // 75: query.GetSchemaResponse + nil, // 76: query.BoundQuery.BindVariablesEntry + (*StreamEvent_Statement)(nil), // 77: query.StreamEvent.Statement + nil, // 78: query.GetSchemaResponse.TableDefinitionEntry + (topodata.TabletType)(0), // 79: topodata.TabletType + (*vtrpc.CallerID)(nil), // 80: vtrpc.CallerID + (*vtrpc.RPCError)(nil), // 81: vtrpc.RPCError + (*topodata.TabletAlias)(nil), // 82: topodata.TabletAlias } var file_query_proto_depIdxs = []int32{ - 75, // 0: query.Target.tablet_type:type_name -> topodata.TabletType + 79, // 0: query.Target.tablet_type:type_name -> topodata.TabletType 2, // 1: query.Value.type:type_name -> query.Type 2, // 2: query.BindVariable.type:type_name -> query.Type - 14, // 3: query.BindVariable.values:type_name -> query.Value - 73, // 4: query.BoundQuery.bind_variables:type_name -> query.BoundQuery.BindVariablesEntry - 4, // 5: query.ExecuteOptions.included_fields:type_name -> query.ExecuteOptions.IncludedFields - 5, // 6: query.ExecuteOptions.workload:type_name -> query.ExecuteOptions.Workload - 6, // 7: query.ExecuteOptions.transaction_isolation:type_name -> query.ExecuteOptions.TransactionIsolation - 7, // 8: query.ExecuteOptions.planner_version:type_name -> query.ExecuteOptions.PlannerVersion - 8, // 9: query.ExecuteOptions.consolidator:type_name -> query.ExecuteOptions.Consolidator - 9, // 10: query.ExecuteOptions.transaction_access_mode:type_name -> query.ExecuteOptions.TransactionAccessMode + 15, // 3: query.BindVariable.values:type_name -> query.Value + 76, // 4: query.BoundQuery.bind_variables:type_name -> query.BoundQuery.BindVariablesEntry + 5, // 5: query.ExecuteOptions.included_fields:type_name -> query.ExecuteOptions.IncludedFields + 6, // 6: query.ExecuteOptions.workload:type_name -> query.ExecuteOptions.Workload + 7, // 7: query.ExecuteOptions.transaction_isolation:type_name -> query.ExecuteOptions.TransactionIsolation + 8, // 8: query.ExecuteOptions.planner_version:type_name -> query.ExecuteOptions.PlannerVersion + 9, // 9: query.ExecuteOptions.consolidator:type_name -> query.ExecuteOptions.Consolidator + 10, // 10: query.ExecuteOptions.transaction_access_mode:type_name -> query.ExecuteOptions.TransactionAccessMode 2, // 11: query.Field.type:type_name -> query.Type - 18, // 12: query.QueryResult.fields:type_name -> query.Field - 19, // 13: query.QueryResult.rows:type_name -> query.Row - 74, // 14: query.StreamEvent.statements:type_name -> query.StreamEvent.Statement - 13, // 15: query.StreamEvent.event_token:type_name -> query.EventToken - 76, // 16: query.ExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 17: query.ExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 18: query.ExecuteRequest.target:type_name -> query.Target - 16, // 19: query.ExecuteRequest.query:type_name -> query.BoundQuery - 17, // 20: query.ExecuteRequest.options:type_name -> query.ExecuteOptions - 20, // 21: query.ExecuteResponse.result:type_name -> query.QueryResult - 77, // 22: query.ResultWithError.error:type_name -> vtrpc.RPCError - 20, // 23: query.ResultWithError.result:type_name -> query.QueryResult - 76, // 24: query.StreamExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 25: query.StreamExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 26: query.StreamExecuteRequest.target:type_name -> query.Target - 16, // 27: query.StreamExecuteRequest.query:type_name -> query.BoundQuery - 17, // 28: query.StreamExecuteRequest.options:type_name -> query.ExecuteOptions - 20, // 29: query.StreamExecuteResponse.result:type_name -> query.QueryResult - 76, // 30: query.BeginRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 31: query.BeginRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 32: query.BeginRequest.target:type_name -> query.Target - 17, // 33: query.BeginRequest.options:type_name -> query.ExecuteOptions - 78, // 34: query.BeginResponse.tablet_alias:type_name -> topodata.TabletAlias - 76, // 35: query.CommitRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 36: query.CommitRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 37: query.CommitRequest.target:type_name -> query.Target - 76, // 38: query.RollbackRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 39: query.RollbackRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 40: query.RollbackRequest.target:type_name -> query.Target - 76, // 41: query.PrepareRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 42: query.PrepareRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 43: query.PrepareRequest.target:type_name -> query.Target - 76, // 44: query.CommitPreparedRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 45: query.CommitPreparedRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 46: query.CommitPreparedRequest.target:type_name -> query.Target - 76, // 47: query.RollbackPreparedRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 48: query.RollbackPreparedRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 49: query.RollbackPreparedRequest.target:type_name -> query.Target - 76, // 50: query.CreateTransactionRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 51: query.CreateTransactionRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 52: query.CreateTransactionRequest.target:type_name -> query.Target - 11, // 53: query.CreateTransactionRequest.participants:type_name -> query.Target - 76, // 54: query.StartCommitRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 55: query.StartCommitRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 56: query.StartCommitRequest.target:type_name -> query.Target - 76, // 57: query.SetRollbackRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 58: query.SetRollbackRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 59: query.SetRollbackRequest.target:type_name -> query.Target - 76, // 60: query.ConcludeTransactionRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 61: query.ConcludeTransactionRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 62: query.ConcludeTransactionRequest.target:type_name -> query.Target - 76, // 63: query.ReadTransactionRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 64: query.ReadTransactionRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 65: query.ReadTransactionRequest.target:type_name -> query.Target - 72, // 66: query.ReadTransactionResponse.metadata:type_name -> query.TransactionMetadata - 76, // 67: query.BeginExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 68: query.BeginExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 69: query.BeginExecuteRequest.target:type_name -> query.Target - 16, // 70: query.BeginExecuteRequest.query:type_name -> query.BoundQuery - 17, // 71: query.BeginExecuteRequest.options:type_name -> query.ExecuteOptions - 77, // 72: query.BeginExecuteResponse.error:type_name -> vtrpc.RPCError - 20, // 73: query.BeginExecuteResponse.result:type_name -> query.QueryResult - 78, // 74: query.BeginExecuteResponse.tablet_alias:type_name -> topodata.TabletAlias - 76, // 75: query.BeginStreamExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 76: query.BeginStreamExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 77: query.BeginStreamExecuteRequest.target:type_name -> query.Target - 16, // 78: query.BeginStreamExecuteRequest.query:type_name -> query.BoundQuery - 17, // 79: query.BeginStreamExecuteRequest.options:type_name -> query.ExecuteOptions - 77, // 80: query.BeginStreamExecuteResponse.error:type_name -> vtrpc.RPCError - 20, // 81: query.BeginStreamExecuteResponse.result:type_name -> query.QueryResult - 78, // 82: query.BeginStreamExecuteResponse.tablet_alias:type_name -> topodata.TabletAlias - 76, // 83: query.MessageStreamRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 84: query.MessageStreamRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 85: query.MessageStreamRequest.target:type_name -> query.Target - 20, // 86: query.MessageStreamResponse.result:type_name -> query.QueryResult - 76, // 87: query.MessageAckRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 88: query.MessageAckRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 89: query.MessageAckRequest.target:type_name -> query.Target - 14, // 90: query.MessageAckRequest.ids:type_name -> query.Value - 20, // 91: query.MessageAckResponse.result:type_name -> query.QueryResult - 76, // 92: query.ReserveExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 93: query.ReserveExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 94: query.ReserveExecuteRequest.target:type_name -> query.Target - 16, // 95: query.ReserveExecuteRequest.query:type_name -> query.BoundQuery - 17, // 96: query.ReserveExecuteRequest.options:type_name -> query.ExecuteOptions - 77, // 97: query.ReserveExecuteResponse.error:type_name -> vtrpc.RPCError - 20, // 98: query.ReserveExecuteResponse.result:type_name -> query.QueryResult - 78, // 99: query.ReserveExecuteResponse.tablet_alias:type_name -> topodata.TabletAlias - 76, // 100: query.ReserveStreamExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 101: query.ReserveStreamExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 102: query.ReserveStreamExecuteRequest.target:type_name -> query.Target - 16, // 103: query.ReserveStreamExecuteRequest.query:type_name -> query.BoundQuery - 17, // 104: query.ReserveStreamExecuteRequest.options:type_name -> query.ExecuteOptions - 77, // 105: query.ReserveStreamExecuteResponse.error:type_name -> vtrpc.RPCError - 20, // 106: query.ReserveStreamExecuteResponse.result:type_name -> query.QueryResult - 78, // 107: query.ReserveStreamExecuteResponse.tablet_alias:type_name -> topodata.TabletAlias - 76, // 108: query.ReserveBeginExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 109: query.ReserveBeginExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 110: query.ReserveBeginExecuteRequest.target:type_name -> query.Target - 16, // 111: query.ReserveBeginExecuteRequest.query:type_name -> query.BoundQuery - 17, // 112: query.ReserveBeginExecuteRequest.options:type_name -> query.ExecuteOptions - 77, // 113: query.ReserveBeginExecuteResponse.error:type_name -> vtrpc.RPCError - 20, // 114: query.ReserveBeginExecuteResponse.result:type_name -> query.QueryResult - 78, // 115: query.ReserveBeginExecuteResponse.tablet_alias:type_name -> topodata.TabletAlias - 76, // 116: query.ReserveBeginStreamExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 117: query.ReserveBeginStreamExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 118: query.ReserveBeginStreamExecuteRequest.target:type_name -> query.Target - 16, // 119: query.ReserveBeginStreamExecuteRequest.query:type_name -> query.BoundQuery - 17, // 120: query.ReserveBeginStreamExecuteRequest.options:type_name -> query.ExecuteOptions - 77, // 121: query.ReserveBeginStreamExecuteResponse.error:type_name -> vtrpc.RPCError - 20, // 122: query.ReserveBeginStreamExecuteResponse.result:type_name -> query.QueryResult - 78, // 123: query.ReserveBeginStreamExecuteResponse.tablet_alias:type_name -> topodata.TabletAlias - 76, // 124: query.ReleaseRequest.effective_caller_id:type_name -> vtrpc.CallerID - 12, // 125: query.ReleaseRequest.immediate_caller_id:type_name -> query.VTGateCallerID - 11, // 126: query.ReleaseRequest.target:type_name -> query.Target - 11, // 127: query.StreamHealthResponse.target:type_name -> query.Target - 69, // 128: query.StreamHealthResponse.realtime_stats:type_name -> query.RealtimeStats - 78, // 129: query.StreamHealthResponse.tablet_alias:type_name -> topodata.TabletAlias + 19, // 12: query.QueryResult.fields:type_name -> query.Field + 20, // 13: query.QueryResult.rows:type_name -> query.Row + 77, // 14: query.StreamEvent.statements:type_name -> query.StreamEvent.Statement + 14, // 15: query.StreamEvent.event_token:type_name -> query.EventToken + 80, // 16: query.ExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 17: query.ExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 18: query.ExecuteRequest.target:type_name -> query.Target + 17, // 19: query.ExecuteRequest.query:type_name -> query.BoundQuery + 18, // 20: query.ExecuteRequest.options:type_name -> query.ExecuteOptions + 21, // 21: query.ExecuteResponse.result:type_name -> query.QueryResult + 81, // 22: query.ResultWithError.error:type_name -> vtrpc.RPCError + 21, // 23: query.ResultWithError.result:type_name -> query.QueryResult + 80, // 24: query.StreamExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 25: query.StreamExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 26: query.StreamExecuteRequest.target:type_name -> query.Target + 17, // 27: query.StreamExecuteRequest.query:type_name -> query.BoundQuery + 18, // 28: query.StreamExecuteRequest.options:type_name -> query.ExecuteOptions + 21, // 29: query.StreamExecuteResponse.result:type_name -> query.QueryResult + 80, // 30: query.BeginRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 31: query.BeginRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 32: query.BeginRequest.target:type_name -> query.Target + 18, // 33: query.BeginRequest.options:type_name -> query.ExecuteOptions + 82, // 34: query.BeginResponse.tablet_alias:type_name -> topodata.TabletAlias + 80, // 35: query.CommitRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 36: query.CommitRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 37: query.CommitRequest.target:type_name -> query.Target + 80, // 38: query.RollbackRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 39: query.RollbackRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 40: query.RollbackRequest.target:type_name -> query.Target + 80, // 41: query.PrepareRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 42: query.PrepareRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 43: query.PrepareRequest.target:type_name -> query.Target + 80, // 44: query.CommitPreparedRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 45: query.CommitPreparedRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 46: query.CommitPreparedRequest.target:type_name -> query.Target + 80, // 47: query.RollbackPreparedRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 48: query.RollbackPreparedRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 49: query.RollbackPreparedRequest.target:type_name -> query.Target + 80, // 50: query.CreateTransactionRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 51: query.CreateTransactionRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 52: query.CreateTransactionRequest.target:type_name -> query.Target + 12, // 53: query.CreateTransactionRequest.participants:type_name -> query.Target + 80, // 54: query.StartCommitRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 55: query.StartCommitRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 56: query.StartCommitRequest.target:type_name -> query.Target + 80, // 57: query.SetRollbackRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 58: query.SetRollbackRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 59: query.SetRollbackRequest.target:type_name -> query.Target + 80, // 60: query.ConcludeTransactionRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 61: query.ConcludeTransactionRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 62: query.ConcludeTransactionRequest.target:type_name -> query.Target + 80, // 63: query.ReadTransactionRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 64: query.ReadTransactionRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 65: query.ReadTransactionRequest.target:type_name -> query.Target + 73, // 66: query.ReadTransactionResponse.metadata:type_name -> query.TransactionMetadata + 80, // 67: query.BeginExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 68: query.BeginExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 69: query.BeginExecuteRequest.target:type_name -> query.Target + 17, // 70: query.BeginExecuteRequest.query:type_name -> query.BoundQuery + 18, // 71: query.BeginExecuteRequest.options:type_name -> query.ExecuteOptions + 81, // 72: query.BeginExecuteResponse.error:type_name -> vtrpc.RPCError + 21, // 73: query.BeginExecuteResponse.result:type_name -> query.QueryResult + 82, // 74: query.BeginExecuteResponse.tablet_alias:type_name -> topodata.TabletAlias + 80, // 75: query.BeginStreamExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 76: query.BeginStreamExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 77: query.BeginStreamExecuteRequest.target:type_name -> query.Target + 17, // 78: query.BeginStreamExecuteRequest.query:type_name -> query.BoundQuery + 18, // 79: query.BeginStreamExecuteRequest.options:type_name -> query.ExecuteOptions + 81, // 80: query.BeginStreamExecuteResponse.error:type_name -> vtrpc.RPCError + 21, // 81: query.BeginStreamExecuteResponse.result:type_name -> query.QueryResult + 82, // 82: query.BeginStreamExecuteResponse.tablet_alias:type_name -> topodata.TabletAlias + 80, // 83: query.MessageStreamRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 84: query.MessageStreamRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 85: query.MessageStreamRequest.target:type_name -> query.Target + 21, // 86: query.MessageStreamResponse.result:type_name -> query.QueryResult + 80, // 87: query.MessageAckRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 88: query.MessageAckRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 89: query.MessageAckRequest.target:type_name -> query.Target + 15, // 90: query.MessageAckRequest.ids:type_name -> query.Value + 21, // 91: query.MessageAckResponse.result:type_name -> query.QueryResult + 80, // 92: query.ReserveExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 93: query.ReserveExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 94: query.ReserveExecuteRequest.target:type_name -> query.Target + 17, // 95: query.ReserveExecuteRequest.query:type_name -> query.BoundQuery + 18, // 96: query.ReserveExecuteRequest.options:type_name -> query.ExecuteOptions + 81, // 97: query.ReserveExecuteResponse.error:type_name -> vtrpc.RPCError + 21, // 98: query.ReserveExecuteResponse.result:type_name -> query.QueryResult + 82, // 99: query.ReserveExecuteResponse.tablet_alias:type_name -> topodata.TabletAlias + 80, // 100: query.ReserveStreamExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 101: query.ReserveStreamExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 102: query.ReserveStreamExecuteRequest.target:type_name -> query.Target + 17, // 103: query.ReserveStreamExecuteRequest.query:type_name -> query.BoundQuery + 18, // 104: query.ReserveStreamExecuteRequest.options:type_name -> query.ExecuteOptions + 81, // 105: query.ReserveStreamExecuteResponse.error:type_name -> vtrpc.RPCError + 21, // 106: query.ReserveStreamExecuteResponse.result:type_name -> query.QueryResult + 82, // 107: query.ReserveStreamExecuteResponse.tablet_alias:type_name -> topodata.TabletAlias + 80, // 108: query.ReserveBeginExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 109: query.ReserveBeginExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 110: query.ReserveBeginExecuteRequest.target:type_name -> query.Target + 17, // 111: query.ReserveBeginExecuteRequest.query:type_name -> query.BoundQuery + 18, // 112: query.ReserveBeginExecuteRequest.options:type_name -> query.ExecuteOptions + 81, // 113: query.ReserveBeginExecuteResponse.error:type_name -> vtrpc.RPCError + 21, // 114: query.ReserveBeginExecuteResponse.result:type_name -> query.QueryResult + 82, // 115: query.ReserveBeginExecuteResponse.tablet_alias:type_name -> topodata.TabletAlias + 80, // 116: query.ReserveBeginStreamExecuteRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 117: query.ReserveBeginStreamExecuteRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 118: query.ReserveBeginStreamExecuteRequest.target:type_name -> query.Target + 17, // 119: query.ReserveBeginStreamExecuteRequest.query:type_name -> query.BoundQuery + 18, // 120: query.ReserveBeginStreamExecuteRequest.options:type_name -> query.ExecuteOptions + 81, // 121: query.ReserveBeginStreamExecuteResponse.error:type_name -> vtrpc.RPCError + 21, // 122: query.ReserveBeginStreamExecuteResponse.result:type_name -> query.QueryResult + 82, // 123: query.ReserveBeginStreamExecuteResponse.tablet_alias:type_name -> topodata.TabletAlias + 80, // 124: query.ReleaseRequest.effective_caller_id:type_name -> vtrpc.CallerID + 13, // 125: query.ReleaseRequest.immediate_caller_id:type_name -> query.VTGateCallerID + 12, // 126: query.ReleaseRequest.target:type_name -> query.Target + 12, // 127: query.StreamHealthResponse.target:type_name -> query.Target + 70, // 128: query.StreamHealthResponse.realtime_stats:type_name -> query.RealtimeStats + 82, // 129: query.StreamHealthResponse.tablet_alias:type_name -> topodata.TabletAlias 3, // 130: query.TransactionMetadata.state:type_name -> query.TransactionState - 11, // 131: query.TransactionMetadata.participants:type_name -> query.Target - 15, // 132: query.BoundQuery.BindVariablesEntry.value:type_name -> query.BindVariable - 10, // 133: query.StreamEvent.Statement.category:type_name -> query.StreamEvent.Statement.Category - 18, // 134: query.StreamEvent.Statement.primary_key_fields:type_name -> query.Field - 19, // 135: query.StreamEvent.Statement.primary_key_values:type_name -> query.Row - 136, // [136:136] is the sub-list for method output_type - 136, // [136:136] is the sub-list for method input_type - 136, // [136:136] is the sub-list for extension type_name - 136, // [136:136] is the sub-list for extension extendee - 0, // [0:136] is the sub-list for field type_name + 12, // 131: query.TransactionMetadata.participants:type_name -> query.Target + 12, // 132: query.GetSchemaRequest.target:type_name -> query.Target + 4, // 133: query.GetSchemaRequest.table_type:type_name -> query.SchemaTableType + 78, // 134: query.GetSchemaResponse.table_definition:type_name -> query.GetSchemaResponse.TableDefinitionEntry + 16, // 135: query.BoundQuery.BindVariablesEntry.value:type_name -> query.BindVariable + 11, // 136: query.StreamEvent.Statement.category:type_name -> query.StreamEvent.Statement.Category + 19, // 137: query.StreamEvent.Statement.primary_key_fields:type_name -> query.Field + 20, // 138: query.StreamEvent.Statement.primary_key_values:type_name -> query.Row + 139, // [139:139] is the sub-list for method output_type + 139, // [139:139] is the sub-list for method input_type + 139, // [139:139] is the sub-list for extension type_name + 139, // [139:139] is the sub-list for extension extendee + 0, // [0:139] is the sub-list for field type_name } func init() { file_query_proto_init() } @@ -7328,7 +7522,31 @@ func file_query_proto_init() { return nil } } + file_query_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetSchemaRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } file_query_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetSchemaResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_query_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StreamEvent_Statement); i { case 0: return &v.state @@ -7346,8 +7564,8 @@ func file_query_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_query_proto_rawDesc, - NumEnums: 11, - NumMessages: 64, + NumEnums: 12, + NumMessages: 67, NumExtensions: 0, NumServices: 0, }, diff --git a/go/vt/proto/query/query_vtproto.pb.go b/go/vt/proto/query/query_vtproto.pb.go index 2a744ad184e..3abec4b7d1a 100644 --- a/go/vt/proto/query/query_vtproto.pb.go +++ b/go/vt/proto/query/query_vtproto.pb.go @@ -4101,6 +4101,115 @@ func (m *TransactionMetadata) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *GetSchemaRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetSchemaRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetSchemaRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.TableNames) > 0 { + for iNdEx := len(m.TableNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.TableNames[iNdEx]) + copy(dAtA[i:], m.TableNames[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.TableNames[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if m.TableType != 0 { + i = encodeVarint(dAtA, i, uint64(m.TableType)) + i-- + dAtA[i] = 0x10 + } + if m.Target != nil { + size, err := m.Target.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetSchemaResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetSchemaResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetSchemaResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.TableDefinition) > 0 { + for k := range m.TableDefinition { + v := m.TableDefinition[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + return len(dAtA) - i, nil +} + func encodeVarint(dAtA []byte, offset int, v uint64) int { offset -= sov(v) base := offset @@ -5702,6 +5811,47 @@ func (m *TransactionMetadata) SizeVT() (n int) { return n } +func (m *GetSchemaRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Target != nil { + l = m.Target.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.TableType != 0 { + n += 1 + sov(uint64(m.TableType)) + } + if len(m.TableNames) > 0 { + for _, s := range m.TableNames { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *GetSchemaResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.TableDefinition) > 0 { + for k, v := range m.TableDefinition { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +} + func sov(x uint64) (n int) { return (bits.Len64(x|1) + 6) / 7 } @@ -16313,6 +16463,322 @@ func (m *TransactionMetadata) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *GetSchemaRequest) UnmarshalVT(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 ErrIntOverflow + } + 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: GetSchemaRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetSchemaRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Target == nil { + m.Target = &Target{} + } + if err := m.Target.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TableType", wireType) + } + m.TableType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TableType |= SchemaTableType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TableNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + 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 ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TableNames = append(m.TableNames, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetSchemaResponse) UnmarshalVT(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 ErrIntOverflow + } + 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: GetSchemaResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetSchemaResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TableDefinition", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TableDefinition == nil { + m.TableDefinition = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.TableDefinition[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skip(dAtA []byte) (n int, err error) { l := len(dAtA) diff --git a/go/vt/proto/queryservice/queryservice.pb.go b/go/vt/proto/queryservice/queryservice.pb.go index d13ad60b7c2..211030f1cee 100644 --- a/go/vt/proto/queryservice/queryservice.pb.go +++ b/go/vt/proto/queryservice/queryservice.pb.go @@ -45,7 +45,7 @@ var file_queryservice_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x32, 0x8e, 0x10, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x07, 0x45, + 0x6f, 0x32, 0xd0, 0x10, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x07, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, @@ -174,10 +174,14 @@ var file_queryservice_proto_rawDesc = []byte{ 0x6c, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x56, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x30, 0x01, 0x42, 0x2b, 0x5a, 0x29, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6f, 0x2f, - 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x30, 0x01, 0x12, 0x40, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, + 0x17, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x42, 0x2b, 0x5a, 0x29, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, 0x69, + 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_queryservice_proto_goTypes = []interface{}{ @@ -207,32 +211,34 @@ var file_queryservice_proto_goTypes = []interface{}{ (*binlogdata.VStreamRequest)(nil), // 23: binlogdata.VStreamRequest (*binlogdata.VStreamRowsRequest)(nil), // 24: binlogdata.VStreamRowsRequest (*binlogdata.VStreamResultsRequest)(nil), // 25: binlogdata.VStreamResultsRequest - (*query.ExecuteResponse)(nil), // 26: query.ExecuteResponse - (*query.StreamExecuteResponse)(nil), // 27: query.StreamExecuteResponse - (*query.BeginResponse)(nil), // 28: query.BeginResponse - (*query.CommitResponse)(nil), // 29: query.CommitResponse - (*query.RollbackResponse)(nil), // 30: query.RollbackResponse - (*query.PrepareResponse)(nil), // 31: query.PrepareResponse - (*query.CommitPreparedResponse)(nil), // 32: query.CommitPreparedResponse - (*query.RollbackPreparedResponse)(nil), // 33: query.RollbackPreparedResponse - (*query.CreateTransactionResponse)(nil), // 34: query.CreateTransactionResponse - (*query.StartCommitResponse)(nil), // 35: query.StartCommitResponse - (*query.SetRollbackResponse)(nil), // 36: query.SetRollbackResponse - (*query.ConcludeTransactionResponse)(nil), // 37: query.ConcludeTransactionResponse - (*query.ReadTransactionResponse)(nil), // 38: query.ReadTransactionResponse - (*query.BeginExecuteResponse)(nil), // 39: query.BeginExecuteResponse - (*query.BeginStreamExecuteResponse)(nil), // 40: query.BeginStreamExecuteResponse - (*query.MessageStreamResponse)(nil), // 41: query.MessageStreamResponse - (*query.MessageAckResponse)(nil), // 42: query.MessageAckResponse - (*query.ReserveExecuteResponse)(nil), // 43: query.ReserveExecuteResponse - (*query.ReserveBeginExecuteResponse)(nil), // 44: query.ReserveBeginExecuteResponse - (*query.ReserveStreamExecuteResponse)(nil), // 45: query.ReserveStreamExecuteResponse - (*query.ReserveBeginStreamExecuteResponse)(nil), // 46: query.ReserveBeginStreamExecuteResponse - (*query.ReleaseResponse)(nil), // 47: query.ReleaseResponse - (*query.StreamHealthResponse)(nil), // 48: query.StreamHealthResponse - (*binlogdata.VStreamResponse)(nil), // 49: binlogdata.VStreamResponse - (*binlogdata.VStreamRowsResponse)(nil), // 50: binlogdata.VStreamRowsResponse - (*binlogdata.VStreamResultsResponse)(nil), // 51: binlogdata.VStreamResultsResponse + (*query.GetSchemaRequest)(nil), // 26: query.GetSchemaRequest + (*query.ExecuteResponse)(nil), // 27: query.ExecuteResponse + (*query.StreamExecuteResponse)(nil), // 28: query.StreamExecuteResponse + (*query.BeginResponse)(nil), // 29: query.BeginResponse + (*query.CommitResponse)(nil), // 30: query.CommitResponse + (*query.RollbackResponse)(nil), // 31: query.RollbackResponse + (*query.PrepareResponse)(nil), // 32: query.PrepareResponse + (*query.CommitPreparedResponse)(nil), // 33: query.CommitPreparedResponse + (*query.RollbackPreparedResponse)(nil), // 34: query.RollbackPreparedResponse + (*query.CreateTransactionResponse)(nil), // 35: query.CreateTransactionResponse + (*query.StartCommitResponse)(nil), // 36: query.StartCommitResponse + (*query.SetRollbackResponse)(nil), // 37: query.SetRollbackResponse + (*query.ConcludeTransactionResponse)(nil), // 38: query.ConcludeTransactionResponse + (*query.ReadTransactionResponse)(nil), // 39: query.ReadTransactionResponse + (*query.BeginExecuteResponse)(nil), // 40: query.BeginExecuteResponse + (*query.BeginStreamExecuteResponse)(nil), // 41: query.BeginStreamExecuteResponse + (*query.MessageStreamResponse)(nil), // 42: query.MessageStreamResponse + (*query.MessageAckResponse)(nil), // 43: query.MessageAckResponse + (*query.ReserveExecuteResponse)(nil), // 44: query.ReserveExecuteResponse + (*query.ReserveBeginExecuteResponse)(nil), // 45: query.ReserveBeginExecuteResponse + (*query.ReserveStreamExecuteResponse)(nil), // 46: query.ReserveStreamExecuteResponse + (*query.ReserveBeginStreamExecuteResponse)(nil), // 47: query.ReserveBeginStreamExecuteResponse + (*query.ReleaseResponse)(nil), // 48: query.ReleaseResponse + (*query.StreamHealthResponse)(nil), // 49: query.StreamHealthResponse + (*binlogdata.VStreamResponse)(nil), // 50: binlogdata.VStreamResponse + (*binlogdata.VStreamRowsResponse)(nil), // 51: binlogdata.VStreamRowsResponse + (*binlogdata.VStreamResultsResponse)(nil), // 52: binlogdata.VStreamResultsResponse + (*query.GetSchemaResponse)(nil), // 53: query.GetSchemaResponse } var file_queryservice_proto_depIdxs = []int32{ 0, // 0: queryservice.Query.Execute:input_type -> query.ExecuteRequest @@ -261,34 +267,36 @@ var file_queryservice_proto_depIdxs = []int32{ 23, // 23: queryservice.Query.VStream:input_type -> binlogdata.VStreamRequest 24, // 24: queryservice.Query.VStreamRows:input_type -> binlogdata.VStreamRowsRequest 25, // 25: queryservice.Query.VStreamResults:input_type -> binlogdata.VStreamResultsRequest - 26, // 26: queryservice.Query.Execute:output_type -> query.ExecuteResponse - 27, // 27: queryservice.Query.StreamExecute:output_type -> query.StreamExecuteResponse - 28, // 28: queryservice.Query.Begin:output_type -> query.BeginResponse - 29, // 29: queryservice.Query.Commit:output_type -> query.CommitResponse - 30, // 30: queryservice.Query.Rollback:output_type -> query.RollbackResponse - 31, // 31: queryservice.Query.Prepare:output_type -> query.PrepareResponse - 32, // 32: queryservice.Query.CommitPrepared:output_type -> query.CommitPreparedResponse - 33, // 33: queryservice.Query.RollbackPrepared:output_type -> query.RollbackPreparedResponse - 34, // 34: queryservice.Query.CreateTransaction:output_type -> query.CreateTransactionResponse - 35, // 35: queryservice.Query.StartCommit:output_type -> query.StartCommitResponse - 36, // 36: queryservice.Query.SetRollback:output_type -> query.SetRollbackResponse - 37, // 37: queryservice.Query.ConcludeTransaction:output_type -> query.ConcludeTransactionResponse - 38, // 38: queryservice.Query.ReadTransaction:output_type -> query.ReadTransactionResponse - 39, // 39: queryservice.Query.BeginExecute:output_type -> query.BeginExecuteResponse - 40, // 40: queryservice.Query.BeginStreamExecute:output_type -> query.BeginStreamExecuteResponse - 41, // 41: queryservice.Query.MessageStream:output_type -> query.MessageStreamResponse - 42, // 42: queryservice.Query.MessageAck:output_type -> query.MessageAckResponse - 43, // 43: queryservice.Query.ReserveExecute:output_type -> query.ReserveExecuteResponse - 44, // 44: queryservice.Query.ReserveBeginExecute:output_type -> query.ReserveBeginExecuteResponse - 45, // 45: queryservice.Query.ReserveStreamExecute:output_type -> query.ReserveStreamExecuteResponse - 46, // 46: queryservice.Query.ReserveBeginStreamExecute:output_type -> query.ReserveBeginStreamExecuteResponse - 47, // 47: queryservice.Query.Release:output_type -> query.ReleaseResponse - 48, // 48: queryservice.Query.StreamHealth:output_type -> query.StreamHealthResponse - 49, // 49: queryservice.Query.VStream:output_type -> binlogdata.VStreamResponse - 50, // 50: queryservice.Query.VStreamRows:output_type -> binlogdata.VStreamRowsResponse - 51, // 51: queryservice.Query.VStreamResults:output_type -> binlogdata.VStreamResultsResponse - 26, // [26:52] is the sub-list for method output_type - 0, // [0:26] is the sub-list for method input_type + 26, // 26: queryservice.Query.GetSchema:input_type -> query.GetSchemaRequest + 27, // 27: queryservice.Query.Execute:output_type -> query.ExecuteResponse + 28, // 28: queryservice.Query.StreamExecute:output_type -> query.StreamExecuteResponse + 29, // 29: queryservice.Query.Begin:output_type -> query.BeginResponse + 30, // 30: queryservice.Query.Commit:output_type -> query.CommitResponse + 31, // 31: queryservice.Query.Rollback:output_type -> query.RollbackResponse + 32, // 32: queryservice.Query.Prepare:output_type -> query.PrepareResponse + 33, // 33: queryservice.Query.CommitPrepared:output_type -> query.CommitPreparedResponse + 34, // 34: queryservice.Query.RollbackPrepared:output_type -> query.RollbackPreparedResponse + 35, // 35: queryservice.Query.CreateTransaction:output_type -> query.CreateTransactionResponse + 36, // 36: queryservice.Query.StartCommit:output_type -> query.StartCommitResponse + 37, // 37: queryservice.Query.SetRollback:output_type -> query.SetRollbackResponse + 38, // 38: queryservice.Query.ConcludeTransaction:output_type -> query.ConcludeTransactionResponse + 39, // 39: queryservice.Query.ReadTransaction:output_type -> query.ReadTransactionResponse + 40, // 40: queryservice.Query.BeginExecute:output_type -> query.BeginExecuteResponse + 41, // 41: queryservice.Query.BeginStreamExecute:output_type -> query.BeginStreamExecuteResponse + 42, // 42: queryservice.Query.MessageStream:output_type -> query.MessageStreamResponse + 43, // 43: queryservice.Query.MessageAck:output_type -> query.MessageAckResponse + 44, // 44: queryservice.Query.ReserveExecute:output_type -> query.ReserveExecuteResponse + 45, // 45: queryservice.Query.ReserveBeginExecute:output_type -> query.ReserveBeginExecuteResponse + 46, // 46: queryservice.Query.ReserveStreamExecute:output_type -> query.ReserveStreamExecuteResponse + 47, // 47: queryservice.Query.ReserveBeginStreamExecute:output_type -> query.ReserveBeginStreamExecuteResponse + 48, // 48: queryservice.Query.Release:output_type -> query.ReleaseResponse + 49, // 49: queryservice.Query.StreamHealth:output_type -> query.StreamHealthResponse + 50, // 50: queryservice.Query.VStream:output_type -> binlogdata.VStreamResponse + 51, // 51: queryservice.Query.VStreamRows:output_type -> binlogdata.VStreamRowsResponse + 52, // 52: queryservice.Query.VStreamResults:output_type -> binlogdata.VStreamResultsResponse + 53, // 53: queryservice.Query.GetSchema:output_type -> query.GetSchemaResponse + 27, // [27:54] is the sub-list for method output_type + 0, // [0:27] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name diff --git a/go/vt/proto/queryservice/queryservice_grpc.pb.go b/go/vt/proto/queryservice/queryservice_grpc.pb.go index 37fcc3ee240..e40c8110f06 100644 --- a/go/vt/proto/queryservice/queryservice_grpc.pb.go +++ b/go/vt/proto/queryservice/queryservice_grpc.pb.go @@ -81,6 +81,8 @@ type QueryClient interface { VStreamRows(ctx context.Context, in *binlogdata.VStreamRowsRequest, opts ...grpc.CallOption) (Query_VStreamRowsClient, error) // VStreamResults streams results along with the gtid of the snapshot. VStreamResults(ctx context.Context, in *binlogdata.VStreamResultsRequest, opts ...grpc.CallOption) (Query_VStreamResultsClient, error) + // GetSchema returns the schema information. + GetSchema(ctx context.Context, in *query.GetSchemaRequest, opts ...grpc.CallOption) (*query.GetSchemaResponse, error) } type queryClient struct { @@ -532,6 +534,15 @@ func (x *queryVStreamResultsClient) Recv() (*binlogdata.VStreamResultsResponse, return m, nil } +func (c *queryClient) GetSchema(ctx context.Context, in *query.GetSchemaRequest, opts ...grpc.CallOption) (*query.GetSchemaResponse, error) { + out := new(query.GetSchemaResponse) + err := c.cc.Invoke(ctx, "/queryservice.Query/GetSchema", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility @@ -593,6 +604,8 @@ type QueryServer interface { VStreamRows(*binlogdata.VStreamRowsRequest, Query_VStreamRowsServer) error // VStreamResults streams results along with the gtid of the snapshot. VStreamResults(*binlogdata.VStreamResultsRequest, Query_VStreamResultsServer) error + // GetSchema returns the schema information. + GetSchema(context.Context, *query.GetSchemaRequest) (*query.GetSchemaResponse, error) mustEmbedUnimplementedQueryServer() } @@ -678,6 +691,9 @@ func (UnimplementedQueryServer) VStreamRows(*binlogdata.VStreamRowsRequest, Quer func (UnimplementedQueryServer) VStreamResults(*binlogdata.VStreamResultsRequest, Query_VStreamResultsServer) error { return status.Errorf(codes.Unimplemented, "method VStreamResults not implemented") } +func (UnimplementedQueryServer) GetSchema(context.Context, *query.GetSchemaRequest) (*query.GetSchemaResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSchema not implemented") +} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. @@ -1186,6 +1202,24 @@ func (x *queryVStreamResultsServer) Send(m *binlogdata.VStreamResultsResponse) e return x.ServerStream.SendMsg(m) } +func _Query_GetSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(query.GetSchemaRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetSchema(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/queryservice.Query/GetSchema", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetSchema(ctx, req.(*query.GetSchemaRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -1261,6 +1295,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Release", Handler: _Query_Release_Handler, }, + { + MethodName: "GetSchema", + Handler: _Query_GetSchema_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/go/vt/vtcombo/tablet_map.go b/go/vt/vtcombo/tablet_map.go index 767217b442b..b68dd4ccc49 100644 --- a/go/vt/vtcombo/tablet_map.go +++ b/go/vt/vtcombo/tablet_map.go @@ -661,6 +661,12 @@ func (itc *internalTabletConn) Release(ctx context.Context, target *querypb.Targ return tabletconn.ErrorFromGRPC(vterrors.ToGRPC(err)) } +// GetSchema is part of the QueryService interface. +func (itc *internalTabletConn) GetSchema(ctx context.Context, target *querypb.Target, tableType querypb.SchemaTableType, tableNames []string) (map[string]string, error) { + response, err := itc.tablet.qsc.QueryService().GetSchema(ctx, target, tableType, tableNames) + return response, tabletconn.ErrorFromGRPC(vterrors.ToGRPC(err)) +} + // Close is part of queryservice.QueryService func (itc *internalTabletConn) Close(ctx context.Context) error { return nil diff --git a/go/vt/vtgate/schema/tracker.go b/go/vt/vtgate/schema/tracker.go index d10f2e7d3c0..df7a107ed80 100644 --- a/go/vt/vtgate/schema/tracker.go +++ b/go/vt/vtgate/schema/tracker.go @@ -134,7 +134,7 @@ func (t *Tracker) loadViews(conn queryservice.QueryService, target *querypb.Targ return nil } - fvRes, err := conn.Execute(t.ctx, target, mysql.FetchViews, nil, 0, 0, nil) + fvRes, err := conn.GetSchema(t.ctx, target, querypb.SchemaTableType_VIEWS, nil) if err != nil { return err } @@ -146,7 +146,7 @@ func (t *Tracker) loadViews(conn queryservice.QueryService, target *querypb.Targ // clearing out the previous view definition removes any dropped views. t.clearKeyspaceViews(target.Keyspace) t.updateViews(target.Keyspace, fvRes) - log.Infof("finished loading views for keyspace %s. Found %d views", target.Keyspace, len(fvRes.Rows)) + log.Infof("finished loading views for keyspace %s. Found %d views", target.Keyspace, len(fvRes)) return nil } @@ -300,21 +300,11 @@ func (t *Tracker) updateTables(keyspace string, res *sqltypes.Result) { func (t *Tracker) updatedViewSchema(th *discovery.TabletHealth) bool { viewsUpdated := th.Stats.ViewSchemaChanged - views, err := sqltypes.BuildBindVariable(viewsUpdated) - if err != nil { - log.Errorf("failed to read updated views from TabletHealth: %v", err) - return false - } - bv := map[string]*querypb.BindVariable{"viewNames": views} - res, err := th.Conn.Execute(t.ctx, th.Target, mysql.FetchUpdatedViews, bv, 0, 0, nil) + res, err := th.Conn.GetSchema(t.ctx, th.Target, querypb.SchemaTableType_VIEWS, viewsUpdated) if err != nil { t.tracked[th.Target.Keyspace].setLoaded(false) // TODO: optimize for the views that got errored out. log.Warningf("error fetching new views definition for %v", viewsUpdated, err) - code := vterrors.Code(err) - if code == vtrpcpb.Code_UNAUTHENTICATED || code == vtrpcpb.Code_PERMISSION_DENIED { - log.Warning(aclErrorMessageLog) - } return false } @@ -331,10 +321,8 @@ func (t *Tracker) updatedViewSchema(th *discovery.TabletHealth) bool { } -func (t *Tracker) updateViews(keyspace string, res *sqltypes.Result) { - for _, row := range res.Rows { - viewName := row[0].ToString() - viewDef := row[1].ToString() +func (t *Tracker) updateViews(keyspace string, res map[string]string) { + for viewName, viewDef := range res { t.views.set(keyspace, viewName, viewDef) } } diff --git a/go/vt/vtgate/schema/tracker_test.go b/go/vt/vtgate/schema/tracker_test.go index 85df7089f06..11cbaffab5b 100644 --- a/go/vt/vtgate/schema/tracker_test.go +++ b/go/vt/vtgate/schema/tracker_test.go @@ -309,102 +309,78 @@ func TestTrackerGetKeyspaceUpdateController(t *testing.T) { assert.Nil(t, ks3.reloadKeyspace, "ks3 already initialized") } -type delta struct { - result *sqltypes.Result - updView []string -} - // TestViewsTracking tests that the tracker is able to track views. func TestViewsTracking(t *testing.T) { target := &querypb.Target{Cell: "aa", Keyspace: "ks", Shard: "-80", TabletType: topodatapb.TabletType_PRIMARY} tablet := &topodatapb.Tablet{Keyspace: target.Keyspace, Shard: target.Shard, Type: target.TabletType} - fields := sqltypes.MakeTestFields("table_name|view_definition|create_statement", "varchar|text|text") - - var ( - d0 = delta{ - result: sqltypes.MakeTestResult(fields, - "prior|select 1 from tbl|create view prior as select 1 from tbl"), - updView: []string{"prior"}, - } - d1 = delta{ - result: sqltypes.MakeTestResult(fields, - "t1|select 1 from tbl1|create view t1 as select 1 from tbl1", - "t2|select 1 from tbl2|create view t2 as select 1 from tbl2"), - updView: []string{"t1", "t2"}, - } - - d2 = delta{ - result: sqltypes.MakeTestResult(fields, - "t1|select 1 from tbl1|create view t1 as select 1 from tbl1", - "t2|select 1,2 from tbl2|create view t2 as select 1,2 from tbl2", - "t3|select 1 from tbl3|create view t3 as select 1 from tbl3"), - updView: []string{"prior", "t1", "t2", "t3"}, - } - - d3 = delta{ - result: sqltypes.MakeTestResult(fields, - "t4|select 1 from tbl4|create view t4 as select 1 from tbl4"), - updView: []string{"t4"}, - } - ) + schemaDefResult := []map[string]string{{ + "prior": "select 1 from tbl", // create view prior as select 1 from tbl" + "t1": "select 1 from tbl1", // create view t1 as select 1 from tbl1", + "t2": "select 1 from tbl2", // create view t2 as select 1 from tbl2", + }, { + "t2": "select 1,2 from tbl2", // create view t2 as select 1,2 from tbl2", + "t3": "select 1 from tbl3", // create view t3 as select 1 from tbl3", + }, { + "t4": "select 1 from tbl4", // create view t4 as select 1 from tbl4" + }} testcases := []struct { - vName string - deltas []delta - exp map[string]string + testName string + updView []string + exp map[string]string }{{ - vName: "new views", - deltas: []delta{d0, d1}, + testName: "new views", + updView: []string{"prior", "t1", "t2"}, exp: map[string]string{ "t1": "select 1 from tbl1", "t2": "select 1 from tbl2", "prior": "select 1 from tbl"}, }, { - vName: "delete t1 and prior, updated t2 and new t3", - deltas: []delta{d0, d1, d2}, + testName: "delete prior, updated t2 and new t3", + updView: []string{"prior", "t2", "t3"}, exp: map[string]string{ + "t1": "select 1 from tbl1", "t2": "select 1, 2 from tbl2", "t3": "select 1 from tbl3"}, }, { - vName: "new t4", - deltas: []delta{d0, d1, d2, d3}, + testName: "new t4", + updView: []string{"t4"}, exp: map[string]string{ + "t1": "select 1 from tbl1", "t2": "select 1, 2 from tbl2", "t3": "select 1 from tbl3", "t4": "select 1 from tbl4"}, }} - for i, tcase := range testcases { - t.Run(fmt.Sprintf("%d - %s", i, tcase.vName), func(t *testing.T) { - sbc := sandboxconn.NewSandboxConn(tablet) - ch := make(chan *discovery.TabletHealth) - tracker := NewTracker(ch, "", true) - tracker.tables = nil // making tables map nil - so load keyspace does not try to load the tables information. - tracker.consumeDelay = 1 * time.Millisecond - tracker.Start() - defer tracker.Stop() - sbc.SetResults(getResultSet(tcase.deltas)) - sbc.Queries = nil + ch := make(chan *discovery.TabletHealth) + tracker := NewTracker(ch, "", true) + tracker.tables = nil // making tables map nil - so load keyspace does not try to load the tables information. + tracker.consumeDelay = 1 * time.Millisecond + tracker.Start() + defer tracker.Stop() - wg := sync.WaitGroup{} - wg.Add(1) - tracker.RegisterSignalReceiver(func() { - wg.Done() - }) + wg := sync.WaitGroup{} + tracker.RegisterSignalReceiver(func() { + wg.Done() + }) - for _, d := range tcase.deltas { - ch <- &discovery.TabletHealth{ - Conn: sbc, - Tablet: tablet, - Target: target, - Serving: true, - Stats: &querypb.RealtimeStats{ViewSchemaChanged: d.updView}, - } + sbc := sandboxconn.NewSandboxConn(tablet) + sbc.SetSchemaResult(schemaDefResult) + + for count, tcase := range testcases { + t.Run(tcase.testName, func(t *testing.T) { + wg.Add(1) + ch <- &discovery.TabletHealth{ + Conn: sbc, + Tablet: tablet, + Target: target, + Serving: true, + Stats: &querypb.RealtimeStats{ViewSchemaChanged: tcase.updView}, } require.False(t, waitTimeout(&wg, time.Second), "schema was updated but received no signal") - require.Equal(t, 1, len(sbc.StringQueries())) + require.EqualValues(t, count+1, sbc.GetSchemaCount.Get()) _, keyspacePresent := tracker.tracked[target.Keyspace] require.Equal(t, true, keyspacePresent) @@ -415,25 +391,3 @@ func TestViewsTracking(t *testing.T) { }) } } - -// getResultSet goes over the results and return the distinct rows -func getResultSet(deltas []delta) []*sqltypes.Result { - rows := deltas[0].result.Rows - for _, d := range deltas[1:] { - for _, deltaRow := range d.result.Rows { - same := false - for _, row := range rows { - // emulating here that if view definition is same, then we do not send the update. - // tracker will think that the view is dropped. - if row[0].String() == deltaRow[0].String() && row[1].String() == deltaRow[1].String() { - same = true - break - } - } - if !same { - rows = append(rows, deltaRow) - } - } - } - return []*sqltypes.Result{{Fields: deltas[0].result.Fields, Rows: rows}} -} diff --git a/go/vt/vttablet/endtoend/framework/client.go b/go/vt/vttablet/endtoend/framework/client.go index 2b75f5b0a66..38967cab202 100644 --- a/go/vt/vttablet/endtoend/framework/client.go +++ b/go/vt/vttablet/endtoend/framework/client.go @@ -408,3 +408,7 @@ func (client *QueryClient) StreamHealth(sendFunc func(*querypb.StreamHealthRespo func (client *QueryClient) UpdateContext(ctx context.Context) { client.ctx = ctx } + +func (client *QueryClient) GetSchema(tableType querypb.SchemaTableType, tableNames ...string) (map[string]string, error) { + return client.server.GetSchema(client.ctx, client.target, tableType, tableNames) +} diff --git a/go/vt/vttablet/endtoend/views_test.go b/go/vt/vttablet/endtoend/views_test.go index 41628c7f510..ab9d519ae7e 100644 --- a/go/vt/vttablet/endtoend/views_test.go +++ b/go/vt/vttablet/endtoend/views_test.go @@ -30,6 +30,9 @@ import ( vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" ) +var qSelAllRows = "select table_schema, table_name, view_definition, create_statement from _vt.views" +var qDelAllRows = "delete from _vt.views" + // Test will validate create view ddls. func TestCreateViewDDL(t *testing.T) { client := framework.NewClient() @@ -39,16 +42,16 @@ func TestCreateViewDDL(t *testing.T) { &vtrpcpb.CallerID{}, &querypb.VTGateCallerID{Username: "dev"})) - defer client.Execute("delete from _vt.views", nil) + defer client.Execute(qDelAllRows, nil) _, err := client.Execute("create view vitess_view as select * from vitess_a", nil) require.NoError(t, err) // validate the row in _vt.views. - qr, err := client.Execute("select table_name, view_definition, create_statement from _vt.views", nil) + qr, err := client.Execute(qSelAllRows, nil) require.NoError(t, err) require.Equal(t, - `[[VARCHAR("vitess_view") TEXT("select * from vitess_a") TEXT("create view vitess_view as select * from vitess_a")]]`, + `[[VARCHAR("vttest") VARCHAR("vitess_view") TEXT("select * from vitess_a") TEXT("create view vitess_view as select * from vitess_a")]]`, fmt.Sprintf("%v", qr.Rows)) // view already exists. This should fail. @@ -60,10 +63,10 @@ func TestCreateViewDDL(t *testing.T) { require.NoError(t, err) // validate the row in _vt.views. - qr, err = client.Execute("select table_name, view_definition, create_statement from _vt.views", nil) + qr, err = client.Execute(qSelAllRows, nil) require.NoError(t, err) require.Equal(t, - `[[VARCHAR("vitess_view") TEXT("select id, foo from vitess_a") TEXT("create or replace view vitess_view as select id, foo from vitess_a")]]`, + `[[VARCHAR("vttest") VARCHAR("vitess_view") TEXT("select id, foo from vitess_a") TEXT("create or replace view vitess_view as select id, foo from vitess_a")]]`, fmt.Sprintf("%v", qr.Rows)) } @@ -76,7 +79,7 @@ func TestAlterViewDDL(t *testing.T) { &vtrpcpb.CallerID{}, &querypb.VTGateCallerID{Username: "dev"})) - defer client.Execute("delete from _vt.views", nil) + defer client.Execute(qDelAllRows, nil) // view does not exist, should FAIL _, err := client.Execute("alter view vitess_view as select * from vitess_a", nil) @@ -91,10 +94,10 @@ func TestAlterViewDDL(t *testing.T) { require.NoError(t, err) // validate the row in _vt.views. - qr, err := client.Execute("select table_name, view_definition, create_statement from _vt.views", nil) + qr, err := client.Execute(qSelAllRows, nil) require.NoError(t, err) require.Equal(t, - `[[VARCHAR("vitess_view") TEXT("select id, foo from vitess_a") TEXT("create view vitess_view as select id, foo from vitess_a")]]`, + `[[VARCHAR("vttest") VARCHAR("vitess_view") TEXT("select id, foo from vitess_a") TEXT("create view vitess_view as select id, foo from vitess_a")]]`, fmt.Sprintf("%v", qr.Rows)) } @@ -107,7 +110,7 @@ func TestDropViewDDL(t *testing.T) { &vtrpcpb.CallerID{}, &querypb.VTGateCallerID{Username: "dev"})) - defer client.Execute("delete from _vt.views", nil) + defer client.Execute(qDelAllRows, nil) // view does not exist, should FAIL _, err := client.Execute("drop view vitess_view", nil) @@ -132,7 +135,7 @@ func TestDropViewDDL(t *testing.T) { require.ErrorContains(t, err, "Unknown view 'vitess_view1,vitess_view3'") // validate ZERO rows in _vt.views. - qr, err := client.Execute("select * from _vt.views", nil) + qr, err := client.Execute(qSelAllRows, nil) require.NoError(t, err) require.Zero(t, qr.Rows) @@ -145,7 +148,30 @@ func TestDropViewDDL(t *testing.T) { require.NoError(t, err) // validate ZERO rows in _vt.views. - qr, err = client.Execute("select * from _vt.views", nil) + qr, err = client.Execute(qSelAllRows, nil) require.NoError(t, err) require.Zero(t, qr.Rows) } + +// TestGetSchemaRPC will validate GetSchema rpc.. +func TestGetSchemaRPC(t *testing.T) { + client := framework.NewClient() + + viewSchemaDef, err := client.GetSchema(querypb.SchemaTableType_VIEWS) + require.NoError(t, err) + require.Zero(t, len(viewSchemaDef)) + + client.UpdateContext(callerid.NewContext( + context.Background(), + &vtrpcpb.CallerID{}, + &querypb.VTGateCallerID{Username: "dev"})) + + defer client.Execute(qDelAllRows, nil) + + _, err = client.Execute("create view vitess_view as select 1 from vitess_a", nil) + require.NoError(t, err) + + viewSchemaDef, err = client.GetSchema(querypb.SchemaTableType_VIEWS) + require.NoError(t, err) + require.Equal(t, viewSchemaDef["vitess_view"], "select 1 from vitess_a") +} diff --git a/go/vt/vttablet/grpcqueryservice/server.go b/go/vt/vttablet/grpcqueryservice/server.go index bbd8d3a08c0..69ebcbf39b9 100644 --- a/go/vt/vttablet/grpcqueryservice/server.go +++ b/go/vt/vttablet/grpcqueryservice/server.go @@ -483,6 +483,19 @@ func (q *query) Release(ctx context.Context, request *querypb.ReleaseRequest) (r return &querypb.ReleaseResponse{}, nil } +// GetSchema implements the QueryServer interface +func (q *query) GetSchema(ctx context.Context, request *querypb.GetSchemaRequest) (response *querypb.GetSchemaResponse, err error) { + defer q.server.HandlePanic(&err) + var resp map[string]string + resp, err = q.server.GetSchema(ctx, request.Target, request.TableType, request.TableNames) + if err != nil { + return nil, vterrors.ToGRPC(err) + } + return &querypb.GetSchemaResponse{ + TableDefinition: resp, + }, nil +} + // Register registers the implementation on the provide gRPC Server. func Register(s *grpc.Server, server queryservice.QueryService) { queryservicepb.RegisterQueryServer(s, &query{server: server}) diff --git a/go/vt/vttablet/grpctabletconn/conn.go b/go/vt/vttablet/grpctabletconn/conn.go index a10d7d2a584..4a945d1a1af 100644 --- a/go/vt/vttablet/grpctabletconn/conn.go +++ b/go/vt/vttablet/grpctabletconn/conn.go @@ -1018,6 +1018,26 @@ func (conn *gRPCQueryClient) Release(ctx context.Context, target *querypb.Target return nil } +// GetSchema implements the queryservice interface +func (conn *gRPCQueryClient) GetSchema(ctx context.Context, target *querypb.Target, tableType querypb.SchemaTableType, tableNames []string) (map[string]string, error) { + conn.mu.RLock() + defer conn.mu.RUnlock() + if conn.cc == nil { + return nil, tabletconn.ConnClosed + } + + req := &querypb.GetSchemaRequest{ + Target: target, + TableType: tableType, + TableNames: tableNames, + } + reply, err := conn.c.GetSchema(ctx, req) + if err != nil { + return nil, tabletconn.ErrorFromGRPC(err) + } + return reply.TableDefinition, nil +} + // Close closes underlying gRPC channel. func (conn *gRPCQueryClient) Close(ctx context.Context) error { conn.mu.Lock() diff --git a/go/vt/vttablet/queryservice/queryservice.go b/go/vt/vttablet/queryservice/queryservice.go index d86812b2b40..b72ae12d653 100644 --- a/go/vt/vttablet/queryservice/queryservice.go +++ b/go/vt/vttablet/queryservice/queryservice.go @@ -117,6 +117,9 @@ type QueryService interface { Release(ctx context.Context, target *querypb.Target, transactionID, reservedID int64) error + // GetSchema returns the table definition for the specified tables. + GetSchema(ctx context.Context, target *querypb.Target, tableType querypb.SchemaTableType, tableNames []string) (map[string]string, error) + // Close must be called for releasing resources. Close(ctx context.Context) error } diff --git a/go/vt/vttablet/queryservice/wrapped.go b/go/vt/vttablet/queryservice/wrapped.go index 5d3402f7f11..97c4732da44 100644 --- a/go/vt/vttablet/queryservice/wrapped.go +++ b/go/vt/vttablet/queryservice/wrapped.go @@ -324,6 +324,15 @@ func (ws *wrappedService) Release(ctx context.Context, target *querypb.Target, t }) } +func (ws *wrappedService) GetSchema(ctx context.Context, target *querypb.Target, tableType querypb.SchemaTableType, tableNames []string) (schemaDef map[string]string, err error) { + err = ws.wrapper(ctx, target, ws.impl, "GetSchema", false, func(ctx context.Context, target *querypb.Target, conn QueryService) (bool, error) { + var innerErr error + schemaDef, innerErr = conn.GetSchema(ctx, target, tableType, tableNames) + return canRetry(ctx, innerErr), innerErr + }) + return schemaDef, err +} + func (ws *wrappedService) Close(ctx context.Context) error { return ws.wrapper(ctx, nil, ws.impl, "Close", false, func(ctx context.Context, target *querypb.Target, conn QueryService) (bool, error) { // No point retrying Close. diff --git a/go/vt/vttablet/sandboxconn/sandboxconn.go b/go/vt/vttablet/sandboxconn/sandboxconn.go index b4ab30cf71d..822f6774fe9 100644 --- a/go/vt/vttablet/sandboxconn/sandboxconn.go +++ b/go/vt/vttablet/sandboxconn/sandboxconn.go @@ -76,6 +76,7 @@ type SandboxConn struct { ReadTransactionCount sync2.AtomicInt64 ReserveCount sync2.AtomicInt64 ReleaseCount sync2.AtomicInt64 + GetSchemaCount sync2.AtomicInt64 // Queries stores the non-batch requests received. Queries []*querypb.BoundQuery @@ -119,6 +120,8 @@ type SandboxConn struct { EphemeralShardErr error NotServing bool + + getSchemaResult []map[string]string } var _ queryservice.QueryService = (*SandboxConn)(nil) // compile-time interface check @@ -154,6 +157,11 @@ func (sbc *SandboxConn) SetResults(r []*sqltypes.Result) { sbc.results = r } +// SetSchemaResult sets what GetSchema should return on each call. +func (sbc *SandboxConn) SetSchemaResult(r []map[string]string) { + sbc.getSchemaResult = r +} + // Execute is part of the QueryService interface. func (sbc *SandboxConn) Execute(ctx context.Context, target *querypb.Target, query string, bindVars map[string]*querypb.BindVariable, transactionID, reservedID int64, options *querypb.ExecuteOptions) (*sqltypes.Result, error) { sbc.execMu.Lock() @@ -576,6 +584,17 @@ func (sbc *SandboxConn) Release(ctx context.Context, target *querypb.Target, tra return sbc.getError() } +// GetSchema implements the QueryService interface +func (sbc *SandboxConn) GetSchema(ctx context.Context, target *querypb.Target, tableType querypb.SchemaTableType, tableNames []string) (map[string]string, error) { + sbc.GetSchemaCount.Add(1) + var resp map[string]string + if len(sbc.getSchemaResult) > 0 { + resp = sbc.getSchemaResult[0] + sbc.getSchemaResult = sbc.getSchemaResult[1:] + } + return resp, nil +} + // Close does not change ExecCount func (sbc *SandboxConn) Close(ctx context.Context) error { return nil diff --git a/go/vt/vttablet/tabletconntest/fakequeryservice.go b/go/vt/vttablet/tabletconntest/fakequeryservice.go index 751d9ad3d57..e78194fd5db 100644 --- a/go/vt/vttablet/tabletconntest/fakequeryservice.go +++ b/go/vt/vttablet/tabletconntest/fakequeryservice.go @@ -749,6 +749,11 @@ func (f *FakeQueryService) Release(ctx context.Context, target *querypb.Target, panic("implement me") } +// GetSchema implements the QueryService interface +func (f *FakeQueryService) GetSchema(ctx context.Context, target *querypb.Target, tableType querypb.SchemaTableType, tableNames []string) (map[string]string, error) { + panic("implement me") +} + // CreateFakeServer returns the fake server for the tests func CreateFakeServer(t testing.TB) *FakeQueryService { return &FakeQueryService{ diff --git a/go/vt/vttablet/tabletserver/query_executor.go b/go/vt/vttablet/tabletserver/query_executor.go index 79af1d4a88f..b7b198f7f87 100644 --- a/go/vt/vttablet/tabletserver/query_executor.go +++ b/go/vt/vttablet/tabletserver/query_executor.go @@ -305,7 +305,7 @@ func (qre *QueryExecutor) execViewDDL(conn *StatefulConnection) (*sqltypes.Resul } func (qre *QueryExecutor) execCreateViewDDL(conn *StatefulConnection, stmt *sqlparser.CreateView) (*sqltypes.Result, error) { - bindVars := qre.generateBindVarsForViewDDLInsert(stmt) + bindVars := generateBindVarsForViewDDLInsert(stmt) sql, _, err := qre.generateFinalSQL(qre.plan.FullQuery, bindVars) if err != nil { return nil, err @@ -334,7 +334,7 @@ func (qre *QueryExecutor) execAlterViewDDL(conn *StatefulConnection, stmt *sqlpa CheckOption: stmt.CheckOption, Comments: stmt.Comments, } - bindVars := qre.generateBindVarsForViewDDLInsert(createViewDDL) + bindVars := generateBindVarsForViewDDLInsert(createViewDDL) sql, _, err := qre.generateFinalSQL(qre.plan.FullQuery, bindVars) if err != nil { return nil, err @@ -1227,10 +1227,61 @@ func (qre *QueryExecutor) recordUserQuery(queryType string, duration int64) { qre.tsv.Stats().UserTableQueryTimesNs.Add([]string{tableName, username, queryType}, duration) } -func (qre *QueryExecutor) generateBindVarsForViewDDLInsert(createView *sqlparser.CreateView) map[string]*querypb.BindVariable { +func generateBindVarsForViewDDLInsert(createView *sqlparser.CreateView) map[string]*querypb.BindVariable { bindVars := make(map[string]*querypb.BindVariable) bindVars["table_name"] = sqltypes.StringBindVariable(createView.ViewName.Name.String()) bindVars["view_definition"] = sqltypes.StringBindVariable(sqlparser.String(createView.Select)) bindVars["create_statement"] = sqltypes.StringBindVariable(sqlparser.String(createView)) return bindVars } + +func (qre *QueryExecutor) GetSchemaDefinitions(tableType querypb.SchemaTableType, tableNames []string) (map[string]string, error) { + switch tableType { + case querypb.SchemaTableType_VIEWS: + return qre.getViewDefinitions(tableNames) + } + return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid table type %v", tableType) +} + +func (qre *QueryExecutor) getViewDefinitions(viewNames []string) (map[string]string, error) { + query := mysql.FetchViews + var bindVars map[string]*querypb.BindVariable + if len(viewNames) > 0 { + query = mysql.FetchUpdatedViews + bindVars = map[string]*querypb.BindVariable{ + "viewnames": sqltypes.StringBindVariable(strings.Join(viewNames, ",")), + } + } + res, err := qre.execQuery(query, bindVars) + if err != nil { + return nil, err + } + + schemaDef := make(map[string]string) + for _, row := range res.Rows { + schemaDef[row[0].ToString()] = row[1].ToString() + } + return schemaDef, nil +} + +func (qre *QueryExecutor) execQuery(query string, bindVars map[string]*querypb.BindVariable) (*sqltypes.Result, error) { + sql := query + if len(bindVars) > 0 { + stmt, err := sqlparser.Parse(query) + if err != nil { + return nil, err + } + sql, _, err = qre.generateFinalSQL(sqlparser.NewParsedQuery(stmt), bindVars) + if err != nil { + return nil, err + } + } + + conn, err := qre.getConn() + if err != nil { + return nil, err + } + defer conn.Recycle() + + return qre.execDBConn(conn, sql, true) +} diff --git a/go/vt/vttablet/tabletserver/tabletserver.go b/go/vt/vttablet/tabletserver/tabletserver.go index daf32edc8b2..c9c5146783c 100644 --- a/go/vt/vttablet/tabletserver/tabletserver.go +++ b/go/vt/vttablet/tabletserver/tabletserver.go @@ -1395,6 +1395,27 @@ func txToReserveState(state queryservice.TransactionState) queryservice.Reserved } } +// GetSchema returns table definitions for the specified tables. +func (tsv *TabletServer) GetSchema(ctx context.Context, target *querypb.Target, tableType querypb.SchemaTableType, tableNames []string) (schemaDef map[string]string, err error) { + err = tsv.execRequest( + ctx, tsv.QueryTimeout.Get(), + "GetSchema", "", nil, + target, nil, false, /* allowOnShutdown */ + func(ctx context.Context, logStats *tabletenv.LogStats) error { + defer tsv.stats.QueryTimings.Record("GetSchema", time.Now()) + + qre := &QueryExecutor{ + ctx: ctx, + logStats: logStats, + tsv: tsv, + } + schemaDef, err = qre.GetSchemaDefinitions(tableType, tableNames) + return err + }, + ) + return +} + // execRequest performs verifications, sets up the necessary environments // and calls the supplied function for executing the request. func (tsv *TabletServer) execRequest( diff --git a/proto/query.proto b/proto/query.proto index f1ffd734317..13d2372a8c7 100644 --- a/proto/query.proto +++ b/proto/query.proto @@ -973,3 +973,24 @@ message TransactionMetadata { int64 time_created = 3; repeated Target participants = 4; } + + +// SchemaTableType represents the type of table requested. +enum SchemaTableType { + VIEWS = 0; + TABLES = 1; + ALL = 2; +} + +// GetSchemaRequest is the payload to GetSchema +message GetSchemaRequest { + Target target = 1; + SchemaTableType table_type = 2; + repeated string table_names = 3; +} + +// GetSchemaResponse is the returned value from GetSchema +message GetSchemaResponse { + // this is for the schema definition for the requested tables. + map table_definition = 2; +} \ No newline at end of file diff --git a/proto/queryservice.proto b/proto/queryservice.proto index 3f3879639e2..295fca961eb 100644 --- a/proto/queryservice.proto +++ b/proto/queryservice.proto @@ -108,4 +108,7 @@ service Query { // VStreamResults streams results along with the gtid of the snapshot. rpc VStreamResults(binlogdata.VStreamResultsRequest) returns (stream binlogdata.VStreamResultsResponse) {}; + + // GetSchema returns the schema information. + rpc GetSchema(query.GetSchemaRequest) returns (query.GetSchemaResponse) {}; } diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index 25b0c92bfa1..e55abfe9428 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -31280,6 +31280,205 @@ export namespace query { */ public toJSON(): { [k: string]: any }; } + + /** SchemaTableType enum. */ + enum SchemaTableType { + VIEWS = 0, + TABLES = 1, + ALL = 2 + } + + /** Properties of a GetSchemaRequest. */ + interface IGetSchemaRequest { + + /** GetSchemaRequest target */ + target?: (query.ITarget|null); + + /** GetSchemaRequest table_type */ + table_type?: (query.SchemaTableType|null); + + /** GetSchemaRequest table_names */ + table_names?: (string[]|null); + } + + /** Represents a GetSchemaRequest. */ + class GetSchemaRequest implements IGetSchemaRequest { + + /** + * Constructs a new GetSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: query.IGetSchemaRequest); + + /** GetSchemaRequest target. */ + public target?: (query.ITarget|null); + + /** GetSchemaRequest table_type. */ + public table_type: query.SchemaTableType; + + /** GetSchemaRequest table_names. */ + public table_names: string[]; + + /** + * Creates a new GetSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSchemaRequest instance + */ + public static create(properties?: query.IGetSchemaRequest): query.GetSchemaRequest; + + /** + * Encodes the specified GetSchemaRequest message. Does not implicitly {@link query.GetSchemaRequest.verify|verify} messages. + * @param message GetSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: query.IGetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSchemaRequest message, length delimited. Does not implicitly {@link query.GetSchemaRequest.verify|verify} messages. + * @param message GetSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: query.IGetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): query.GetSchemaRequest; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): query.GetSchemaRequest; + + /** + * Verifies a GetSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): query.GetSchemaRequest; + + /** + * Creates a plain object from a GetSchemaRequest message. Also converts values to other types if specified. + * @param message GetSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: query.GetSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetSchemaResponse. */ + interface IGetSchemaResponse { + + /** GetSchemaResponse table_definition */ + table_definition?: ({ [k: string]: string }|null); + } + + /** Represents a GetSchemaResponse. */ + class GetSchemaResponse implements IGetSchemaResponse { + + /** + * Constructs a new GetSchemaResponse. + * @param [properties] Properties to set + */ + constructor(properties?: query.IGetSchemaResponse); + + /** GetSchemaResponse table_definition. */ + public table_definition: { [k: string]: string }; + + /** + * Creates a new GetSchemaResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSchemaResponse instance + */ + public static create(properties?: query.IGetSchemaResponse): query.GetSchemaResponse; + + /** + * Encodes the specified GetSchemaResponse message. Does not implicitly {@link query.GetSchemaResponse.verify|verify} messages. + * @param message GetSchemaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: query.IGetSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSchemaResponse message, length delimited. Does not implicitly {@link query.GetSchemaResponse.verify|verify} messages. + * @param message GetSchemaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: query.IGetSchemaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSchemaResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): query.GetSchemaResponse; + + /** + * Decodes a GetSchemaResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): query.GetSchemaResponse; + + /** + * Verifies a GetSchemaResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSchemaResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSchemaResponse + */ + public static fromObject(object: { [k: string]: any }): query.GetSchemaResponse; + + /** + * Creates a plain object from a GetSchemaResponse message. Also converts values to other types if specified. + * @param message GetSchemaResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: query.GetSchemaResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSchemaResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Namespace vtrpc. */ diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index cd7a5fe2936..05ae47dbcce 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -73907,6 +73907,516 @@ $root.query = (function() { return TransactionMetadata; })(); + /** + * SchemaTableType enum. + * @name query.SchemaTableType + * @enum {number} + * @property {number} VIEWS=0 VIEWS value + * @property {number} TABLES=1 TABLES value + * @property {number} ALL=2 ALL value + */ + query.SchemaTableType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VIEWS"] = 0; + values[valuesById[1] = "TABLES"] = 1; + values[valuesById[2] = "ALL"] = 2; + return values; + })(); + + query.GetSchemaRequest = (function() { + + /** + * Properties of a GetSchemaRequest. + * @memberof query + * @interface IGetSchemaRequest + * @property {query.ITarget|null} [target] GetSchemaRequest target + * @property {query.SchemaTableType|null} [table_type] GetSchemaRequest table_type + * @property {Array.|null} [table_names] GetSchemaRequest table_names + */ + + /** + * Constructs a new GetSchemaRequest. + * @memberof query + * @classdesc Represents a GetSchemaRequest. + * @implements IGetSchemaRequest + * @constructor + * @param {query.IGetSchemaRequest=} [properties] Properties to set + */ + function GetSchemaRequest(properties) { + this.table_names = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSchemaRequest target. + * @member {query.ITarget|null|undefined} target + * @memberof query.GetSchemaRequest + * @instance + */ + GetSchemaRequest.prototype.target = null; + + /** + * GetSchemaRequest table_type. + * @member {query.SchemaTableType} table_type + * @memberof query.GetSchemaRequest + * @instance + */ + GetSchemaRequest.prototype.table_type = 0; + + /** + * GetSchemaRequest table_names. + * @member {Array.} table_names + * @memberof query.GetSchemaRequest + * @instance + */ + GetSchemaRequest.prototype.table_names = $util.emptyArray; + + /** + * Creates a new GetSchemaRequest instance using the specified properties. + * @function create + * @memberof query.GetSchemaRequest + * @static + * @param {query.IGetSchemaRequest=} [properties] Properties to set + * @returns {query.GetSchemaRequest} GetSchemaRequest instance + */ + GetSchemaRequest.create = function create(properties) { + return new GetSchemaRequest(properties); + }; + + /** + * Encodes the specified GetSchemaRequest message. Does not implicitly {@link query.GetSchemaRequest.verify|verify} messages. + * @function encode + * @memberof query.GetSchemaRequest + * @static + * @param {query.IGetSchemaRequest} message GetSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + $root.query.Target.encode(message.target, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.table_type != null && Object.hasOwnProperty.call(message, "table_type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.table_type); + if (message.table_names != null && message.table_names.length) + for (var i = 0; i < message.table_names.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.table_names[i]); + return writer; + }; + + /** + * Encodes the specified GetSchemaRequest message, length delimited. Does not implicitly {@link query.GetSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof query.GetSchemaRequest + * @static + * @param {query.IGetSchemaRequest} message GetSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof query.GetSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {query.GetSchemaRequest} GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.query.GetSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.target = $root.query.Target.decode(reader, reader.uint32()); + break; + case 2: + message.table_type = reader.int32(); + break; + case 3: + if (!(message.table_names && message.table_names.length)) + message.table_names = []; + message.table_names.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof query.GetSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {query.GetSchemaRequest} GetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSchemaRequest message. + * @function verify + * @memberof query.GetSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSchemaRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.target != null && message.hasOwnProperty("target")) { + var error = $root.query.Target.verify(message.target); + if (error) + return "target." + error; + } + if (message.table_type != null && message.hasOwnProperty("table_type")) + switch (message.table_type) { + default: + return "table_type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.table_names != null && message.hasOwnProperty("table_names")) { + if (!Array.isArray(message.table_names)) + return "table_names: array expected"; + for (var i = 0; i < message.table_names.length; ++i) + if (!$util.isString(message.table_names[i])) + return "table_names: string[] expected"; + } + return null; + }; + + /** + * Creates a GetSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof query.GetSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {query.GetSchemaRequest} GetSchemaRequest + */ + GetSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.query.GetSchemaRequest) + return object; + var message = new $root.query.GetSchemaRequest(); + if (object.target != null) { + if (typeof object.target !== "object") + throw TypeError(".query.GetSchemaRequest.target: object expected"); + message.target = $root.query.Target.fromObject(object.target); + } + switch (object.table_type) { + case "VIEWS": + case 0: + message.table_type = 0; + break; + case "TABLES": + case 1: + message.table_type = 1; + break; + case "ALL": + case 2: + message.table_type = 2; + break; + } + if (object.table_names) { + if (!Array.isArray(object.table_names)) + throw TypeError(".query.GetSchemaRequest.table_names: array expected"); + message.table_names = []; + for (var i = 0; i < object.table_names.length; ++i) + message.table_names[i] = String(object.table_names[i]); + } + return message; + }; + + /** + * Creates a plain object from a GetSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof query.GetSchemaRequest + * @static + * @param {query.GetSchemaRequest} message GetSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.table_names = []; + if (options.defaults) { + object.target = null; + object.table_type = options.enums === String ? "VIEWS" : 0; + } + if (message.target != null && message.hasOwnProperty("target")) + object.target = $root.query.Target.toObject(message.target, options); + if (message.table_type != null && message.hasOwnProperty("table_type")) + object.table_type = options.enums === String ? $root.query.SchemaTableType[message.table_type] : message.table_type; + if (message.table_names && message.table_names.length) { + object.table_names = []; + for (var j = 0; j < message.table_names.length; ++j) + object.table_names[j] = message.table_names[j]; + } + return object; + }; + + /** + * Converts this GetSchemaRequest to JSON. + * @function toJSON + * @memberof query.GetSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + GetSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSchemaRequest; + })(); + + query.GetSchemaResponse = (function() { + + /** + * Properties of a GetSchemaResponse. + * @memberof query + * @interface IGetSchemaResponse + * @property {Object.|null} [table_definition] GetSchemaResponse table_definition + */ + + /** + * Constructs a new GetSchemaResponse. + * @memberof query + * @classdesc Represents a GetSchemaResponse. + * @implements IGetSchemaResponse + * @constructor + * @param {query.IGetSchemaResponse=} [properties] Properties to set + */ + function GetSchemaResponse(properties) { + this.table_definition = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSchemaResponse table_definition. + * @member {Object.} table_definition + * @memberof query.GetSchemaResponse + * @instance + */ + GetSchemaResponse.prototype.table_definition = $util.emptyObject; + + /** + * Creates a new GetSchemaResponse instance using the specified properties. + * @function create + * @memberof query.GetSchemaResponse + * @static + * @param {query.IGetSchemaResponse=} [properties] Properties to set + * @returns {query.GetSchemaResponse} GetSchemaResponse instance + */ + GetSchemaResponse.create = function create(properties) { + return new GetSchemaResponse(properties); + }; + + /** + * Encodes the specified GetSchemaResponse message. Does not implicitly {@link query.GetSchemaResponse.verify|verify} messages. + * @function encode + * @memberof query.GetSchemaResponse + * @static + * @param {query.IGetSchemaResponse} message GetSchemaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table_definition != null && Object.hasOwnProperty.call(message, "table_definition")) + for (var keys = Object.keys(message.table_definition), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.table_definition[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetSchemaResponse message, length delimited. Does not implicitly {@link query.GetSchemaResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof query.GetSchemaResponse + * @static + * @param {query.IGetSchemaResponse} message GetSchemaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSchemaResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSchemaResponse message from the specified reader or buffer. + * @function decode + * @memberof query.GetSchemaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {query.GetSchemaResponse} GetSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.query.GetSchemaResponse(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (message.table_definition === $util.emptyObject) + message.table_definition = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.table_definition[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSchemaResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof query.GetSchemaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {query.GetSchemaResponse} GetSchemaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSchemaResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSchemaResponse message. + * @function verify + * @memberof query.GetSchemaResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSchemaResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table_definition != null && message.hasOwnProperty("table_definition")) { + if (!$util.isObject(message.table_definition)) + return "table_definition: object expected"; + var key = Object.keys(message.table_definition); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.table_definition[key[i]])) + return "table_definition: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a GetSchemaResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof query.GetSchemaResponse + * @static + * @param {Object.} object Plain object + * @returns {query.GetSchemaResponse} GetSchemaResponse + */ + GetSchemaResponse.fromObject = function fromObject(object) { + if (object instanceof $root.query.GetSchemaResponse) + return object; + var message = new $root.query.GetSchemaResponse(); + if (object.table_definition) { + if (typeof object.table_definition !== "object") + throw TypeError(".query.GetSchemaResponse.table_definition: object expected"); + message.table_definition = {}; + for (var keys = Object.keys(object.table_definition), i = 0; i < keys.length; ++i) + message.table_definition[keys[i]] = String(object.table_definition[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a GetSchemaResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof query.GetSchemaResponse + * @static + * @param {query.GetSchemaResponse} message GetSchemaResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSchemaResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.table_definition = {}; + var keys2; + if (message.table_definition && (keys2 = Object.keys(message.table_definition)).length) { + object.table_definition = {}; + for (var j = 0; j < keys2.length; ++j) + object.table_definition[keys2[j]] = message.table_definition[keys2[j]]; + } + return object; + }; + + /** + * Converts this GetSchemaResponse to JSON. + * @function toJSON + * @memberof query.GetSchemaResponse + * @instance + * @returns {Object.} JSON object + */ + GetSchemaResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSchemaResponse; + })(); + return query; })();