From 04afc33c46e29b703491006ad60eae92c6f673c7 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Mon, 20 Nov 2023 12:42:02 +0100 Subject: [PATCH] evalengine: Improve the typing situation for functions (#14533) Signed-off-by: Dirkjan Bussink Signed-off-by: Vicent Marti Co-authored-by: Vicent Marti --- go/vt/proto/vschema/vschema.pb.go | 142 +- go/vt/proto/vschema/vschema_vtproto.pb.go | 198 +- go/vt/vtgate/engine/aggregations.go | 13 +- go/vt/vtgate/engine/cached_size.go | 12 +- go/vt/vtgate/engine/delete_test.go | 4 +- go/vt/vtgate/engine/distinct.go | 14 +- go/vt/vtgate/engine/distinct_test.go | 9 +- go/vt/vtgate/engine/hash_join_test.go | 8 +- go/vt/vtgate/engine/limit_test.go | 10 +- go/vt/vtgate/engine/memory_sort_test.go | 18 +- go/vt/vtgate/engine/merge_sort_test.go | 2 +- go/vt/vtgate/engine/ordered_aggregate.go | 8 +- go/vt/vtgate/engine/ordered_aggregate_test.go | 6 +- go/vt/vtgate/engine/projection.go | 8 +- go/vt/vtgate/engine/route_test.go | 7 +- go/vt/vtgate/engine/set_test.go | 2 +- go/vt/vtgate/engine/update_test.go | 2 +- go/vt/vtgate/evalengine/api_coerce.go | 64 +- go/vt/vtgate/evalengine/api_compare.go | 10 +- go/vt/vtgate/evalengine/api_compare_test.go | 216 +- go/vt/vtgate/evalengine/api_literal.go | 11 +- go/vt/vtgate/evalengine/cached_size.go | 6 +- go/vt/vtgate/evalengine/compiler.go | 91 +- go/vt/vtgate/evalengine/compiler_asm.go | 3 - go/vt/vtgate/evalengine/compiler_test.go | 36 + go/vt/vtgate/evalengine/expr_arithmetic.go | 21 +- go/vt/vtgate/evalengine/expr_column.go | 15 +- go/vt/vtgate/evalengine/expr_env.go | 6 +- go/vt/vtgate/evalengine/expr_literal.go | 4 + go/vt/vtgate/evalengine/fn_time.go | 37 +- go/vt/vtgate/evalengine/translate.go | 18 +- go/vt/vtgate/planbuilder/collations_test.go | 12 +- .../planbuilder/expression_converter.go | 2 +- .../planbuilder/expression_converter_test.go | 2 +- .../planbuilder/operator_transformers.go | 4 +- .../planbuilder/operators/queryprojection.go | 4 +- .../testdata/info_schema57_cases.json | 24 +- .../testdata/info_schema80_cases.json | 20 +- .../planbuilder/testdata/union_cases.json | 24 +- go/vt/vtgate/schema/tracker.go | 39 +- go/vt/vtgate/schema/tracker_test.go | 56 +- go/vt/vtgate/semantics/analyzer_test.go | 2 +- go/vt/vtgate/semantics/binder.go | 5 +- go/vt/vtgate/semantics/dependencies.go | 4 +- go/vt/vtgate/semantics/info_schema.go | 2663 ++++++++--------- .../vtgate/semantics/info_schema_gen_test.go | 36 +- go/vt/vtgate/semantics/real_table.go | 17 +- go/vt/vtgate/semantics/semantic_state.go | 20 +- go/vt/vtgate/semantics/typer.go | 17 +- go/vt/vtgate/semantics/typer_test.go | 2 +- go/vt/vtgate/vindexes/vschema.go | 36 +- go/vt/vtgate/vschema_manager_test.go | 20 +- go/vt/vttablet/tabletmanager/vdiff/utils.go | 11 +- go/vt/wrangler/vdiff.go | 8 +- go/vt/wrangler/vdiff_test.go | 4 +- proto/vschema.proto | 6 + web/vtadmin/src/proto/vtadmin.d.ts | 33 + web/vtadmin/src/proto/vtadmin.js | 151 + 58 files changed, 2376 insertions(+), 1847 deletions(-) diff --git a/go/vt/proto/vschema/vschema.pb.go b/go/vt/proto/vschema/vschema.pb.go index fe185d63fcd..ff64faf4bab 100644 --- a/go/vt/proto/vschema/vschema.pb.go +++ b/go/vt/proto/vschema/vschema.pb.go @@ -600,10 +600,16 @@ type Column struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Type query.Type `protobuf:"varint,2,opt,name=type,proto3,enum=query.Type" json:"type,omitempty"` - Invisible bool `protobuf:"varint,3,opt,name=invisible,proto3" json:"invisible,omitempty"` - Default string `protobuf:"bytes,4,opt,name=default,proto3" json:"default,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type query.Type `protobuf:"varint,2,opt,name=type,proto3,enum=query.Type" json:"type,omitempty"` + Invisible bool `protobuf:"varint,3,opt,name=invisible,proto3" json:"invisible,omitempty"` + Default string `protobuf:"bytes,4,opt,name=default,proto3" json:"default,omitempty"` + CollationName string `protobuf:"bytes,5,opt,name=collation_name,json=collationName,proto3" json:"collation_name,omitempty"` + Size int32 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` + Scale int32 `protobuf:"varint,7,opt,name=scale,proto3" json:"scale,omitempty"` + Nullable *bool `protobuf:"varint,8,opt,name=nullable,proto3,oneof" json:"nullable,omitempty"` + // values contains the list of values for an enum or set column. + Values []string `protobuf:"bytes,9,rep,name=values,proto3" json:"values,omitempty"` } func (x *Column) Reset() { @@ -666,6 +672,41 @@ func (x *Column) GetDefault() string { return "" } +func (x *Column) GetCollationName() string { + if x != nil { + return x.CollationName + } + return "" +} + +func (x *Column) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *Column) GetScale() int32 { + if x != nil { + return x.Scale + } + return 0 +} + +func (x *Column) GetNullable() bool { + if x != nil && x.Nullable != nil { + return *x.Nullable + } + return false +} + +func (x *Column) GetValues() []string { + if x != nil { + return x.Values + } + return nil +} + // SrvVSchema is the roll-up of all the Keyspace schema for a cell. type SrvVSchema struct { state protoimpl.MessageState @@ -928,47 +969,57 @@ var file_vschema_proto_rawDesc = []byte{ 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, - 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x75, 0x0a, 0x06, 0x43, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x73, 0x69, - 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x73, - 0x69, 0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0xa7, - 0x02, 0x0a, 0x0a, 0x53, 0x72, 0x76, 0x56, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x40, 0x0a, - 0x09, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x72, 0x76, 0x56, 0x53, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, - 0x3a, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x0c, 0x72, - 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x13, 0x73, - 0x68, 0x61, 0x72, 0x64, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x75, 0x6c, - 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, - 0x75, 0x6c, 0x65, 0x73, 0x52, 0x11, 0x73, 0x68, 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, - 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x1a, 0x4f, 0x0a, 0x0e, 0x4b, 0x65, 0x79, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x73, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x44, 0x0a, 0x11, 0x53, 0x68, 0x61, 0x72, - 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2f, 0x0a, - 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x76, - 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, - 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x6e, - 0x0a, 0x10, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, - 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x4b, - 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x5f, 0x6b, 0x65, - 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x6f, - 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x42, 0x26, - 0x5a, 0x24, 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, 0x76, - 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x8c, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x76, 0x69, 0x73, + 0x69, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x69, + 0x73, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, + 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, + 0x61, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x61, 0x6c, 0x65, + 0x12, 0x1f, 0x0a, 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x08, 0x48, 0x00, 0x52, 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x88, 0x01, + 0x01, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6e, 0x75, + 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x22, 0xa7, 0x02, 0x0a, 0x0a, 0x53, 0x72, 0x76, 0x56, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x40, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x2e, 0x53, 0x72, 0x76, 0x56, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4b, 0x65, + 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x6b, 0x65, + 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, + 0x6e, 0x67, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, + 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, + 0x6c, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x13, 0x73, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x72, 0x6f, 0x75, + 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x64, + 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x11, 0x73, 0x68, + 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x1a, + 0x4f, 0x0a, 0x0e, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4b, 0x65, 0x79, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0x44, 0x0a, 0x11, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, + 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x53, + 0x68, 0x61, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x52, + 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x6e, 0x0a, 0x10, 0x53, 0x68, 0x61, 0x72, 0x64, 0x52, + 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x72, + 0x6f, 0x6d, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x42, 0x26, 0x5a, 0x24, 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, 0x76, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1167,6 +1218,7 @@ func file_vschema_proto_init() { } } } + file_vschema_proto_msgTypes[7].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/go/vt/proto/vschema/vschema_vtproto.pb.go b/go/vt/proto/vschema/vschema_vtproto.pb.go index 2235bfea496..ba55bcfa97c 100644 --- a/go/vt/proto/vschema/vschema_vtproto.pb.go +++ b/go/vt/proto/vschema/vschema_vtproto.pb.go @@ -210,10 +210,22 @@ func (m *Column) CloneVT() *Column { return (*Column)(nil) } r := &Column{ - Name: m.Name, - Type: m.Type, - Invisible: m.Invisible, - Default: m.Default, + Name: m.Name, + Type: m.Type, + Invisible: m.Invisible, + Default: m.Default, + CollationName: m.CollationName, + Size: m.Size, + Scale: m.Scale, + } + if rhs := m.Nullable; rhs != nil { + tmpVal := *rhs + r.Nullable = &tmpVal + } + if rhs := m.Values; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Values = tmpContainer } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -788,6 +800,42 @@ func (m *Column) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Values) > 0 { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Values[iNdEx]) + copy(dAtA[i:], m.Values[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Values[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if m.Nullable != nil { + i-- + if *m.Nullable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.Scale != 0 { + i = encodeVarint(dAtA, i, uint64(m.Scale)) + i-- + dAtA[i] = 0x38 + } + if m.Size != 0 { + i = encodeVarint(dAtA, i, uint64(m.Size)) + i-- + dAtA[i] = 0x30 + } + if len(m.CollationName) > 0 { + i -= len(m.CollationName) + copy(dAtA[i:], m.CollationName) + i = encodeVarint(dAtA, i, uint64(len(m.CollationName))) + i-- + dAtA[i] = 0x2a + } if len(m.Default) > 0 { i -= len(m.Default) copy(dAtA[i:], m.Default) @@ -1215,6 +1263,25 @@ func (m *Column) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } + l = len(m.CollationName) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Size != 0 { + n += 1 + sov(uint64(m.Size)) + } + if m.Scale != 0 { + n += 1 + sov(uint64(m.Scale)) + } + if m.Nullable != nil { + n += 2 + } + if len(m.Values) > 0 { + for _, s := range m.Values { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } n += len(m.unknownFields) return n } @@ -2769,6 +2836,129 @@ func (m *Column) UnmarshalVT(dAtA []byte) error { } m.Default = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollationName", 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.CollationName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size", wireType) + } + m.Size = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Size |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Scale", wireType) + } + m.Scale = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Scale |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nullable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Nullable = &b + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", 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.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) diff --git a/go/vt/vtgate/engine/aggregations.go b/go/vt/vtgate/engine/aggregations.go index dd7a259d1b6..0a72e263e21 100644 --- a/go/vt/vtgate/engine/aggregations.go +++ b/go/vt/vtgate/engine/aggregations.go @@ -57,7 +57,6 @@ func NewAggregateParam(opcode AggregateOpcode, col int, alias string) *Aggregate Col: col, Alias: alias, WCol: -1, - Type: evalengine.UnknownType(), } if opcode.NeedsComparableValues() { out.KeyCol = col @@ -74,8 +73,8 @@ func (ap *AggregateParams) String() string { if ap.WAssigned() { keyCol = fmt.Sprintf("%s|%d", keyCol, ap.WCol) } - if sqltypes.IsText(ap.Type.Type) && ap.Type.Coll != collations.Unknown { - keyCol += " COLLATE " + collations.Local().LookupName(ap.Type.Coll) + if sqltypes.IsText(ap.Type.Type()) && ap.Type.Collation() != collations.Unknown { + keyCol += " COLLATE " + collations.Local().LookupName(ap.Type.Collation()) } dispOrigOp := "" if ap.OrigOpcode != AggregateUnassigned && ap.OrigOpcode != ap.Opcode { @@ -381,7 +380,7 @@ func newAggregation(fields []*querypb.Field, aggregates []*AggregateParams) (agg from: aggr.Col, distinct: aggregatorDistinct{ column: distinct, - coll: aggr.Type.Coll, + coll: aggr.Type.Collation(), }, } @@ -399,7 +398,7 @@ func newAggregation(fields []*querypb.Field, aggregates []*AggregateParams) (agg sum: sum, distinct: aggregatorDistinct{ column: distinct, - coll: aggr.Type.Coll, + coll: aggr.Type.Collation(), }, } @@ -407,7 +406,7 @@ func newAggregation(fields []*querypb.Field, aggregates []*AggregateParams) (agg ag = &aggregatorMin{ aggregatorMinMax{ from: aggr.Col, - minmax: evalengine.NewAggregationMinMax(sourceType, aggr.Type.Coll), + minmax: evalengine.NewAggregationMinMax(sourceType, aggr.Type.Collation()), }, } @@ -415,7 +414,7 @@ func newAggregation(fields []*querypb.Field, aggregates []*AggregateParams) (agg ag = &aggregatorMax{ aggregatorMinMax{ from: aggr.Col, - minmax: evalengine.NewAggregationMinMax(sourceType, aggr.Type.Coll), + minmax: evalengine.NewAggregationMinMax(sourceType, aggr.Type.Collation()), }, } diff --git a/go/vt/vtgate/engine/cached_size.go b/go/vt/vtgate/engine/cached_size.go index a18e2108c4a..6024c66457a 100644 --- a/go/vt/vtgate/engine/cached_size.go +++ b/go/vt/vtgate/engine/cached_size.go @@ -67,7 +67,7 @@ func (cached *CheckCol) CachedSize(alloc bool) int64 { } size := int64(0) if alloc { - size += int64(24) + size += int64(32) } // field WsCol *int size += hack.RuntimeAllocSize(int64(8)) @@ -199,7 +199,7 @@ func (cached *Distinct) CachedSize(alloc bool) int64 { } // field CheckCols []vitess.io/vitess/go/vt/vtgate/engine.CheckCol { - size += hack.RuntimeAllocSize(int64(cap(cached.CheckCols)) * int64(23)) + size += hack.RuntimeAllocSize(int64(cap(cached.CheckCols)) * int64(32)) for _, elem := range cached.CheckCols { size += elem.CachedSize(false) } @@ -346,7 +346,7 @@ func (cached *GroupByParams) CachedSize(alloc bool) int64 { } size := int64(0) if alloc { - size += int64(48) + size += int64(64) } // field Expr vitess.io/vitess/go/vt/sqlparser.Expr if cc, ok := cached.Expr.(cachedObject); ok { @@ -588,7 +588,7 @@ func (cached *MemorySort) CachedSize(alloc bool) int64 { } // field OrderBy vitess.io/vitess/go/vt/vtgate/evalengine.Comparison { - size += hack.RuntimeAllocSize(int64(cap(cached.OrderBy)) * int64(27)) + size += hack.RuntimeAllocSize(int64(cap(cached.OrderBy)) * int64(36)) } // field Input vitess.io/vitess/go/vt/vtgate/engine.Primitive if cc, ok := cached.Input.(cachedObject); ok { @@ -615,7 +615,7 @@ func (cached *MergeSort) CachedSize(alloc bool) int64 { } // field OrderBy vitess.io/vitess/go/vt/vtgate/evalengine.Comparison { - size += hack.RuntimeAllocSize(int64(cap(cached.OrderBy)) * int64(27)) + size += hack.RuntimeAllocSize(int64(cap(cached.OrderBy)) * int64(36)) } return size } @@ -820,7 +820,7 @@ func (cached *Route) CachedSize(alloc bool) int64 { size += hack.RuntimeAllocSize(int64(len(cached.FieldQuery))) // field OrderBy vitess.io/vitess/go/vt/vtgate/evalengine.Comparison { - size += hack.RuntimeAllocSize(int64(cap(cached.OrderBy)) * int64(27)) + size += hack.RuntimeAllocSize(int64(cap(cached.OrderBy)) * int64(36)) } // field RoutingParameters *vitess.io/vitess/go/vt/vtgate/engine.RoutingParameters size += cached.RoutingParameters.CachedSize(true) diff --git a/go/vt/vtgate/engine/delete_test.go b/go/vt/vtgate/engine/delete_test.go index be67c7fc9e6..d8485765ca9 100644 --- a/go/vt/vtgate/engine/delete_test.go +++ b/go/vt/vtgate/engine/delete_test.go @@ -89,7 +89,7 @@ func TestDeleteEqual(t *testing.T) { }) // Failure case - expr := evalengine.NewBindVar("aa", evalengine.UnknownType()) + expr := evalengine.NewBindVar("aa", evalengine.Type{}) del.Values = []evalengine.Expr{expr} _, err = del.TryExecute(context.Background(), vc, map[string]*querypb.BindVariable{}, false) require.EqualError(t, err, "query arguments missing for aa") @@ -121,7 +121,7 @@ func TestDeleteEqualMultiCol(t *testing.T) { }) // Failure case - expr := evalengine.NewBindVar("aa", evalengine.UnknownType()) + expr := evalengine.NewBindVar("aa", evalengine.Type{}) del.Values = []evalengine.Expr{expr} _, err = del.TryExecute(context.Background(), vc, map[string]*querypb.BindVariable{}, false) require.EqualError(t, err, "query arguments missing for aa") diff --git a/go/vt/vtgate/engine/distinct.go b/go/vt/vtgate/engine/distinct.go index cd6b93a9f32..7e55138e27e 100644 --- a/go/vt/vtgate/engine/distinct.go +++ b/go/vt/vtgate/engine/distinct.go @@ -118,14 +118,14 @@ func (pt *probeTable) hashCodeForRow(inputRow sqltypes.Row) (evalengine.HashCode return 0, vterrors.VT13001("index out of range in row when creating the DISTINCT hash code") } col := inputRow[checkCol.Col] - hashcode, err := evalengine.NullsafeHashcode(col, checkCol.Type.Coll, col.Type()) + hashcode, err := evalengine.NullsafeHashcode(col, checkCol.Type.Collation(), col.Type()) if err != nil { if err != evalengine.UnsupportedCollationHashError || checkCol.WsCol == nil { return 0, err } checkCol = checkCol.SwitchToWeightString() pt.checkCols[i] = checkCol - hashcode, err = evalengine.NullsafeHashcode(inputRow[checkCol.Col], checkCol.Type.Coll, col.Type()) + hashcode, err = evalengine.NullsafeHashcode(inputRow[checkCol.Col], checkCol.Type.Collation(), col.Type()) if err != nil { return 0, err } @@ -137,7 +137,7 @@ func (pt *probeTable) hashCodeForRow(inputRow sqltypes.Row) (evalengine.HashCode func (pt *probeTable) equal(a, b sqltypes.Row) (bool, error) { for i, checkCol := range pt.checkCols { - cmp, err := evalengine.NullsafeCompare(a[i], b[i], checkCol.Type.Coll) + cmp, err := evalengine.NullsafeCompare(a[i], b[i], checkCol.Type.Collation()) if err != nil { _, isCollErr := err.(evalengine.UnsupportedCollationError) if !isCollErr || checkCol.WsCol == nil { @@ -145,7 +145,7 @@ func (pt *probeTable) equal(a, b sqltypes.Row) (bool, error) { } checkCol = checkCol.SwitchToWeightString() pt.checkCols[i] = checkCol - cmp, err = evalengine.NullsafeCompare(a[i], b[i], checkCol.Type.Coll) + cmp, err = evalengine.NullsafeCompare(a[i], b[i], checkCol.Type.Collation()) if err != nil { return false, err } @@ -274,14 +274,14 @@ func (cc CheckCol) SwitchToWeightString() CheckCol { return CheckCol{ Col: *cc.WsCol, WsCol: nil, - Type: evalengine.Type{Type: sqltypes.VarBinary, Coll: collations.CollationBinaryID}, + Type: evalengine.NewType(sqltypes.VarBinary, collations.CollationBinaryID), } } func (cc CheckCol) String() string { var collation string - if sqltypes.IsText(cc.Type.Type) && cc.Type.Coll != collations.Unknown { - collation = ": " + collations.Local().LookupName(cc.Type.Coll) + if sqltypes.IsText(cc.Type.Type()) && cc.Type.Collation() != collations.Unknown { + collation = ": " + collations.Local().LookupName(cc.Type.Collation()) } var column string diff --git a/go/vt/vtgate/engine/distinct_test.go b/go/vt/vtgate/engine/distinct_test.go index 65f8e5d430c..4ec3c1c0f4a 100644 --- a/go/vt/vtgate/engine/distinct_test.go +++ b/go/vt/vtgate/engine/distinct_test.go @@ -88,14 +88,9 @@ func TestDistinct(t *testing.T) { if sqltypes.IsNumber(tc.inputs.Fields[i].Type) { collID = collations.CollationBinaryID } - t := evalengine.Type{ - Type: tc.inputs.Fields[i].Type, - Coll: collID, - Nullable: false, - } checkCols = append(checkCols, CheckCol{ Col: i, - Type: t, + Type: evalengine.NewTypeEx(tc.inputs.Fields[i].Type, collID, false, 0, 0), }) } } @@ -140,7 +135,6 @@ func TestWeightStringFallBack(t *testing.T) { checkCols := []CheckCol{{ Col: 0, WsCol: &offsetOne, - Type: evalengine.UnknownType(), }} input := r("myid|weightstring(myid)", "varchar|varbinary", @@ -165,6 +159,5 @@ func TestWeightStringFallBack(t *testing.T) { utils.MustMatch(t, []CheckCol{{ Col: 0, WsCol: &offsetOne, - Type: evalengine.UnknownType(), }}, distinct.CheckCols, "checkCols should not be updated") } diff --git a/go/vt/vtgate/engine/hash_join_test.go b/go/vt/vtgate/engine/hash_join_test.go index c0a3075c6ad..7f7275a2c5c 100644 --- a/go/vt/vtgate/engine/hash_join_test.go +++ b/go/vt/vtgate/engine/hash_join_test.go @@ -140,8 +140,8 @@ func TestHashJoinVariations(t *testing.T) { Cols: []int{-1, -2, 1, 2}, LHSKey: tc.lhs, RHSKey: tc.rhs, - Collation: typ.Coll, - ComparisonType: typ.Type, + Collation: typ.Collation(), + ComparisonType: typ.Type(), } t.Run(tc.name, func(t *testing.T) { @@ -164,9 +164,9 @@ func TestHashJoinVariations(t *testing.T) { func typeForOffset(i int) evalengine.Type { switch i { case 0: - return evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID} + return evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID) case 1: - return evalengine.Type{Type: sqltypes.VarChar, Coll: collations.Default()} + return evalengine.NewType(sqltypes.VarChar, collations.Default()) default: panic(i) } diff --git a/go/vt/vtgate/engine/limit_test.go b/go/vt/vtgate/engine/limit_test.go index d5c6602f820..15bda20ace7 100644 --- a/go/vt/vtgate/engine/limit_test.go +++ b/go/vt/vtgate/engine/limit_test.go @@ -130,7 +130,7 @@ func TestLimitExecute(t *testing.T) { results: []*sqltypes.Result{inputResult}, } l = &Limit{ - Count: evalengine.NewBindVar("l", evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + Count: evalengine.NewBindVar("l", evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID)), Input: fp, } @@ -343,8 +343,8 @@ func TestLimitOffsetExecute(t *testing.T) { } l = &Limit{ - Count: evalengine.NewBindVar("l", evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), - Offset: evalengine.NewBindVar("o", evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + Count: evalengine.NewBindVar("l", evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID)), + Offset: evalengine.NewBindVar("o", evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID)), Input: fp, } result, err = l.TryExecute(context.Background(), &noopVCursor{}, map[string]*querypb.BindVariable{"l": sqltypes.Int64BindVariable(1), "o": sqltypes.Int64BindVariable(1)}, false) @@ -396,7 +396,7 @@ func TestLimitStreamExecute(t *testing.T) { // Test with bind vars. fp.rewind() - l.Count = evalengine.NewBindVar("l", evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}) + l.Count = evalengine.NewBindVar("l", evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID)) results = nil err = l.TryStreamExecute(context.Background(), &noopVCursor{}, map[string]*querypb.BindVariable{"l": sqltypes.Int64BindVariable(2)}, true, func(qr *sqltypes.Result) error { results = append(results, qr) @@ -540,7 +540,7 @@ func TestLimitInputFail(t *testing.T) { func TestLimitInvalidCount(t *testing.T) { l := &Limit{ - Count: evalengine.NewBindVar("l", evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + Count: evalengine.NewBindVar("l", evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID)), } _, _, err := l.getCountAndOffset(context.Background(), &noopVCursor{}, nil) assert.EqualError(t, err, "query arguments missing for l") diff --git a/go/vt/vtgate/engine/memory_sort_test.go b/go/vt/vtgate/engine/memory_sort_test.go index bc9369c57af..4f3d39ca851 100644 --- a/go/vt/vtgate/engine/memory_sort_test.go +++ b/go/vt/vtgate/engine/memory_sort_test.go @@ -75,7 +75,7 @@ func TestMemorySortExecute(t *testing.T) { utils.MustMatch(t, wantResult, result) fp.rewind() - ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}) + ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID)) bv := map[string]*querypb.BindVariable{"__upper_limit": sqltypes.Int64BindVariable(3)} result, err = ms.TryExecute(context.Background(), &noopVCursor{}, bv, false) @@ -136,7 +136,7 @@ func TestMemorySortStreamExecuteWeightString(t *testing.T) { t.Run("Limit test", func(t *testing.T) { fp.rewind() - ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}) + ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID)) bv := map[string]*querypb.BindVariable{"__upper_limit": sqltypes.Int64BindVariable(3)} results = nil @@ -194,7 +194,7 @@ func TestMemorySortExecuteWeightString(t *testing.T) { utils.MustMatch(t, wantResult, result) fp.rewind() - ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}) + ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID)) bv := map[string]*querypb.BindVariable{"__upper_limit": sqltypes.Int64BindVariable(3)} result, err = ms.TryExecute(context.Background(), &noopVCursor{}, bv, false) @@ -229,7 +229,7 @@ func TestMemorySortStreamExecuteCollation(t *testing.T) { ms := &MemorySort{ OrderBy: []evalengine.OrderByParams{{ Col: 0, - Type: evalengine.Type{Type: sqltypes.VarChar, Coll: collationID}, + Type: evalengine.NewType(sqltypes.VarChar, collationID), }}, Input: fp, } @@ -277,7 +277,7 @@ func TestMemorySortStreamExecuteCollation(t *testing.T) { t.Run("Limit test", func(t *testing.T) { fp.rewind() - ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}) + ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID)) bv := map[string]*querypb.BindVariable{"__upper_limit": sqltypes.Int64BindVariable(3)} results = nil @@ -317,7 +317,7 @@ func TestMemorySortExecuteCollation(t *testing.T) { ms := &MemorySort{ OrderBy: []evalengine.OrderByParams{{ Col: 0, - Type: evalengine.Type{Type: sqltypes.VarChar, Coll: collationID}, + Type: evalengine.NewType(sqltypes.VarChar, collationID), }}, Input: fp, } @@ -336,7 +336,7 @@ func TestMemorySortExecuteCollation(t *testing.T) { utils.MustMatch(t, wantResult, result) fp.rewind() - ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}) + ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID)) bv := map[string]*querypb.BindVariable{"__upper_limit": sqltypes.Int64BindVariable(3)} result, err = ms.TryExecute(context.Background(), &noopVCursor{}, bv, false) @@ -393,7 +393,7 @@ func TestMemorySortStreamExecute(t *testing.T) { utils.MustMatch(t, wantResults, results) fp.rewind() - ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}) + ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID)) bv := map[string]*querypb.BindVariable{"__upper_limit": sqltypes.Int64BindVariable(3)} results = nil @@ -552,7 +552,7 @@ func TestMemorySortMultiColumn(t *testing.T) { utils.MustMatch(t, wantResult, result) fp.rewind() - ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}) + ms.UpperLimit = evalengine.NewBindVar("__upper_limit", evalengine.NewType(sqltypes.Int64, collations.CollationBinaryID)) bv := map[string]*querypb.BindVariable{"__upper_limit": sqltypes.Int64BindVariable(3)} result, err = ms.TryExecute(context.Background(), &noopVCursor{}, bv, false) diff --git a/go/vt/vtgate/engine/merge_sort_test.go b/go/vt/vtgate/engine/merge_sort_test.go index 803c70ca463..93a443691c9 100644 --- a/go/vt/vtgate/engine/merge_sort_test.go +++ b/go/vt/vtgate/engine/merge_sort_test.go @@ -182,7 +182,7 @@ func TestMergeSortCollation(t *testing.T) { collationID, _ := collations.Local().LookupID("utf8mb4_hu_0900_ai_ci") orderBy := []evalengine.OrderByParams{{ Col: 0, - Type: evalengine.Type{Type: sqltypes.VarChar, Coll: collationID}, + Type: evalengine.NewType(sqltypes.VarChar, collationID), }} var results []*sqltypes.Result diff --git a/go/vt/vtgate/engine/ordered_aggregate.go b/go/vt/vtgate/engine/ordered_aggregate.go index 07ea06fa5fd..99393d8afc2 100644 --- a/go/vt/vtgate/engine/ordered_aggregate.go +++ b/go/vt/vtgate/engine/ordered_aggregate.go @@ -78,8 +78,8 @@ func (gbp GroupByParams) String() string { out = fmt.Sprintf("(%d|%d)", gbp.KeyCol, gbp.WeightStringCol) } - if sqltypes.IsText(gbp.Type.Type) && gbp.Type.Coll != collations.Unknown { - out += " COLLATE " + collations.Local().LookupName(gbp.Type.Coll) + if sqltypes.IsText(gbp.Type.Type()) && gbp.Type.Collation() != collations.Unknown { + out += " COLLATE " + collations.Local().LookupName(gbp.Type.Collation()) } return out @@ -348,14 +348,14 @@ func (oa *OrderedAggregate) nextGroupBy(currentKey, nextRow []sqltypes.Value) (n return nextRow, true, nil } - cmp, err := evalengine.NullsafeCompare(v1, v2, gb.Type.Coll) + cmp, err := evalengine.NullsafeCompare(v1, v2, gb.Type.Collation()) if err != nil { _, isCollationErr := err.(evalengine.UnsupportedCollationError) if !isCollationErr || gb.WeightStringCol == -1 { return nil, false, err } gb.KeyCol = gb.WeightStringCol - cmp, err = evalengine.NullsafeCompare(currentKey[gb.WeightStringCol], nextRow[gb.WeightStringCol], gb.Type.Coll) + cmp, err = evalengine.NullsafeCompare(currentKey[gb.WeightStringCol], nextRow[gb.WeightStringCol], gb.Type.Collation()) if err != nil { return nil, false, err } diff --git a/go/vt/vtgate/engine/ordered_aggregate_test.go b/go/vt/vtgate/engine/ordered_aggregate_test.go index 2eca4fc7ba9..f977e3b09dc 100644 --- a/go/vt/vtgate/engine/ordered_aggregate_test.go +++ b/go/vt/vtgate/engine/ordered_aggregate_test.go @@ -907,7 +907,7 @@ func TestOrderedAggregateCollate(t *testing.T) { collationID, _ := collationEnv.LookupID("utf8mb4_0900_ai_ci") oa := &OrderedAggregate{ Aggregates: []*AggregateParams{NewAggregateParam(AggregateSum, 1, "")}, - GroupByKeys: []*GroupByParams{{KeyCol: 0, Type: evalengine.Type{Coll: collationID}}}, + GroupByKeys: []*GroupByParams{{KeyCol: 0, Type: evalengine.NewType(sqltypes.Unknown, collationID)}}, Input: fp, } @@ -945,7 +945,7 @@ func TestOrderedAggregateCollateAS(t *testing.T) { collationID, _ := collationEnv.LookupID("utf8mb4_0900_as_ci") oa := &OrderedAggregate{ Aggregates: []*AggregateParams{NewAggregateParam(AggregateSum, 1, "")}, - GroupByKeys: []*GroupByParams{{KeyCol: 0, Type: evalengine.Type{Coll: collationID}}}, + GroupByKeys: []*GroupByParams{{KeyCol: 0, Type: evalengine.NewType(sqltypes.Unknown, collationID)}}, Input: fp, } @@ -985,7 +985,7 @@ func TestOrderedAggregateCollateKS(t *testing.T) { collationID, _ := collationEnv.LookupID("utf8mb4_ja_0900_as_cs_ks") oa := &OrderedAggregate{ Aggregates: []*AggregateParams{NewAggregateParam(AggregateSum, 1, "")}, - GroupByKeys: []*GroupByParams{{KeyCol: 0, Type: evalengine.Type{Coll: collationID}}}, + GroupByKeys: []*GroupByParams{{KeyCol: 0, Type: evalengine.NewType(sqltypes.Unknown, collationID)}}, Input: fp, } diff --git a/go/vt/vtgate/engine/projection.go b/go/vt/vtgate/engine/projection.go index e0055baa757..166dd88f477 100644 --- a/go/vt/vtgate/engine/projection.go +++ b/go/vt/vtgate/engine/projection.go @@ -149,14 +149,14 @@ func (p *Projection) evalFields(env *evalengine.ExpressionEnv, infields []*query if err != nil { return nil, err } - fl := mysql.FlagsForColumn(typ.Type, typ.Coll) - if !sqltypes.IsNull(typ.Type) && !typ.Nullable { + fl := mysql.FlagsForColumn(typ.Type(), typ.Collation()) + if !sqltypes.IsNull(typ.Type()) && !typ.Nullable() { fl |= uint32(querypb.MySqlFlag_NOT_NULL_FLAG) } fields = append(fields, &querypb.Field{ Name: col, - Type: typ.Type, - Charset: uint32(typ.Coll), + Type: typ.Type(), + Charset: uint32(typ.Collation()), Flags: fl, }) } diff --git a/go/vt/vtgate/engine/route_test.go b/go/vt/vtgate/engine/route_test.go index 54c7b5c6fb4..5a89aae8d5f 100644 --- a/go/vt/vtgate/engine/route_test.go +++ b/go/vt/vtgate/engine/route_test.go @@ -1077,7 +1077,7 @@ func TestRouteSortCollation(t *testing.T) { sel.OrderBy = []evalengine.OrderByParams{{ Col: 0, - Type: evalengine.Type{Type: sqltypes.VarChar, Coll: collationID}, + Type: evalengine.NewType(sqltypes.VarChar, collationID), }} vc := &loggingVCursor{ @@ -1142,8 +1142,7 @@ func TestRouteSortCollation(t *testing.T) { t.Run("Error when Unknown Collation", func(t *testing.T) { sel.OrderBy = []evalengine.OrderByParams{{ - Col: 0, - Type: evalengine.UnknownType(), + Col: 0, }} vc := &loggingVCursor{ @@ -1169,7 +1168,7 @@ func TestRouteSortCollation(t *testing.T) { t.Run("Error when Unsupported Collation", func(t *testing.T) { sel.OrderBy = []evalengine.OrderByParams{{ Col: 0, - Type: evalengine.Type{Coll: 1111}, + Type: evalengine.NewType(sqltypes.Unknown, 1111), }} vc := &loggingVCursor{ diff --git a/go/vt/vtgate/engine/set_test.go b/go/vt/vtgate/engine/set_test.go index 9245e9a618d..dbce162ff87 100644 --- a/go/vt/vtgate/engine/set_test.go +++ b/go/vt/vtgate/engine/set_test.go @@ -107,7 +107,7 @@ func TestSetTable(t *testing.T) { setOps: []SetOp{ &UserDefinedVariable{ Name: "x", - Expr: evalengine.NewColumn(0, evalengine.UnknownType(), nil), + Expr: evalengine.NewColumn(0, evalengine.Type{}, nil), }, }, qr: []*sqltypes.Result{sqltypes.MakeTestResult( diff --git a/go/vt/vtgate/engine/update_test.go b/go/vt/vtgate/engine/update_test.go index 22c2b90d60e..e2ee9d553d1 100644 --- a/go/vt/vtgate/engine/update_test.go +++ b/go/vt/vtgate/engine/update_test.go @@ -93,7 +93,7 @@ func TestUpdateEqual(t *testing.T) { }) // Failure case - upd.Values = []evalengine.Expr{evalengine.NewBindVar("aa", evalengine.UnknownType())} + upd.Values = []evalengine.Expr{evalengine.NewBindVar("aa", evalengine.Type{})} _, err = upd.TryExecute(context.Background(), vc, map[string]*querypb.BindVariable{}, false) require.EqualError(t, err, `query arguments missing for aa`) } diff --git a/go/vt/vtgate/evalengine/api_coerce.go b/go/vt/vtgate/evalengine/api_coerce.go index 5e92431e555..143d22ab78c 100644 --- a/go/vt/vtgate/evalengine/api_coerce.go +++ b/go/vt/vtgate/evalengine/api_coerce.go @@ -36,63 +36,63 @@ func CoerceTypes(v1, v2 Type) (out Type, err error) { if v1 == v2 { return v1, nil } - if sqltypes.IsNull(v1.Type) || sqltypes.IsNull(v2.Type) { - return Type{Type: sqltypes.Null, Coll: collations.CollationBinaryID, Nullable: true}, nil - } - fail := func() error { - return vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "types does not support hashcode yet: %v vs %v", v1.Type, v2.Type) + if sqltypes.IsNull(v1.Type()) || sqltypes.IsNull(v2.Type()) { + return NewType(sqltypes.Null, collations.CollationBinaryID), nil } - out = Type{Nullable: v1.Nullable || v2.Nullable} + out = Type{ + init: true, + nullable: v1.Nullable() || v2.Nullable(), + } switch { - case sqltypes.IsTextOrBinary(v1.Type) && sqltypes.IsTextOrBinary(v2.Type): - out.Type = sqltypes.VarChar - mergedCollation, _, _, ferr := mergeCollations(typedCoercionCollation(v1.Type, v1.Coll), typedCoercionCollation(v2.Type, v2.Coll), v1.Type, v2.Type) + case sqltypes.IsTextOrBinary(v1.Type()) && sqltypes.IsTextOrBinary(v2.Type()): + mergedCollation, _, _, ferr := mergeCollations(typedCoercionCollation(v1.Type(), v1.Collation()), typedCoercionCollation(v2.Type(), v2.Collation()), v1.Type(), v2.Type()) if err != nil { return Type{}, ferr } - out.Coll = mergedCollation.Collation + out.collation = mergedCollation.Collation + out.typ = sqltypes.VarChar return - case sqltypes.IsDateOrTime(v1.Type): - out.Coll = collations.CollationBinaryID - out.Type = v1.Type + case sqltypes.IsDateOrTime(v1.Type()): + out.collation = collations.CollationBinaryID + out.typ = v1.Type() return - case sqltypes.IsDateOrTime(v2.Type): - out.Coll = collations.CollationBinaryID - out.Type = v2.Type + case sqltypes.IsDateOrTime(v2.Type()): + out.collation = collations.CollationBinaryID + out.typ = v2.Type() return - case sqltypes.IsNumber(v1.Type) || sqltypes.IsNumber(v2.Type): - out.Coll = collations.CollationBinaryID + case sqltypes.IsNumber(v1.Type()) || sqltypes.IsNumber(v2.Type()): + out.collation = collations.CollationBinaryID switch { - case sqltypes.IsTextOrBinary(v1.Type) || sqltypes.IsFloat(v1.Type) || sqltypes.IsDecimal(v1.Type) || - sqltypes.IsTextOrBinary(v2.Type) || sqltypes.IsFloat(v2.Type) || sqltypes.IsDecimal(v2.Type): - out.Type = sqltypes.Float64 + case sqltypes.IsTextOrBinary(v1.Type()) || sqltypes.IsFloat(v1.Type()) || sqltypes.IsDecimal(v1.Type()) || + sqltypes.IsTextOrBinary(v2.Type()) || sqltypes.IsFloat(v2.Type()) || sqltypes.IsDecimal(v2.Type()): + out.typ = sqltypes.Float64 return - case sqltypes.IsSigned(v1.Type): + case sqltypes.IsSigned(v1.Type()): switch { - case sqltypes.IsUnsigned(v2.Type): - out.Type = sqltypes.Uint64 + case sqltypes.IsUnsigned(v2.Type()): + out.typ = sqltypes.Uint64 return - case sqltypes.IsSigned(v2.Type): - out.Type = sqltypes.Int64 + case sqltypes.IsSigned(v2.Type()): + out.typ = sqltypes.Int64 return default: - return Type{}, fail() + return Type{}, vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "cannot coerce SIGNED into %v", v2.Type()) } - case sqltypes.IsUnsigned(v1.Type): + case sqltypes.IsUnsigned(v1.Type()): switch { - case sqltypes.IsSigned(v2.Type) || sqltypes.IsUnsigned(v2.Type): - out.Type = sqltypes.Uint64 + case sqltypes.IsSigned(v2.Type()) || sqltypes.IsUnsigned(v2.Type()): + out.typ = sqltypes.Uint64 return default: - return Type{}, fail() + return Type{}, vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "cannot coerce UNSIGNED into %v", v2.Type()) } } } - return Type{}, fail() + return Type{}, vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "cannot coerce %v into %v", v1.Type(), v2.Type()) } diff --git a/go/vt/vtgate/evalengine/api_compare.go b/go/vt/vtgate/evalengine/api_compare.go index 1f30a17b9d5..b595c71a175 100644 --- a/go/vt/vtgate/evalengine/api_compare.go +++ b/go/vt/vtgate/evalengine/api_compare.go @@ -198,8 +198,8 @@ func (obp *OrderByParams) String() string { val += " ASC" } - if sqltypes.IsText(obp.Type.Type) && obp.Type.Coll != collations.Unknown { - val += " COLLATE " + collations.Local().LookupName(obp.Type.Coll) + if sqltypes.IsText(obp.Type.Type()) && obp.Type.Collation() != collations.Unknown { + val += " COLLATE " + collations.Local().LookupName(obp.Type.Collation()) } return val } @@ -211,7 +211,7 @@ func (obp *OrderByParams) Compare(r1, r2 []sqltypes.Value) int { if cmp == 0 { var err error - cmp, err = NullsafeCompare(v1, v2, obp.Type.Coll) + cmp, err = NullsafeCompare(v1, v2, obp.Type.Collation()) if err != nil { _, isCollationErr := err.(UnsupportedCollationError) if !isCollationErr || obp.WeightStringCol == -1 { @@ -220,7 +220,7 @@ func (obp *OrderByParams) Compare(r1, r2 []sqltypes.Value) int { // in case of a comparison or collation error switch to using the weight string column for ordering obp.Col = obp.WeightStringCol obp.WeightStringCol = -1 - cmp, err = NullsafeCompare(r1[obp.Col], r2[obp.Col], obp.Type.Coll) + cmp, err = NullsafeCompare(r1[obp.Col], r2[obp.Col], obp.Type.Collation()) if err != nil { panic(err) } @@ -236,7 +236,7 @@ func (obp *OrderByParams) Compare(r1, r2 []sqltypes.Value) int { func (cmp Comparison) tinyWeighters(fields []*querypb.Field) []tinyWeighter { weights := make([]tinyWeighter, 0, len(cmp)) for _, c := range cmp { - if apply := TinyWeighter(fields[c.Col], c.Type.Coll); apply != nil { + if apply := TinyWeighter(fields[c.Col], c.Type.Collation()); apply != nil { weights = append(weights, tinyWeighter{c.Col, apply}) } } diff --git a/go/vt/vtgate/evalengine/api_compare_test.go b/go/vt/vtgate/evalengine/api_compare_test.go index 3f97d9d18e9..4da234edbc4 100644 --- a/go/vt/vtgate/evalengine/api_compare_test.go +++ b/go/vt/vtgate/evalengine/api_compare_test.go @@ -110,7 +110,7 @@ func TestCompareIntegers(t *testing.T) { tests := []testCase{ { name: "integers are equal (1)", - v1: newColumn(0, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), v2: newColumn(0, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Int64, collations.CollationBinaryID)), v2: newColumn(0, NewType(sqltypes.Int64, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewInt64(18)}, }, @@ -131,25 +131,25 @@ func TestCompareIntegers(t *testing.T) { }, { name: "integers are not equal (3)", - v1: newColumn(0, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Int64, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Int64, collations.CollationBinaryID)), out: &F, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewInt64(18), sqltypes.NewInt64(98)}, }, { name: "unsigned integers are equal", - v1: newColumn(0, Type{Type: sqltypes.Uint64, Coll: collations.CollationBinaryID}), v2: newColumn(0, Type{Type: sqltypes.Uint64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Uint64, collations.CollationBinaryID)), v2: newColumn(0, NewType(sqltypes.Uint64, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewUint64(18)}, }, { name: "unsigned integer and integer are equal", - v1: newColumn(0, Type{Type: sqltypes.Uint64, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Uint64, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Int64, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewUint64(18), sqltypes.NewInt64(18)}, }, { name: "unsigned integer and integer are not equal", - v1: newColumn(0, Type{Type: sqltypes.Uint64, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Uint64, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Int64, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewUint64(18), sqltypes.NewInt64(42)}, }, @@ -207,7 +207,7 @@ func TestCompareFloats(t *testing.T) { tests := []testCase{ { name: "floats are equal (1)", - v1: newColumn(0, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), v2: newColumn(0, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Float64, collations.CollationBinaryID)), v2: newColumn(0, NewType(sqltypes.Float64, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewFloat64(18)}, }, @@ -228,7 +228,7 @@ func TestCompareFloats(t *testing.T) { }, { name: "floats are not equal (3)", - v1: newColumn(0, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Float64, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Float64, collations.CollationBinaryID)), out: &F, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewFloat64(16516.84), sqltypes.NewFloat64(219541.01)}, }, @@ -286,37 +286,37 @@ func TestCompareDecimals(t *testing.T) { tests := []testCase{ { name: "decimals are equal", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewDecimal("12.9019")}, }, { name: "decimals are not equal", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Decimal, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewDecimal("12.9019"), sqltypes.NewDecimal("489.156849")}, }, { name: "decimal is greater than decimal", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Decimal, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewDecimal("192.129"), sqltypes.NewDecimal("192.128")}, }, { name: "decimal is not greater than decimal", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Decimal, collations.CollationBinaryID)), out: &F, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewDecimal("192.128"), sqltypes.NewDecimal("192.129")}, }, { name: "decimal is less than decimal", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Decimal, collations.CollationBinaryID)), out: &T, op: sqlparser.LessThanOp, row: []sqltypes.Value{sqltypes.NewDecimal("192.128"), sqltypes.NewDecimal("192.129")}, }, { name: "decimal is not less than decimal", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Decimal, collations.CollationBinaryID)), out: &F, op: sqlparser.LessThanOp, row: []sqltypes.Value{sqltypes.NewDecimal("192.129"), sqltypes.NewDecimal("192.128")}, }, @@ -334,151 +334,151 @@ func TestCompareNumerics(t *testing.T) { tests := []testCase{ { name: "decimal and float are equal", - v1: newColumn(0, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Float64, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Decimal, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewFloat64(189.6), sqltypes.NewDecimal("189.6")}, }, { name: "decimal and float with negative values are equal", - v1: newColumn(0, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Float64, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Decimal, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewFloat64(-98.1839), sqltypes.NewDecimal("-98.1839")}, }, { name: "decimal and float with negative values are not equal (1)", - v1: newColumn(0, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Float64, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Decimal, collations.CollationBinaryID)), out: &F, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewFloat64(-98.9381), sqltypes.NewDecimal("-98.1839")}, }, { name: "decimal and float with negative values are not equal (2)", - v1: newColumn(0, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Float64, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Decimal, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewFloat64(-98.9381), sqltypes.NewDecimal("-98.1839")}, }, { name: "decimal and integer are equal (1)", - v1: newColumn(0, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Int64, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Decimal, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewInt64(8979), sqltypes.NewDecimal("8979")}, }, { name: "decimal and integer are equal (2)", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Int64, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewDecimal("8979.0000"), sqltypes.NewInt64(8979)}, }, { name: "decimal and unsigned integer are equal (1)", - v1: newColumn(0, Type{Type: sqltypes.Uint64, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Uint64, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Decimal, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewUint64(901), sqltypes.NewDecimal("901")}, }, { name: "decimal and unsigned integer are equal (2)", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Uint64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Uint64, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewDecimal("901.00"), sqltypes.NewUint64(901)}, }, { name: "decimal and unsigned integer are not equal (1)", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Uint64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Uint64, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewDecimal("192.129"), sqltypes.NewUint64(192)}, }, { name: "decimal and unsigned integer are not equal (2)", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Uint64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Uint64, collations.CollationBinaryID)), out: &F, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewDecimal("192.129"), sqltypes.NewUint64(192)}, }, { name: "decimal is greater than integer", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Int64, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewDecimal("1.01"), sqltypes.NewInt64(1)}, }, { name: "decimal is greater-equal to integer", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Int64, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterEqualOp, row: []sqltypes.Value{sqltypes.NewDecimal("1.00"), sqltypes.NewInt64(1)}, }, { name: "decimal is less than integer", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Int64, collations.CollationBinaryID)), out: &T, op: sqlparser.LessThanOp, row: []sqltypes.Value{sqltypes.NewDecimal(".99"), sqltypes.NewInt64(1)}, }, { name: "decimal is less-equal to integer", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Int64, collations.CollationBinaryID)), out: &T, op: sqlparser.LessEqualOp, row: []sqltypes.Value{sqltypes.NewDecimal("1.00"), sqltypes.NewInt64(1)}, }, { name: "decimal is greater than float", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Float64, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewDecimal("849.896"), sqltypes.NewFloat64(86.568)}, }, { name: "decimal is not greater than float", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Float64, collations.CollationBinaryID)), out: &F, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewDecimal("15.23"), sqltypes.NewFloat64(8689.5)}, }, { name: "decimal is greater-equal to float (1)", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Float64, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterEqualOp, row: []sqltypes.Value{sqltypes.NewDecimal("65"), sqltypes.NewFloat64(65)}, }, { name: "decimal is greater-equal to float (2)", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Float64, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterEqualOp, row: []sqltypes.Value{sqltypes.NewDecimal("65"), sqltypes.NewFloat64(60)}, }, { name: "decimal is less than float", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Float64, collations.CollationBinaryID)), out: &T, op: sqlparser.LessThanOp, row: []sqltypes.Value{sqltypes.NewDecimal("0.998"), sqltypes.NewFloat64(0.999)}, }, { name: "decimal is less-equal to float", - v1: newColumn(0, Type{Type: sqltypes.Decimal, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Float64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Decimal, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Float64, collations.CollationBinaryID)), out: &T, op: sqlparser.LessEqualOp, row: []sqltypes.Value{sqltypes.NewDecimal("1.000101"), sqltypes.NewFloat64(1.00101)}, }, { name: "different int types are equal for 8 bit", - v1: newColumn(0, Type{Type: sqltypes.Int8, Coll: collations.CollationBinaryID}), v2: NewLiteralInt(0), + v1: newColumn(0, NewType(sqltypes.Int8, collations.CollationBinaryID)), v2: NewLiteralInt(0), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewInt8(0)}, }, { name: "different int types are equal for 32 bit", - v1: newColumn(0, Type{Type: sqltypes.Int32, Coll: collations.CollationBinaryID}), v2: NewLiteralInt(0), + v1: newColumn(0, NewType(sqltypes.Int32, collations.CollationBinaryID)), v2: NewLiteralInt(0), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewInt32(0)}, }, { name: "different int types are equal for float32 bit", - v1: newColumn(0, Type{Type: sqltypes.Float32, Coll: collations.CollationBinaryID}), v2: NewLiteralFloat(1.0), + v1: newColumn(0, NewType(sqltypes.Float32, collations.CollationBinaryID)), v2: NewLiteralFloat(1.0), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.MakeTrusted(sqltypes.Float32, []byte("1.0"))}, }, { name: "different unsigned int types are equal for 8 bit", - v1: newColumn(0, Type{Type: sqltypes.Uint8, Coll: collations.CollationBinaryID}), v2: NewLiteralInt(0), + v1: newColumn(0, NewType(sqltypes.Uint8, collations.CollationBinaryID)), v2: NewLiteralInt(0), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.MakeTrusted(sqltypes.Uint8, []byte("0"))}, }, { name: "different unsigned int types are equal for 32 bit", - v1: newColumn(0, Type{Type: sqltypes.Uint32, Coll: collations.CollationBinaryID}), v2: NewLiteralInt(0), + v1: newColumn(0, NewType(sqltypes.Uint32, collations.CollationBinaryID)), v2: NewLiteralInt(0), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewUint32(0)}, }, @@ -496,73 +496,73 @@ func TestCompareDatetime(t *testing.T) { tests := []testCase{ { name: "datetimes are equal", - v1: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), v2: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), v2: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewDatetime("2021-10-22 12:00:00")}, }, { name: "datetimes are not equal (1)", - v1: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &F, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewDatetime("2021-10-22 12:00:00"), sqltypes.NewDatetime("2020-10-22 12:00:00")}, }, { name: "datetimes are not equal (2)", - v1: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &F, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewDatetime("2021-10-22 12:00:00"), sqltypes.NewDatetime("2021-10-22 10:23:56")}, }, { name: "datetimes are not equal (3)", - v1: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewDatetime("2021-10-01 00:00:00"), sqltypes.NewDatetime("2021-02-01 00:00:00")}, }, { name: "datetime is greater than datetime", - v1: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewDatetime("2021-10-30 10:42:50"), sqltypes.NewDatetime("2021-10-01 13:10:02")}, }, { name: "datetime is not greater than datetime", - v1: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &F, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewDatetime("2021-10-01 13:10:02"), sqltypes.NewDatetime("2021-10-30 10:42:50")}, }, { name: "datetime is less than datetime", - v1: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.LessThanOp, row: []sqltypes.Value{sqltypes.NewDatetime("2021-10-01 13:10:02"), sqltypes.NewDatetime("2021-10-30 10:42:50")}, }, { name: "datetime is not less than datetime", - v1: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &F, op: sqlparser.LessThanOp, row: []sqltypes.Value{sqltypes.NewDatetime("2021-10-30 10:42:50"), sqltypes.NewDatetime("2021-10-01 13:10:02")}, }, { name: "datetime is greater-equal to datetime (1)", - v1: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterEqualOp, row: []sqltypes.Value{sqltypes.NewDatetime("2021-10-30 10:42:50"), sqltypes.NewDatetime("2021-10-30 10:42:50")}, }, { name: "datetime is greater-equal to datetime (2)", - v1: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterEqualOp, row: []sqltypes.Value{sqltypes.NewDatetime("2021-10-30 10:42:50"), sqltypes.NewDatetime("2021-10-01 13:10:02")}, }, { name: "datetime is less-equal to datetime (1)", - v1: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.LessEqualOp, row: []sqltypes.Value{sqltypes.NewDatetime("2021-10-30 10:42:50"), sqltypes.NewDatetime("2021-10-30 10:42:50")}, }, { name: "datetime is less-equal to datetime (2)", - v1: newColumn(0, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Datetime, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.LessEqualOp, row: []sqltypes.Value{sqltypes.NewDatetime("2021-10-01 13:10:02"), sqltypes.NewDatetime("2021-10-30 10:42:50")}, }, @@ -580,73 +580,73 @@ func TestCompareTimestamp(t *testing.T) { tests := []testCase{ { name: "timestamps are equal", - v1: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), v2: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), v2: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewTimestamp("2021-10-22 12:00:00")}, }, { name: "timestamps are not equal (1)", - v1: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &F, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewTimestamp("2021-10-22 12:00:00"), sqltypes.NewTimestamp("2020-10-22 12:00:00")}, }, { name: "timestamps are not equal (2)", - v1: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &F, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewTimestamp("2021-10-22 12:00:00"), sqltypes.NewTimestamp("2021-10-22 10:23:56")}, }, { name: "timestamps are not equal (3)", - v1: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewTimestamp("2021-10-01 00:00:00"), sqltypes.NewTimestamp("2021-02-01 00:00:00")}, }, { name: "timestamp is greater than timestamp", - v1: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewTimestamp("2021-10-30 10:42:50"), sqltypes.NewTimestamp("2021-10-01 13:10:02")}, }, { name: "timestamp is not greater than timestamp", - v1: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &F, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewTimestamp("2021-10-01 13:10:02"), sqltypes.NewTimestamp("2021-10-30 10:42:50")}, }, { name: "timestamp is less than timestamp", - v1: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &T, op: sqlparser.LessThanOp, row: []sqltypes.Value{sqltypes.NewTimestamp("2021-10-01 13:10:02"), sqltypes.NewTimestamp("2021-10-30 10:42:50")}, }, { name: "timestamp is not less than timestamp", - v1: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &F, op: sqlparser.LessThanOp, row: []sqltypes.Value{sqltypes.NewTimestamp("2021-10-30 10:42:50"), sqltypes.NewTimestamp("2021-10-01 13:10:02")}, }, { name: "timestamp is greater-equal to timestamp (1)", - v1: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterEqualOp, row: []sqltypes.Value{sqltypes.NewTimestamp("2021-10-30 10:42:50"), sqltypes.NewTimestamp("2021-10-30 10:42:50")}, }, { name: "timestamp is greater-equal to timestamp (2)", - v1: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterEqualOp, row: []sqltypes.Value{sqltypes.NewTimestamp("2021-10-30 10:42:50"), sqltypes.NewTimestamp("2021-10-01 13:10:02")}, }, { name: "timestamp is less-equal to timestamp (1)", - v1: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &T, op: sqlparser.LessEqualOp, row: []sqltypes.Value{sqltypes.NewTimestamp("2021-10-30 10:42:50"), sqltypes.NewTimestamp("2021-10-30 10:42:50")}, }, { name: "timestamp is less-equal to timestamp (2)", - v1: newColumn(0, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &T, op: sqlparser.LessEqualOp, row: []sqltypes.Value{sqltypes.NewTimestamp("2021-10-01 13:10:02"), sqltypes.NewTimestamp("2021-10-30 10:42:50")}, }, @@ -668,67 +668,67 @@ func TestCompareDate(t *testing.T) { tests := []testCase{ { name: "dates are equal", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-22")}, }, { name: "dates are not equal (1)", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &F, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-22"), sqltypes.NewDate("2020-10-21")}, }, { name: "dates are not equal (2)", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-01"), sqltypes.NewDate("2021-02-01")}, }, { name: "date is greater than date", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-30"), sqltypes.NewDate("2021-10-01")}, }, { name: "date is not greater than date", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &F, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-01"), sqltypes.NewDate("2021-10-30")}, }, { name: "date is less than date", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &T, op: sqlparser.LessThanOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-01"), sqltypes.NewDate("2021-10-30")}, }, { name: "date is not less than date", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &F, op: sqlparser.LessThanOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-30"), sqltypes.NewDate("2021-10-01")}, }, { name: "date is greater-equal to date (1)", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterEqualOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-30"), sqltypes.NewDate("2021-10-30")}, }, { name: "date is greater-equal to date (2)", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterEqualOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-30"), sqltypes.NewDate("2021-10-01")}, }, { name: "date is less-equal to date (1)", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &T, op: sqlparser.LessEqualOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-30"), sqltypes.NewDate("2021-10-30")}, }, { name: "date is less-equal to date (2)", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &T, op: sqlparser.LessEqualOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-01"), sqltypes.NewDate("2021-10-30")}, }, @@ -746,79 +746,79 @@ func TestCompareTime(t *testing.T) { tests := []testCase{ { name: "times are equal", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewTime("12:00:00")}, }, { name: "times are not equal (1)", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &F, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewTime("12:00:00"), sqltypes.NewTime("10:23:56")}, }, { name: "times are not equal (2)", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewTime("00:00:00"), sqltypes.NewTime("10:15:00")}, }, { name: "time is greater than time", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewTime("18:14:35"), sqltypes.NewTime("13:01:38")}, }, { name: "time is not greater than time", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &F, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewTime("02:46:02"), sqltypes.NewTime("10:42:50")}, }, { name: "time is greater than time", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewTime("101:14:35"), sqltypes.NewTime("13:01:38")}, }, { name: "time is not greater than time", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &F, op: sqlparser.GreaterThanOp, row: []sqltypes.Value{sqltypes.NewTime("24:46:02"), sqltypes.NewTime("101:42:50")}, }, { name: "time is less than time", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &T, op: sqlparser.LessThanOp, row: []sqltypes.Value{sqltypes.NewTime("04:30:00"), sqltypes.NewTime("09:23:48")}, }, { name: "time is not less than time", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &F, op: sqlparser.LessThanOp, row: []sqltypes.Value{sqltypes.NewTime("15:21:00"), sqltypes.NewTime("10:00:00")}, }, { name: "time is greater-equal to time (1)", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterEqualOp, row: []sqltypes.Value{sqltypes.NewTime("10:42:50"), sqltypes.NewTime("10:42:50")}, }, { name: "time is greater-equal to time (2)", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &T, op: sqlparser.GreaterEqualOp, row: []sqltypes.Value{sqltypes.NewTime("19:42:50"), sqltypes.NewTime("13:10:02")}, }, { name: "time is less-equal to time (1)", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &T, op: sqlparser.LessEqualOp, row: []sqltypes.Value{sqltypes.NewTime("10:42:50"), sqltypes.NewTime("10:42:50")}, }, { name: "time is less-equal to time (2)", - v1: newColumn(0, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Time, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &T, op: sqlparser.LessEqualOp, row: []sqltypes.Value{sqltypes.NewTime("10:10:02"), sqltypes.NewTime("10:42:50")}, }, @@ -836,13 +836,13 @@ func TestCompareDates(t *testing.T) { tests := []testCase{ { name: "date equal datetime", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-22"), sqltypes.NewDatetime("2021-10-22 00:00:00")}, }, { name: "date equal datetime through bind variables", - v1: NewBindVar("k1", Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: NewBindVar("k2", Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: NewBindVar("k1", NewType(sqltypes.Date, collations.CollationBinaryID)), v2: NewBindVar("k2", NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, bv: map[string]*querypb.BindVariable{ "k1": {Type: sqltypes.Date, Value: []byte("2021-10-22")}, @@ -851,7 +851,7 @@ func TestCompareDates(t *testing.T) { }, { name: "date not equal datetime through bind variables", - v1: NewBindVar("k1", Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: NewBindVar("k2", Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: NewBindVar("k1", NewType(sqltypes.Date, collations.CollationBinaryID)), v2: NewBindVar("k2", NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, bv: map[string]*querypb.BindVariable{ "k1": {Type: sqltypes.Date, Value: []byte("2021-02-20")}, @@ -860,73 +860,73 @@ func TestCompareDates(t *testing.T) { }, { name: "date not equal datetime", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-22"), sqltypes.NewDatetime("2021-10-20 00:06:00")}, }, { name: "date equal timestamp", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-22"), sqltypes.NewTimestamp("2021-10-22 00:00:00")}, }, { name: "date not equal timestamp", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewDate("2021-10-22"), sqltypes.NewTimestamp("2021-10-22 16:00:00")}, }, { name: "date equal time", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &F, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewDate(time.Now().Format("2006-01-02")), sqltypes.NewTime("00:00:00")}, }, { name: "date not equal time", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewDate(time.Now().Format("2006-01-02")), sqltypes.NewTime("12:00:00")}, }, { name: "string equal datetime", - v1: newColumn(0, Type{Type: sqltypes.VarChar, Coll: collations.CollationUtf8mb4ID}), v2: newColumn(1, Type{Type: sqltypes.Datetime, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.VarChar, collations.CollationUtf8mb4ID)), v2: newColumn(1, NewType(sqltypes.Datetime, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewVarChar("2021-10-22"), sqltypes.NewDatetime("2021-10-22 00:00:00")}, }, { name: "string equal timestamp", - v1: newColumn(0, Type{Type: sqltypes.VarChar, Coll: collations.CollationUtf8mb4ID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.VarChar, collations.CollationUtf8mb4ID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewVarChar("2021-10-22 00:00:00"), sqltypes.NewTimestamp("2021-10-22 00:00:00")}, }, { name: "string not equal timestamp", - v1: newColumn(0, Type{Type: sqltypes.VarChar, Coll: collations.CollationUtf8mb4ID}), v2: newColumn(1, Type{Type: sqltypes.Timestamp, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.VarChar, collations.CollationUtf8mb4ID)), v2: newColumn(1, NewType(sqltypes.Timestamp, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewVarChar("2021-10-22 06:00:30"), sqltypes.NewTimestamp("2021-10-20 15:02:10")}, }, { name: "string equal time", - v1: newColumn(0, Type{Type: sqltypes.VarChar, Coll: collations.CollationUtf8mb4ID}), v2: newColumn(1, Type{Type: sqltypes.Time, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.VarChar, collations.CollationUtf8mb4ID)), v2: newColumn(1, NewType(sqltypes.Time, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewVarChar("00:05:12"), sqltypes.NewTime("00:05:12")}, }, { name: "string equal date", - v1: newColumn(0, Type{Type: sqltypes.VarChar, Coll: collations.CollationUtf8mb4ID}), v2: newColumn(1, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.VarChar, collations.CollationUtf8mb4ID)), v2: newColumn(1, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewVarChar("2021-02-22"), sqltypes.NewDate("2021-02-22")}, }, { name: "string not equal date (1, date on the RHS)", - v1: newColumn(0, Type{Type: sqltypes.VarChar, Coll: collations.CollationUtf8mb4ID}), v2: newColumn(1, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.VarChar, collations.CollationUtf8mb4ID)), v2: newColumn(1, NewType(sqltypes.Date, collations.CollationBinaryID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewVarChar("2021-02-20"), sqltypes.NewDate("2021-03-30")}, }, { name: "string not equal date (2, date on the LHS)", - v1: newColumn(0, Type{Type: sqltypes.Date, Coll: collations.CollationBinaryID}), v2: newColumn(1, Type{Type: sqltypes.VarChar, Coll: collations.CollationUtf8mb4ID}), + v1: newColumn(0, NewType(sqltypes.Date, collations.CollationBinaryID)), v2: newColumn(1, NewType(sqltypes.VarChar, collations.CollationUtf8mb4ID)), out: &T, op: sqlparser.NotEqualOp, row: []sqltypes.Value{sqltypes.NewDate("2021-03-30"), sqltypes.NewVarChar("2021-02-20")}, }, @@ -944,13 +944,13 @@ func TestCompareStrings(t *testing.T) { tests := []testCase{ { name: "string equal string", - v1: newColumn(0, Type{Type: sqltypes.VarChar, Coll: collations.Default()}), v2: newColumn(1, Type{Type: sqltypes.VarChar, Coll: collations.Default()}), + v1: newColumn(0, NewType(sqltypes.VarChar, collations.Default())), v2: newColumn(1, NewType(sqltypes.VarChar, collations.Default())), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewVarChar("toto"), sqltypes.NewVarChar("toto")}, }, { name: "string equal number", - v1: newColumn(0, Type{Type: sqltypes.VarChar, Coll: collations.Default()}), v2: newColumn(1, Type{Type: sqltypes.Int64, Coll: collations.CollationBinaryID}), + v1: newColumn(0, NewType(sqltypes.VarChar, collations.Default())), v2: newColumn(1, NewType(sqltypes.Int64, collations.CollationBinaryID)), out: &T, op: sqlparser.EqualOp, row: []sqltypes.Value{sqltypes.NewVarChar("1"), sqltypes.NewInt64(1)}, }, @@ -1341,30 +1341,30 @@ func TestCompareSorter(t *testing.T) { Count: 100, Limit: 10, Random: sqltypes.RandomGenerators[sqltypes.Int64], - Cmp: Comparison{{Col: 0, Desc: false, Type: Type{Type: sqltypes.Int64}}}, + Cmp: Comparison{{Col: 0, Desc: false, Type: NewType(sqltypes.Int64, collations.Unknown)}}, }, { Count: 100, Limit: 10, Random: sqltypes.RandomGenerators[sqltypes.Int64], - Cmp: Comparison{{Col: 0, Desc: true, Type: Type{Type: sqltypes.Int64}}}, + Cmp: Comparison{{Col: 0, Desc: true, Type: NewType(sqltypes.Int64, collations.Unknown)}}, }, { Count: 100, Limit: math.MaxInt, Random: sqltypes.RandomGenerators[sqltypes.Int64], - Cmp: Comparison{{Col: 0, Desc: false, Type: Type{Type: sqltypes.Int64}}}, + Cmp: Comparison{{Col: 0, Desc: false, Type: NewType(sqltypes.Int64, collations.Unknown)}}, }, { Count: 100, Limit: math.MaxInt, Random: sqltypes.RandomGenerators[sqltypes.Int64], - Cmp: Comparison{{Col: 0, Desc: true, Type: Type{Type: sqltypes.Int64}}}, + Cmp: Comparison{{Col: 0, Desc: true, Type: NewType(sqltypes.Int64, collations.Unknown)}}, }, } for _, tc := range cases { - t.Run(fmt.Sprintf("%s-%d-%d", tc.Cmp[0].Type.Type, tc.Count, tc.Limit), func(t *testing.T) { + t.Run(fmt.Sprintf("%s-%d-%d", tc.Cmp[0].Type.Type(), tc.Count, tc.Limit), func(t *testing.T) { unsorted := make([]sqltypes.Row, 0, tc.Count) for i := 0; i < tc.Count; i++ { unsorted = append(unsorted, []sqltypes.Value{tc.Random()}) diff --git a/go/vt/vtgate/evalengine/api_literal.go b/go/vt/vtgate/evalengine/api_literal.go index f12988233e8..64d0cf5c1c3 100644 --- a/go/vt/vtgate/evalengine/api_literal.go +++ b/go/vt/vtgate/evalengine/api_literal.go @@ -203,8 +203,8 @@ func NewLiteralBinaryFromBit(val []byte) (*Literal, error) { func NewBindVar(key string, typ Type) *BindVariable { return &BindVariable{ Key: key, - Type: typ.Type, - Collation: typ.Coll, + Type: typ.Type(), + Collation: typ.Collation(), dynamicTypeOffset: -1, } } @@ -222,9 +222,12 @@ func NewBindVarTuple(key string, coll collations.ID) *BindVariable { func NewColumn(offset int, typ Type, original sqlparser.Expr) *Column { return &Column{ Offset: offset, - Type: typ.Type, - Collation: typedCoercionCollation(typ.Type, typ.Coll), + Type: typ.Type(), + Size: typ.size, + Scale: typ.scale, + Collation: typedCoercionCollation(typ.Type(), typ.Collation()), Original: original, + Nullable: typ.nullable, dynamicTypeOffset: -1, } } diff --git a/go/vt/vtgate/evalengine/cached_size.go b/go/vt/vtgate/evalengine/cached_size.go index d227af1a237..b0860f0b9e3 100644 --- a/go/vt/vtgate/evalengine/cached_size.go +++ b/go/vt/vtgate/evalengine/cached_size.go @@ -157,7 +157,7 @@ func (cached *Column) CachedSize(alloc bool) int64 { } size := int64(0) if alloc { - size += int64(48) + size += int64(64) } // field Original vitess.io/vitess/go/vt/sqlparser.Expr if cc, ok := cached.Original.(cachedObject); ok { @@ -187,7 +187,7 @@ func (cached *CompiledExpr) CachedSize(alloc bool) int64 { } size := int64(0) if alloc { - size += int64(64) + size += int64(80) } // field code []vitess.io/vitess/go/vt/vtgate/evalengine.frame { @@ -1786,7 +1786,7 @@ func (cached *typedExpr) CachedSize(alloc bool) int64 { } // field types []vitess.io/vitess/go/vt/vtgate/evalengine.ctype { - size += hack.RuntimeAllocSize(int64(cap(cached.types)) * int64(10)) + size += hack.RuntimeAllocSize(int64(cap(cached.types)) * int64(20)) } // field compiled *vitess.io/vitess/go/vt/vtgate/evalengine.CompiledExpr size += cached.compiled.CachedSize(true) diff --git a/go/vt/vtgate/evalengine/compiler.go b/go/vt/vtgate/evalengine/compiler.go index 1c2feeb5f15..e7d0e962fab 100644 --- a/go/vt/vtgate/evalengine/compiler.go +++ b/go/vt/vtgate/evalengine/compiler.go @@ -47,19 +47,64 @@ type compiledCoercion struct { } type ctype struct { - Type sqltypes.Type - Flag typeFlag - Col collations.TypedCollation + Type sqltypes.Type + Flag typeFlag + Size, Scale int32 + Col collations.TypedCollation } type Type struct { - Type sqltypes.Type - Coll collations.ID - Nullable bool + typ sqltypes.Type + collation collations.ID + nullable bool + init bool + size, scale int32 } -func UnknownType() Type { - return Type{Type: sqltypes.Unknown, Coll: collations.Unknown} +func NewType(t sqltypes.Type, collation collations.ID) Type { + // New types default to being nullable + return NewTypeEx(t, collation, true, 0, 0) +} + +func NewTypeEx(t sqltypes.Type, collation collations.ID, nullable bool, size, scale int32) Type { + return Type{ + typ: t, + collation: collation, + nullable: nullable, + init: true, + size: size, + scale: scale, + } +} + +func (t *Type) Type() sqltypes.Type { + if t.init { + return t.typ + } + return sqltypes.Unknown +} + +func (t *Type) Collation() collations.ID { + return t.collation +} + +func (t *Type) Size() int32 { + return t.size +} + +func (t *Type) Scale() int32 { + return t.scale +} + +func (t *Type) Nullable() bool { + if t.init { + return t.nullable + } + return true // nullable by default for unknown types +} + +func (t *Type) Valid() bool { + return t.init } func (ct ctype) nullable() bool { @@ -102,36 +147,36 @@ func (c *compiler) compileToNumeric(ct ctype, offset int, fallback sqltypes.Type if ct.Type == sqltypes.VarBinary { if (ct.Flag & flagHex) != 0 { c.asm.Convert_hex(offset) - return ctype{sqltypes.Uint64, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Uint64, Flag: ct.Flag, Col: collationNumeric} } if (ct.Flag & flagBit) != 0 { c.asm.Convert_bit(offset) - return ctype{sqltypes.Int64, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Int64, Flag: ct.Flag, Col: collationNumeric} } } if sqltypes.IsDateOrTime(ct.Type) { if preciseDatetime { c.asm.Convert_Ti(offset) - return ctype{sqltypes.Int64, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Int64, Flag: ct.Flag, Col: collationNumeric} } c.asm.Convert_Tf(offset) - return ctype{sqltypes.Float64, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Float64, Flag: ct.Flag, Col: collationNumeric} } switch fallback { case sqltypes.Int64: c.asm.Convert_xi(offset) - return ctype{sqltypes.Int64, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Int64, Flag: ct.Flag, Col: collationNumeric} case sqltypes.Uint64: c.asm.Convert_xu(offset) - return ctype{sqltypes.Uint64, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Uint64, Flag: ct.Flag, Col: collationNumeric} case sqltypes.Decimal: c.asm.Convert_xd(offset, 0, 0) - return ctype{sqltypes.Decimal, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Decimal, Flag: ct.Flag, Col: collationNumeric} } c.asm.Convert_xf(offset) - return ctype{sqltypes.Float64, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Float64, Flag: ct.Flag, Col: collationNumeric} } func (c *compiler) compileToInt64(ct ctype, offset int) ctype { @@ -144,7 +189,7 @@ func (c *compiler) compileToInt64(ct ctype, offset int) ctype { default: c.asm.Convert_xi(offset) } - return ctype{sqltypes.Int64, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Int64, Flag: ct.Flag, Col: collationNumeric} } func (c *compiler) compileToUint64(ct ctype, offset int) ctype { @@ -157,7 +202,7 @@ func (c *compiler) compileToUint64(ct ctype, offset int) ctype { default: c.asm.Convert_xu(offset) } - return ctype{sqltypes.Uint64, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Uint64, Flag: ct.Flag, Col: collationNumeric} } func (c *compiler) compileToBitwiseUint64(ct ctype, offset int) ctype { @@ -172,7 +217,7 @@ func (c *compiler) compileToBitwiseUint64(ct ctype, offset int) ctype { default: c.asm.Convert_xu(offset) } - return ctype{sqltypes.Uint64, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Uint64, Flag: ct.Flag, Col: collationNumeric} } func (c *compiler) compileToFloat(ct ctype, offset int) ctype { @@ -189,7 +234,7 @@ func (c *compiler) compileToFloat(ct ctype, offset int) ctype { default: c.asm.Convert_xf(offset) } - return ctype{sqltypes.Float64, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Float64, Flag: ct.Flag, Col: collationNumeric} } func (c *compiler) compileToDecimal(ct ctype, offset int) ctype { @@ -204,7 +249,7 @@ func (c *compiler) compileToDecimal(ct ctype, offset int) ctype { default: c.asm.Convert_xd(offset, 0, 0) } - return ctype{sqltypes.Decimal, ct.Flag, collationNumeric} + return ctype{Type: sqltypes.Decimal, Flag: ct.Flag, Col: collationNumeric} } func (c *compiler) compileToDate(doct ctype, offset int) ctype { @@ -225,7 +270,7 @@ func (c *compiler) compileToDateTime(doct ctype, offset, prec int) ctype { default: c.asm.Convert_xDT(offset, prec) } - return ctype{Type: sqltypes.Datetime, Col: collationBinary, Flag: flagNullable} + return ctype{Type: sqltypes.Datetime, Size: int32(prec), Col: collationBinary, Flag: flagNullable} } func (c *compiler) compileToTime(doct ctype, offset, prec int) ctype { @@ -236,7 +281,7 @@ func (c *compiler) compileToTime(doct ctype, offset, prec int) ctype { default: c.asm.Convert_xT(offset, prec) } - return ctype{Type: sqltypes.Time, Col: collationBinary, Flag: flagNullable} + return ctype{Type: sqltypes.Time, Size: int32(prec), Col: collationBinary, Flag: flagNullable} } func (c *compiler) compileNullCheck1(ct ctype) *jump { diff --git a/go/vt/vtgate/evalengine/compiler_asm.go b/go/vt/vtgate/evalengine/compiler_asm.go index 6230627c26a..4b2f0525e9d 100644 --- a/go/vt/vtgate/evalengine/compiler_asm.go +++ b/go/vt/vtgate/evalengine/compiler_asm.go @@ -3761,9 +3761,6 @@ func (asm *assembler) Fn_UNIX_TIMESTAMP0() { func (asm *assembler) Fn_UNIX_TIMESTAMP1() { asm.emit(func(env *ExpressionEnv) int { res := dateTimeUnixTimestamp(env, env.vm.stack[env.vm.sp-1]) - if _, ok := res.(*evalInt64); !ok { - env.vm.err = errDeoptimize - } env.vm.stack[env.vm.sp-1] = res return 1 }, "FN UNIX_TIMESTAMP (SP-1)") diff --git a/go/vt/vtgate/evalengine/compiler_test.go b/go/vt/vtgate/evalengine/compiler_test.go index 4fba65aeb75..b2cb9553f49 100644 --- a/go/vt/vtgate/evalengine/compiler_test.go +++ b/go/vt/vtgate/evalengine/compiler_test.go @@ -496,6 +496,42 @@ func TestCompilerSingle(t *testing.T) { result: `VARCHAR("0")`, collation: collations.CollationUtf8mb4ID, }, + { + expression: `UNIX_TIMESTAMP(0.0) + 1`, + result: `DECIMAL(1.0)`, + }, + { + expression: `UNIX_TIMESTAMP(0.000) + 1`, + result: `DECIMAL(1.000)`, + }, + { + expression: `UNIX_TIMESTAMP(-1.5) + 1`, + result: `DECIMAL(1.0)`, + }, + { + expression: `UNIX_TIMESTAMP(-1.500) + 1`, + result: `DECIMAL(1.000)`, + }, + { + expression: `UNIX_TIMESTAMP(0x0) + 1`, + result: `INT64(1)`, + }, + { + expression: `UNIX_TIMESTAMP(timestamp '2000-01-01 10:34:58.123456') + 1`, + result: `DECIMAL(946719299.123456)`, + }, + { + expression: `UNIX_TIMESTAMP('200001011034581111111') + 1`, + result: `INT64(946719299)`, + }, + { + expression: `CONV(-0x1, 13e0, 13e0)`, + result: `VARCHAR("219505A9511A867B72")`, + }, + { + expression: `UNIX_TIMESTAMP('20000101103458.111111') + 1`, + result: `DECIMAL(946719299.111111)`, + }, } tz, _ := time.LoadLocation("Europe/Madrid") diff --git a/go/vt/vtgate/evalengine/expr_arithmetic.go b/go/vt/vtgate/evalengine/expr_arithmetic.go index cb80e57c365..8814d9ed6b8 100644 --- a/go/vt/vtgate/evalengine/expr_arithmetic.go +++ b/go/vt/vtgate/evalengine/expr_arithmetic.go @@ -66,19 +66,6 @@ func (b *ArithmeticExpr) eval(env *ExpressionEnv) (eval, error) { return b.Op.eval(left, right) } -func makeNumericalType(t sqltypes.Type, f typeFlag) (sqltypes.Type, typeFlag) { - if sqltypes.IsNumber(t) { - return t, f - } - if t == sqltypes.VarBinary && (f&flagHex) != 0 { - return sqltypes.Uint64, f - } - if sqltypes.IsDateOrTime(t) { - return sqltypes.Int64, f | flagAmbiguousType - } - return sqltypes.Float64, f -} - func (b *ArithmeticExpr) compile(c *compiler) (ctype, error) { return b.Op.compile(c, b.Left, b.Right) } @@ -536,5 +523,11 @@ func (expr *NegateExpr) compile(c *compiler) (ctype, error) { } c.asm.jumpDestination(skip) - return ctype{Type: neg, Col: collationNumeric}, nil + return ctype{ + Type: neg, + Flag: arg.Flag & (flagNull | flagNullable), + Size: arg.Size, + Scale: arg.Scale, + Col: collationNumeric, + }, nil } diff --git a/go/vt/vtgate/evalengine/expr_column.go b/go/vt/vtgate/evalengine/expr_column.go index 741d04c6a06..06e135c317c 100644 --- a/go/vt/vtgate/evalengine/expr_column.go +++ b/go/vt/vtgate/evalengine/expr_column.go @@ -29,8 +29,11 @@ type ( Column struct { Offset int Type sqltypes.Type + Size int32 + Scale int32 Collation collations.TypedCollation Original sqlparser.Expr + Nullable bool // dynamicTypeOffset is set when the type of this column cannot be calculated // at translation time. Since expressions with dynamic types cannot be compiled ahead of time, @@ -56,7 +59,11 @@ func (c *Column) eval(env *ExpressionEnv) (eval, error) { func (c *Column) typeof(env *ExpressionEnv) (ctype, error) { if c.typed() { - return ctype{Type: c.Type, Flag: flagNullable, Col: c.Collation}, nil + var nullable typeFlag + if c.Nullable { + nullable = flagNullable + } + return ctype{Type: c.Type, Size: c.Size, Scale: c.Scale, Flag: nullable, Col: c.Collation}, nil } if c.Offset < len(env.Fields) { field := env.Fields[c.Offset] @@ -85,7 +92,11 @@ func (column *Column) compile(c *compiler) (ctype, error) { if column.typed() { typ.Type = column.Type typ.Col = column.Collation - typ.Flag = flagNullable + if column.Nullable { + typ.Flag = flagNullable + } + typ.Size = column.Size + typ.Scale = column.Scale } else if c.dynamicTypes != nil { typ = c.dynamicTypes[column.dynamicTypeOffset] } else { diff --git a/go/vt/vtgate/evalengine/expr_env.go b/go/vt/vtgate/evalengine/expr_env.go index ffcde05d2a0..a6ca1411e74 100644 --- a/go/vt/vtgate/evalengine/expr_env.go +++ b/go/vt/vtgate/evalengine/expr_env.go @@ -99,11 +99,7 @@ func (env *ExpressionEnv) TypeOf(expr Expr) (Type, error) { if err != nil { return Type{}, err } - return Type{ - Type: ty.Type, - Coll: ty.Col.Collation, - Nullable: ty.Flag&flagNullable != 0, - }, nil + return NewTypeEx(ty.Type, ty.Col.Collation, ty.Flag&flagNullable != 0, ty.Size, ty.Scale), nil } func (env *ExpressionEnv) SetTime(now time.Time) { diff --git a/go/vt/vtgate/evalengine/expr_literal.go b/go/vt/vtgate/evalengine/expr_literal.go index 5058c157229..2291356fcc7 100644 --- a/go/vt/vtgate/evalengine/expr_literal.go +++ b/go/vt/vtgate/evalengine/expr_literal.go @@ -70,6 +70,10 @@ func (l *Literal) typeof(*ExpressionEnv) (ctype, error) { if e.u > math.MaxInt64+1 { f |= flagIntegerOvf } + case *evalTemporal: + return ctype{Type: e.t, Col: collationNumeric, Size: int32(e.prec)}, nil + case *evalDecimal: + return ctype{Type: sqltypes.Decimal, Col: collationNumeric, Size: e.length, Scale: -e.dec.Exponent()}, nil } return ctype{Type: l.inner.SQLType(), Flag: f, Col: evalCollation(l.inner)}, nil } diff --git a/go/vt/vtgate/evalengine/fn_time.go b/go/vt/vtgate/evalengine/fn_time.go index 430b975974b..b0e7366ce8f 100644 --- a/go/vt/vtgate/evalengine/fn_time.go +++ b/go/vt/vtgate/evalengine/fn_time.go @@ -29,6 +29,8 @@ import ( var SystemTime = time.Now +const maxTimePrec = 6 + type ( builtinNow struct { CallExpr @@ -564,7 +566,7 @@ func (b *builtinFromUnixtime) eval(env *ExpressionEnv) (eval, error) { sf, ff := math.Modf(ts.f) sec = int64(sf) frac = int64(ff * 1e9) - prec = 6 + prec = maxTimePrec case *evalDecimal: sd, fd := ts.dec.QuoRem(decimal.New(1, 0), 0) sec, _ = sd.Int64() @@ -589,14 +591,14 @@ func (b *builtinFromUnixtime) eval(env *ExpressionEnv) (eval, error) { sf, ff := math.Modf(f.f) sec = int64(sf) frac = int64(ff * 1e9) - prec = 6 + prec = maxTimePrec } default: f, _ := evalToFloat(ts) sf, ff := math.Modf(f.f) sec = int64(sf) frac = int64(ff * 1e9) - prec = 6 + prec = maxTimePrec } if sec < 0 || sec >= maxUnixtime { @@ -1280,9 +1282,9 @@ func dateTimeUnixTimestamp(env *ExpressionEnv, date eval) evalNumeric { if d.isHexOrBitLiteral() { return newEvalInt64(0) } - prec = 6 + prec = maxTimePrec default: - prec = 6 + prec = maxTimePrec } return newEvalDecimalWithPrec(decimal.Zero, prec) } @@ -1336,7 +1338,30 @@ func (call *builtinUnixTimestamp) compile(c *compiler) (ctype, error) { c.asm.Fn_UNIX_TIMESTAMP1() c.asm.jumpDestination(skip) - return ctype{Type: sqltypes.Int64, Col: collationBinary, Flag: arg.Flag | flagAmbiguousType}, nil + switch arg.Type { + case sqltypes.Datetime, sqltypes.Time, sqltypes.Decimal: + if arg.Size == 0 { + return ctype{Type: sqltypes.Int64, Col: collationNumeric, Flag: arg.Flag}, nil + } + return ctype{Type: sqltypes.Decimal, Size: arg.Size, Col: collationNumeric, Flag: arg.Flag}, nil + case sqltypes.Date, sqltypes.Int64, sqltypes.Uint64: + return ctype{Type: sqltypes.Int64, Col: collationNumeric, Flag: arg.Flag}, nil + case sqltypes.VarChar, sqltypes.VarBinary: + if arg.isHexOrBitLiteral() { + return ctype{Type: sqltypes.Int64, Col: collationNumeric, Flag: arg.Flag}, nil + } + if lit, ok := call.Arguments[0].(*Literal); ok { + if dt := evalToDateTime(lit.inner, -1, time.Now()); dt != nil { + if dt.prec == 0 { + return ctype{Type: sqltypes.Int64, Col: collationNumeric, Flag: arg.Flag}, nil + } + return ctype{Type: sqltypes.Decimal, Size: int32(dt.prec), Col: collationNumeric, Flag: arg.Flag}, nil + } + } + fallthrough + default: + return ctype{Type: sqltypes.Decimal, Size: maxTimePrec, Col: collationNumeric, Flag: arg.Flag}, nil + } } func (b *builtinWeek) eval(env *ExpressionEnv) (eval, error) { diff --git a/go/vt/vtgate/evalengine/translate.go b/go/vt/vtgate/evalengine/translate.go index c8f6f7d1337..7993854db36 100644 --- a/go/vt/vtgate/evalengine/translate.go +++ b/go/vt/vtgate/evalengine/translate.go @@ -193,7 +193,7 @@ func (ast *astCompiler) translateIsExpr(left sqlparser.Expr, op sqlparser.IsExpr } func (ast *astCompiler) translateBindVar(arg *sqlparser.Argument) (IR, error) { - bvar := NewBindVar(arg.Name, Type{Type: arg.Type, Coll: ast.cfg.Collation}) + bvar := NewBindVar(arg.Name, NewType(arg.Type, ast.cfg.Collation)) if !bvar.typed() { bvar.dynamicTypeOffset = len(ast.untyped) @@ -203,12 +203,12 @@ func (ast *astCompiler) translateBindVar(arg *sqlparser.Argument) (IR, error) { } func (ast *astCompiler) translateColOffset(col *sqlparser.Offset) (IR, error) { - typ := UnknownType() + var typ Type if ast.cfg.ResolveType != nil { typ, _ = ast.cfg.ResolveType(col.Original) } - if typ.Coll == collations.Unknown { - typ.Coll = ast.cfg.Collation + if typ.Valid() && typ.collation == collations.Unknown { + typ.collation = ast.cfg.Collation } column := NewColumn(col.V, typ, col.Original) @@ -227,12 +227,12 @@ func (ast *astCompiler) translateColName(colname *sqlparser.ColName) (IR, error) if err != nil { return nil, err } - typ := UnknownType() + var typ Type if ast.cfg.ResolveType != nil { typ, _ = ast.cfg.ResolveType(colname) } - if typ.Coll == collations.Unknown { - typ.Coll = ast.cfg.Collation + if typ.Valid() && typ.collation == collations.Unknown { + typ.collation = ast.cfg.Collation } column := NewColumn(idx, typ, colname) @@ -734,9 +734,9 @@ func (fields FieldResolver) Type(expr sqlparser.Expr) (Type, bool) { name := expr.CompliantName() for _, f := range fields { if f.Name == name { - return Type{Type: f.Type, Coll: collations.ID(f.Charset)}, true + return NewType(f.Type, collations.ID(f.Charset)), true } } } - return UnknownType(), false + return Type{}, false } diff --git a/go/vt/vtgate/planbuilder/collations_test.go b/go/vt/vtgate/planbuilder/collations_test.go index 7eaf3968f74..01b86125921 100644 --- a/go/vt/vtgate/planbuilder/collations_test.go +++ b/go/vt/vtgate/planbuilder/collations_test.go @@ -76,7 +76,7 @@ func TestOrderedAggregateCollations(t *testing.T) { check: func(t *testing.T, colls []collationInTable, primitive engine.Primitive) { oa, isOA := primitive.(*engine.OrderedAggregate) require.True(t, isOA, "should be an OrderedAggregate") - require.Equal(t, collid(colls[0].collationName), oa.GroupByKeys[0].Type.Coll) + require.Equal(t, collid(colls[0].collationName), oa.GroupByKeys[0].Type.Collation()) }, }, { @@ -85,7 +85,7 @@ func TestOrderedAggregateCollations(t *testing.T) { check: func(t *testing.T, colls []collationInTable, primitive engine.Primitive) { distinct, isDistinct := primitive.(*engine.Distinct) require.True(t, isDistinct, "should be a distinct") - require.Equal(t, collid(colls[0].collationName), distinct.CheckCols[0].Type.Coll) + require.Equal(t, collid(colls[0].collationName), distinct.CheckCols[0].Type.Collation()) }, }, { @@ -97,8 +97,8 @@ func TestOrderedAggregateCollations(t *testing.T) { check: func(t *testing.T, colls []collationInTable, primitive engine.Primitive) { oa, isOA := primitive.(*engine.OrderedAggregate) require.True(t, isOA, "should be an OrderedAggregate") - require.Equal(t, collid(colls[0].collationName), oa.GroupByKeys[0].Type.Coll) - require.Equal(t, collid(colls[1].collationName), oa.GroupByKeys[1].Type.Coll) + require.Equal(t, collid(colls[0].collationName), oa.GroupByKeys[0].Type.Collation()) + require.Equal(t, collid(colls[1].collationName), oa.GroupByKeys[1].Type.Collation()) }, }, { @@ -109,7 +109,7 @@ func TestOrderedAggregateCollations(t *testing.T) { check: func(t *testing.T, colls []collationInTable, primitive engine.Primitive) { oa, isOA := primitive.(*engine.OrderedAggregate) require.True(t, isOA, "should be an OrderedAggregate") - require.Equal(t, collid(colls[0].collationName), oa.GroupByKeys[0].Type.Coll) + require.Equal(t, collid(colls[0].collationName), oa.GroupByKeys[0].Type.Collation()) }, }, { @@ -122,7 +122,7 @@ func TestOrderedAggregateCollations(t *testing.T) { require.True(t, isMemSort, "should be a MemorySort") oa, isOA := memSort.Input.(*engine.OrderedAggregate) require.True(t, isOA, "should be an OrderedAggregate") - require.Equal(t, collid(colls[0].collationName), oa.GroupByKeys[0].Type.Coll) + require.Equal(t, collid(colls[0].collationName), oa.GroupByKeys[0].Type.Collation()) }, }, } diff --git a/go/vt/vtgate/planbuilder/expression_converter.go b/go/vt/vtgate/planbuilder/expression_converter.go index 61eebbe7f99..865c515ecbd 100644 --- a/go/vt/vtgate/planbuilder/expression_converter.go +++ b/go/vt/vtgate/planbuilder/expression_converter.go @@ -86,7 +86,7 @@ func (ec *expressionConverter) convert(astExpr sqlparser.Expr, boolean, identifi if !strings.Contains(err.Error(), evalengine.ErrTranslateExprNotSupported) { return nil, err } - evalExpr = evalengine.NewColumn(len(ec.tabletExpressions), evalengine.UnknownType(), nil) + evalExpr = evalengine.NewColumn(len(ec.tabletExpressions), evalengine.Type{}, nil) ec.tabletExpressions = append(ec.tabletExpressions, astExpr) } return evalExpr, nil diff --git a/go/vt/vtgate/planbuilder/expression_converter_test.go b/go/vt/vtgate/planbuilder/expression_converter_test.go index 798ed1e1635..3c0c25b6003 100644 --- a/go/vt/vtgate/planbuilder/expression_converter_test.go +++ b/go/vt/vtgate/planbuilder/expression_converter_test.go @@ -40,7 +40,7 @@ func TestConversion(t *testing.T) { expressionsOut: e(evalengine.NewLiteralInt(1)), }, { expressionsIn: "@@foo", - expressionsOut: e(evalengine.NewColumn(0, evalengine.UnknownType(), nil)), + expressionsOut: e(evalengine.NewColumn(0, evalengine.Type{}, nil)), }} for _, tc := range queries { diff --git a/go/vt/vtgate/planbuilder/operator_transformers.go b/go/vt/vtgate/planbuilder/operator_transformers.go index 7d3223a48e9..d6732ada87d 100644 --- a/go/vt/vtgate/planbuilder/operator_transformers.go +++ b/go/vt/vtgate/planbuilder/operator_transformers.go @@ -862,8 +862,8 @@ func transformHashJoin(ctx *plancontext.PlanningContext, op *operators.HashJoin) LHSKey: op.LHSKeys[0], RHSKey: op.RHSKeys[0], ASTPred: op.JoinPredicate(), - Collation: comparisonType.Coll, - ComparisonType: comparisonType.Type, + Collation: comparisonType.Collation(), + ComparisonType: comparisonType.Type(), }, }, nil } diff --git a/go/vt/vtgate/planbuilder/operators/queryprojection.go b/go/vt/vtgate/planbuilder/operators/queryprojection.go index e3f4d349d2a..1cef6706a9f 100644 --- a/go/vt/vtgate/planbuilder/operators/queryprojection.go +++ b/go/vt/vtgate/planbuilder/operators/queryprojection.go @@ -115,7 +115,7 @@ func (aggr Aggr) NeedsWeightString(ctx *plancontext.PlanningContext) bool { func (aggr Aggr) GetTypeCollation(ctx *plancontext.PlanningContext) evalengine.Type { if aggr.Func == nil { - return evalengine.UnknownType() + return evalengine.Type{} } switch aggr.OpCode { case opcode.AggregateMin, opcode.AggregateMax, opcode.AggregateSumDistinct, opcode.AggregateCountDistinct: @@ -123,7 +123,7 @@ func (aggr Aggr) GetTypeCollation(ctx *plancontext.PlanningContext) evalengine.T return typ } - return evalengine.UnknownType() + return evalengine.Type{} } // NewGroupBy creates a new group by from the given fields. diff --git a/go/vt/vtgate/planbuilder/testdata/info_schema57_cases.json b/go/vt/vtgate/planbuilder/testdata/info_schema57_cases.json index 2084d1a6e91..58cfbf1e68c 100644 --- a/go/vt/vtgate/planbuilder/testdata/info_schema57_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/info_schema57_cases.json @@ -103,7 +103,7 @@ "Instructions": { "OperatorType": "Distinct", "Collations": [ - "0: utf8mb4_0900_ai_ci" + "0: utf8mb3_general_ci" ], "Inputs": [ { @@ -146,13 +146,13 @@ "Instructions": { "OperatorType": "Distinct", "Collations": [ - "0: utf8mb4_0900_ai_ci", - "1: utf8mb4_0900_ai_ci", - "2: utf8mb4_0900_ai_ci", - "3: utf8mb4_0900_ai_ci", - "4: utf8mb4_0900_ai_ci", + "0: utf8mb3_general_ci", + "1: utf8mb3_general_ci", + "2: utf8mb3_general_ci", + "3: utf8mb3_general_ci", + "4: utf8mb3_general_ci", "5", - "6: utf8mb4_0900_ai_ci", + "6: utf8mb3_general_ci", "7", "8", "9", @@ -163,10 +163,10 @@ "14", "15", "16", - "17: utf8mb4_0900_ai_ci", + "17: utf8mb3_general_ci", "18", - "19: utf8mb4_0900_ai_ci", - "20: utf8mb4_0900_ai_ci" + "19: utf8mb3_general_ci", + "20: utf8mb3_general_ci" ], "Inputs": [ { @@ -1000,7 +1000,7 @@ "Instructions": { "OperatorType": "Distinct", "Collations": [ - "0: utf8mb4_0900_ai_ci" + "0: utf8mb3_general_ci" ], "Inputs": [ { @@ -1053,7 +1053,7 @@ "InputName": "SubQuery", "OperatorType": "Distinct", "Collations": [ - "0: utf8mb4_0900_ai_ci" + "0: utf8mb3_general_ci" ], "Inputs": [ { diff --git a/go/vt/vtgate/planbuilder/testdata/info_schema80_cases.json b/go/vt/vtgate/planbuilder/testdata/info_schema80_cases.json index 66449a2cc8c..b13e2912645 100644 --- a/go/vt/vtgate/planbuilder/testdata/info_schema80_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/info_schema80_cases.json @@ -103,7 +103,7 @@ "Instructions": { "OperatorType": "Distinct", "Collations": [ - "0: utf8mb4_0900_ai_ci" + "0: utf8mb3_general_ci" ], "Inputs": [ { @@ -146,11 +146,11 @@ "Instructions": { "OperatorType": "Distinct", "Collations": [ - "0: utf8mb4_0900_ai_ci", - "1: utf8mb4_0900_ai_ci", - "2: utf8mb4_0900_ai_ci", + "0: utf8mb3_general_ci", + "1: utf8mb3_general_ci", + "2: utf8mb3_general_ci", "3", - "4: utf8mb4_0900_ai_ci", + "4: utf8mb3_general_ci", "5", "6", "7", @@ -163,10 +163,10 @@ "14", "15", "16", - "17: utf8mb4_0900_ai_ci", + "17: utf8mb3_general_ci", "18", - "19: utf8mb4_0900_ai_ci", - "20: utf8mb4_0900_ai_ci" + "19: utf8mb3_general_ci", + "20: utf8mb3_general_ci" ], "Inputs": [ { @@ -1065,7 +1065,7 @@ "Instructions": { "OperatorType": "Distinct", "Collations": [ - "0: utf8mb4_0900_ai_ci" + "0: utf8mb3_general_ci" ], "Inputs": [ { @@ -1118,7 +1118,7 @@ "InputName": "SubQuery", "OperatorType": "Distinct", "Collations": [ - "0: utf8mb4_0900_ai_ci" + "0: utf8mb3_general_ci" ], "Inputs": [ { diff --git a/go/vt/vtgate/planbuilder/testdata/union_cases.json b/go/vt/vtgate/planbuilder/testdata/union_cases.json index 9c1f376b652..37113c778e3 100644 --- a/go/vt/vtgate/planbuilder/testdata/union_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/union_cases.json @@ -322,7 +322,7 @@ "Instructions": { "OperatorType": "Distinct", "Collations": [ - "0: utf8mb4_0900_ai_ci" + "0: utf8mb3_general_ci" ], "Inputs": [ { @@ -1138,7 +1138,7 @@ { "OperatorType": "Distinct", "Collations": [ - "0: utf8mb4_0900_ai_ci" + "0: utf8mb3_general_ci" ], "Inputs": [ { @@ -1218,18 +1218,18 @@ { "OperatorType": "Distinct", "Collations": [ - "0: utf8mb4_0900_ai_ci", - "1: utf8mb4_0900_ai_ci", - "2: utf8mb4_0900_ai_ci", - "3: utf8mb4_0900_ai_ci", - "4: utf8mb4_0900_ai_ci", - "5: utf8mb4_0900_ai_ci", - "6: utf8mb4_0900_ai_ci", + "0: utf8mb3_general_ci", + "1: utf8mb3_general_ci", + "2: utf8mb3_general_ci", + "3: utf8mb3_general_ci", + "4: utf8mb3_general_ci", + "5: utf8mb3_general_ci", + "6: utf8mb3_general_ci", "7", "8", - "9: utf8mb4_0900_ai_ci", - "10: utf8mb4_0900_ai_ci", - "11: utf8mb4_0900_ai_ci" + "9: utf8mb3_general_ci", + "10: utf8mb3_general_ci", + "11: utf8mb3_general_ci" ], "Inputs": [ { diff --git a/go/vt/vtgate/schema/tracker.go b/go/vt/vtgate/schema/tracker.go index c4b48ce8156..a6d6cafc423 100644 --- a/go/vt/vtgate/schema/tracker.go +++ b/go/vt/vtgate/schema/tracker.go @@ -19,6 +19,7 @@ package schema import ( "context" "maps" + "strconv" "strings" "sync" "time" @@ -311,18 +312,46 @@ func getColumns(tblSpec *sqlparser.TableSpec) []vindexes.Column { cols := make([]vindexes.Column, 0, len(tblSpec.Columns)) for _, column := range tblSpec.Columns { colCollation := getColumnCollation(tblCollation, column) + size := getColumnNumber(column.Type.Length) + scale := getColumnNumber(column.Type.Scale) + nullable := getColumnNullable(column.Type.Options.Null) cols = append(cols, vindexes.Column{ Name: column.Name, Type: column.Type.SQLType(), CollationName: colCollation, - Invisible: column.Type.Invisible(), Default: column.Type.Options.Default, + Invisible: column.Type.Invisible(), + Size: size, + Scale: scale, + Nullable: nullable, + Values: column.Type.EnumValues, }) } return cols } +func getColumnNullable(null *bool) bool { + if null == nil { + return true + } + return *null +} + +func getColumnNumber(lit *sqlparser.Literal) int32 { + if lit == nil { + return 0 + } + if lit.Type != sqlparser.IntVal { + return 0 + } + val, err := strconv.ParseInt(lit.Val, 10, 32) + if err != nil { + return 0 + } + return int32(val) +} + func getForeignKeys(tblSpec *sqlparser.TableSpec) []*sqlparser.ForeignKeyDefinition { if tblSpec.Constraints == nil { return nil @@ -353,7 +382,13 @@ func getTableCollation(tblSpec *sqlparser.TableSpec) string { func getColumnCollation(defaultCollation string, column *sqlparser.ColumnDefinition) string { if column.Type.Options == nil || column.Type.Options.Collate == "" { - return defaultCollation + switch strings.ToLower(column.Type.Type) { + case "enum", "set", "text", "tinytext", "mediumtext", "longtext", "varchar", "char": + return defaultCollation + case "json": + return "utf8mb4_bin" + } + return "binary" } return column.Type.Options.Collate } diff --git a/go/vt/vtgate/schema/tracker_test.go b/go/vt/vtgate/schema/tracker_test.go index 88b9dfa0d50..ce2a2d79b56 100644 --- a/go/vt/vtgate/schema/tracker_test.go +++ b/go/vt/vtgate/schema/tracker_test.go @@ -173,7 +173,7 @@ func TestTableTracking(t *testing.T) { }, { // initial load of view - kept empty }, { - "t1": "create table t1(id bigint primary key, name varchar(50))", + "t1": "create table t1(id bigint primary key, name varchar(50), email varchar(50) not null default 'a@b.com')", "t2": "create table t2(id varchar(50) primary key)", }, { "t2": "create table t2(id varchar(50) primary key, name varchar(50))", @@ -185,32 +185,32 @@ func TestTableTracking(t *testing.T) { testcases := []testCases{{ testName: "initial table load", expTbl: map[string][]vindexes.Column{ - "prior": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT32}}, + "prior": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT32, CollationName: "binary", Nullable: true}}, }, }, { testName: "new tables", updTbl: []string{"t1", "t2"}, expTbl: map[string][]vindexes.Column{ - "prior": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT32}}, - "t1": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64}, {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR}}, - "t2": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_VARCHAR}}, + "prior": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT32, CollationName: "binary", Nullable: true}}, + "t1": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "binary", Nullable: true}, {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, Size: 50, Nullable: true}, {Name: sqlparser.NewIdentifierCI("email"), Type: querypb.Type_VARCHAR, Size: 50, Nullable: false, Default: &sqlparser.Literal{Val: "a@b.com"}}}, + "t2": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_VARCHAR, Size: 50, Nullable: true}}, }, }, { testName: "delete prior, updated t2 and new t3", updTbl: []string{"prior", "t2", "t3"}, expTbl: map[string][]vindexes.Column{ - "t1": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64}, {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR}}, - "t2": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_VARCHAR}, {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR}}, - "t3": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_DATETIME}}, + "t1": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "binary", Nullable: true}, {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, Size: 50, Nullable: true}, {Name: sqlparser.NewIdentifierCI("email"), Type: querypb.Type_VARCHAR, Size: 50, Nullable: false, Default: &sqlparser.Literal{Val: "a@b.com"}}}, + "t2": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_VARCHAR, Size: 50, Nullable: true}, {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, Size: 50, Nullable: true}}, + "t3": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_DATETIME, CollationName: "binary", Size: 0, Nullable: true}}, }, }, { testName: "new t4", updTbl: []string{"t4"}, expTbl: map[string][]vindexes.Column{ - "t1": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64}, {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR}}, - "t2": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_VARCHAR}, {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR}}, - "t3": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_DATETIME}}, - "t4": {{Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR}}, + "t1": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "binary", Nullable: true}, {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, Size: 50, Nullable: true}, {Name: sqlparser.NewIdentifierCI("email"), Type: querypb.Type_VARCHAR, Size: 50, Nullable: false, Default: &sqlparser.Literal{Val: "a@b.com"}}}, + "t2": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_VARCHAR, Size: 50, Nullable: true}, {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, Size: 50, Nullable: true}}, + "t3": {{Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_DATETIME, CollationName: "binary", Size: 0, Nullable: true}}, + "t4": {{Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, Size: 50, Nullable: true}}, }, }} @@ -292,9 +292,9 @@ func TestFKInfoRetrieval(t *testing.T) { testName: "initial table load", expTbl: map[string][]vindexes.Column{ "my_tbl": { - {Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "utf8mb4_0900_ai_ci"}, - {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, CollationName: "latin1_swedish_ci", Default: &sqlparser.NullVal{}}, - {Name: sqlparser.NewIdentifierCI("email"), Type: querypb.Type_VARBINARY, CollationName: "utf8mb4_0900_ai_ci", Default: &sqlparser.NullVal{}}, + {Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "binary", Nullable: false}, + {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, Size: 50, CollationName: "latin1_swedish_ci", Nullable: true, Default: &sqlparser.NullVal{}}, + {Name: sqlparser.NewIdentifierCI("email"), Type: querypb.Type_VARBINARY, Size: 100, CollationName: "binary", Nullable: true, Default: &sqlparser.NullVal{}}, }, }, }, { @@ -302,15 +302,15 @@ func TestFKInfoRetrieval(t *testing.T) { updTbl: []string{"my_child_tbl"}, expTbl: map[string][]vindexes.Column{ "my_tbl": { - {Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "utf8mb4_0900_ai_ci"}, - {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, CollationName: "latin1_swedish_ci", Default: &sqlparser.NullVal{}}, - {Name: sqlparser.NewIdentifierCI("email"), Type: querypb.Type_VARBINARY, CollationName: "utf8mb4_0900_ai_ci", Default: &sqlparser.NullVal{}}, + {Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "binary", Nullable: false}, + {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, Size: 50, CollationName: "latin1_swedish_ci", Nullable: true, Default: &sqlparser.NullVal{}}, + {Name: sqlparser.NewIdentifierCI("email"), Type: querypb.Type_VARBINARY, Size: 100, CollationName: "binary", Nullable: true, Default: &sqlparser.NullVal{}}, }, "my_child_tbl": { - {Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "utf8mb4_0900_ai_ci"}, - {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, CollationName: "latin1_swedish_ci", Default: &sqlparser.NullVal{}}, - {Name: sqlparser.NewIdentifierCI("code"), Type: querypb.Type_VARCHAR, CollationName: "utf8mb4_0900_ai_ci", Default: &sqlparser.NullVal{}}, - {Name: sqlparser.NewIdentifierCI("my_id"), Type: querypb.Type_INT64, CollationName: "utf8mb4_0900_ai_ci", Default: &sqlparser.NullVal{}}, + {Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "binary", Nullable: false}, + {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, Size: 50, CollationName: "latin1_swedish_ci", Nullable: true, Default: &sqlparser.NullVal{}}, + {Name: sqlparser.NewIdentifierCI("code"), Type: querypb.Type_VARCHAR, Size: 6, CollationName: "utf8mb4_0900_ai_ci", Nullable: true, Default: &sqlparser.NullVal{}}, + {Name: sqlparser.NewIdentifierCI("my_id"), Type: querypb.Type_INT64, CollationName: "binary", Nullable: true, Default: &sqlparser.NullVal{}}, }, }, expFk: map[string]string{ @@ -349,9 +349,9 @@ func TestIndexInfoRetrieval(t *testing.T) { testName: "initial table load", expTbl: map[string][]vindexes.Column{ "my_tbl": { - {Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "utf8mb4_0900_ai_ci"}, - {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, CollationName: "latin1_swedish_ci", Default: &sqlparser.NullVal{}}, - {Name: sqlparser.NewIdentifierCI("email"), Type: querypb.Type_VARBINARY, CollationName: "utf8mb4_0900_ai_ci", Default: &sqlparser.NullVal{}}, + {Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "binary", Nullable: false}, + {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, CollationName: "latin1_swedish_ci", Size: 50, Nullable: true, Default: &sqlparser.NullVal{}}, + {Name: sqlparser.NewIdentifierCI("email"), Type: querypb.Type_VARBINARY, CollationName: "binary", Size: 100, Nullable: true, Default: &sqlparser.NullVal{}}, }, }, expIdx: map[string][]string{ @@ -365,9 +365,9 @@ func TestIndexInfoRetrieval(t *testing.T) { updTbl: []string{"my_tbl"}, expTbl: map[string][]vindexes.Column{ "my_tbl": { - {Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "utf8mb4_0900_ai_ci"}, - {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, CollationName: "latin1_swedish_ci", Default: &sqlparser.NullVal{}}, - {Name: sqlparser.NewIdentifierCI("email"), Type: querypb.Type_VARBINARY, CollationName: "utf8mb4_0900_ai_ci", Default: &sqlparser.NullVal{}}, + {Name: sqlparser.NewIdentifierCI("id"), Type: querypb.Type_INT64, CollationName: "binary", Nullable: false}, + {Name: sqlparser.NewIdentifierCI("name"), Type: querypb.Type_VARCHAR, CollationName: "latin1_swedish_ci", Size: 50, Nullable: true, Default: &sqlparser.NullVal{}}, + {Name: sqlparser.NewIdentifierCI("email"), Type: querypb.Type_VARBINARY, CollationName: "binary", Size: 100, Nullable: true, Default: &sqlparser.NullVal{}}, }, }, expIdx: map[string][]string{ diff --git a/go/vt/vtgate/semantics/analyzer_test.go b/go/vt/vtgate/semantics/analyzer_test.go index cb19d5deafd..d27d5a926c6 100644 --- a/go/vt/vtgate/semantics/analyzer_test.go +++ b/go/vt/vtgate/semantics/analyzer_test.go @@ -402,7 +402,7 @@ func TestUnknownColumnMap2(t *testing.T) { require.NoError(t, tbl.NotSingleRouteErr) typ, found := tbl.TypeForExpr(expr) assert.True(t, found) - assert.Equal(t, test.typ, typ.Type) + assert.Equal(t, test.typ, typ.Type()) } }) } diff --git a/go/vt/vtgate/semantics/binder.go b/go/vt/vtgate/semantics/binder.go index f7fc5d64c1a..27d059673cb 100644 --- a/go/vt/vtgate/semantics/binder.go +++ b/go/vt/vtgate/semantics/binder.go @@ -19,7 +19,6 @@ package semantics import ( "strings" - "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/sqlparser" ) @@ -88,7 +87,7 @@ func (b *binder) up(cursor *sqlparser.Cursor) error { } b.recursive[node] = deps.recursive b.direct[node] = deps.direct - if deps.typ.Type != sqltypes.Unknown { + if deps.typ.Valid() { b.typer.setTypeFor(node, deps.typ) } case *sqlparser.CountStar: @@ -103,7 +102,7 @@ func (b *binder) up(cursor *sqlparser.Cursor) error { for i, expr := range info.exprs { ae := expr.(*sqlparser.AliasedExpr) b.recursive[ae.Expr] = info.recursive[i] - if t := info.types[i]; t.Type != sqltypes.Unknown { + if t := info.types[i]; t.Valid() { b.typer.m[ae.Expr] = t } } diff --git a/go/vt/vtgate/semantics/dependencies.go b/go/vt/vtgate/semantics/dependencies.go index 89b6da7045d..e68c5100ef5 100644 --- a/go/vt/vtgate/semantics/dependencies.go +++ b/go/vt/vtgate/semantics/dependencies.go @@ -54,10 +54,9 @@ func createCertain(direct TableSet, recursive TableSet, qt evalengine.Type) *cer dependency: dependency{ direct: direct, recursive: recursive, - typ: evalengine.UnknownType(), }, } - if qt.Type != querypb.Type_NULL_TYPE { + if qt.Valid() && qt.Type() != querypb.Type_NULL_TYPE { c.typ = qt } return c @@ -68,7 +67,6 @@ func createUncertain(direct TableSet, recursive TableSet) *uncertain { dependency: dependency{ direct: direct, recursive: recursive, - typ: evalengine.UnknownType(), }, } } diff --git a/go/vt/vtgate/semantics/info_schema.go b/go/vt/vtgate/semantics/info_schema.go index b2b5d9036f2..76a383b5ac0 100644 --- a/go/vt/vtgate/semantics/info_schema.go +++ b/go/vt/vtgate/semantics/info_schema.go @@ -17,6 +17,7 @@ limitations under the License. package semantics import ( + "fmt" "strings" "vitess.io/vitess/go/mysql/collations" @@ -29,8 +30,37 @@ import ( "vitess.io/vitess/go/vt/vtgate/vindexes" ) -func createCol(name string, typ int) vindexes.Column { - return vindexes.Column{Name: sqlparser.NewIdentifierCI(name), Type: query.Type(typ)} +func createCol(name string, typ int, collation string, def string, size, scale int32, notNullable bool, values string) vindexes.Column { + var expr sqlparser.Expr + if def != "" { + var err error + expr, err = sqlparser.ParseExpr(def) + if err != nil { + panic(fmt.Sprintf("Failed to parse %q: %v", def, err)) + } + } + var vals []string + if values != "" { + quotedVals := strings.Split(values, ",") + vals = make([]string, 0, len(quotedVals)) + for _, v := range quotedVals { + u := strings.TrimFunc(v, func(r rune) bool { + return r == '\'' + }) + vals = append(vals, u) + } + } + + return vindexes.Column{ + Name: sqlparser.NewIdentifierCI(name), + Type: query.Type(typ), + CollationName: collation, + Default: expr, + Size: size, + Scale: scale, + Nullable: !notNullable, + Values: vals, + } } // getInfoSchema57 returns a map of all information_schema tables and their columns with types @@ -38,734 +68,627 @@ func createCol(name string, typ int) vindexes.Column { func getInfoSchema57() map[string][]vindexes.Column { infSchema := map[string][]vindexes.Column{} var cols []vindexes.Column - cols = append(cols, createCol("CHARACTER_SET_NAME", 6165)) - cols = append(cols, createCol("DEFAULT_COLLATE_NAME", 6165)) - cols = append(cols, createCol("DESCRIPTION", 6165)) - cols = append(cols, createCol("MAXLEN", 265)) + cols = append(cols, createCol("CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("DEFAULT_COLLATE_NAME", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("DESCRIPTION", 6165, "utf8mb3_general_ci", "", 60, 0, true, "")) + cols = append(cols, createCol("MAXLEN", 265, "utf8mb3_general_ci", "0", 3, 0, true, "")) infSchema["CHARACTER_SETS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("COLLATION_NAME", 6165)) - cols = append(cols, createCol("CHARACTER_SET_NAME", 6165)) + cols = append(cols, createCol("COLLATION_NAME", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) infSchema["COLLATION_CHARACTER_SET_APPLICABILITY"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("COLLATION_NAME", 6165)) - cols = append(cols, createCol("CHARACTER_SET_NAME", 6165)) - cols = append(cols, createCol("ID", 265)) - cols = append(cols, createCol("IS_DEFAULT", 6165)) - cols = append(cols, createCol("IS_COMPILED", 6165)) - cols = append(cols, createCol("SORTLEN", 265)) + cols = append(cols, createCol("COLLATION_NAME", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("ID", 265, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("IS_DEFAULT", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("IS_COMPILED", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("SORTLEN", 265, "utf8mb3_general_ci", "0", 3, 0, true, "")) infSchema["COLLATIONS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("GRANTEE", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("COLUMN_NAME", 6165)) - cols = append(cols, createCol("PRIVILEGE_TYPE", 6165)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) + cols = append(cols, createCol("GRANTEE", 6165, "utf8mb3_general_ci", "", 81, 0, true, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PRIVILEGE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["COLUMN_PRIVILEGES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("COLUMN_NAME", 6165)) - cols = append(cols, createCol("ORDINAL_POSITION", 265)) - cols = append(cols, createCol("COLUMN_DEFAULT", 6163)) - cols = append(cols, createCol("IS_NULLABLE", 6165)) - cols = append(cols, createCol("DATA_TYPE", 6165)) - cols = append(cols, createCol("CHARACTER_MAXIMUM_LENGTH", 265)) - cols = append(cols, createCol("CHARACTER_OCTET_LENGTH", 265)) - cols = append(cols, createCol("NUMERIC_PRECISION", 265)) - cols = append(cols, createCol("NUMERIC_SCALE", 265)) - cols = append(cols, createCol("DATETIME_PRECISION", 265)) - cols = append(cols, createCol("CHARACTER_SET_NAME", 6165)) - cols = append(cols, createCol("COLLATION_NAME", 6165)) - cols = append(cols, createCol("COLUMN_TYPE", 6163)) - cols = append(cols, createCol("COLUMN_KEY", 6165)) - cols = append(cols, createCol("EXTRA", 6165)) - cols = append(cols, createCol("PRIVILEGES", 6165)) - cols = append(cols, createCol("COLUMN_COMMENT", 6165)) - cols = append(cols, createCol("GENERATION_EXPRESSION", 6163)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ORDINAL_POSITION", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("COLUMN_DEFAULT", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("IS_NULLABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("DATA_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CHARACTER_MAXIMUM_LENGTH", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("CHARACTER_OCTET_LENGTH", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("NUMERIC_PRECISION", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("NUMERIC_SCALE", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("DATETIME_PRECISION", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 32, 0, false, "")) + cols = append(cols, createCol("COLLATION_NAME", 6165, "utf8mb3_general_ci", "", 32, 0, false, "")) + cols = append(cols, createCol("COLUMN_TYPE", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("COLUMN_KEY", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("EXTRA", 6165, "utf8mb3_general_ci", "", 30, 0, true, "")) + cols = append(cols, createCol("PRIVILEGES", 6165, "utf8mb3_general_ci", "", 80, 0, true, "")) + cols = append(cols, createCol("COLUMN_COMMENT", 6165, "utf8mb3_general_ci", "", 1024, 0, true, "")) + cols = append(cols, createCol("GENERATION_EXPRESSION", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["COLUMNS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("ENGINE", 6165)) - cols = append(cols, createCol("SUPPORT", 6165)) - cols = append(cols, createCol("COMMENT", 6165)) - cols = append(cols, createCol("TRANSACTIONS", 6165)) - cols = append(cols, createCol("XA", 6165)) - cols = append(cols, createCol("SAVEPOINTS", 6165)) + cols = append(cols, createCol("ENGINE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("SUPPORT", 6165, "utf8mb3_general_ci", "", 8, 0, true, "")) + cols = append(cols, createCol("COMMENT", 6165, "utf8mb3_general_ci", "", 80, 0, true, "")) + cols = append(cols, createCol("TRANSACTIONS", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("XA", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("SAVEPOINTS", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) infSchema["ENGINES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("EVENT_CATALOG", 6165)) - cols = append(cols, createCol("EVENT_SCHEMA", 6165)) - cols = append(cols, createCol("EVENT_NAME", 6165)) - cols = append(cols, createCol("DEFINER", 6165)) - cols = append(cols, createCol("TIME_ZONE", 6165)) - cols = append(cols, createCol("EVENT_BODY", 6165)) - cols = append(cols, createCol("EVENT_DEFINITION", 6163)) - cols = append(cols, createCol("EVENT_TYPE", 6165)) - cols = append(cols, createCol("EXECUTE_AT", 2064)) - cols = append(cols, createCol("INTERVAL_VALUE", 6165)) - cols = append(cols, createCol("INTERVAL_FIELD", 6165)) - cols = append(cols, createCol("SQL_MODE", 6165)) - cols = append(cols, createCol("STARTS", 2064)) - cols = append(cols, createCol("ENDS", 2064)) - cols = append(cols, createCol("STATUS", 6165)) - cols = append(cols, createCol("ON_COMPLETION", 6165)) - cols = append(cols, createCol("CREATED", 2064)) - cols = append(cols, createCol("LAST_ALTERED", 2064)) - cols = append(cols, createCol("LAST_EXECUTED", 2064)) - cols = append(cols, createCol("EVENT_COMMENT", 6165)) - cols = append(cols, createCol("ORIGINATOR", 265)) - cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165)) - cols = append(cols, createCol("COLLATION_CONNECTION", 6165)) - cols = append(cols, createCol("DATABASE_COLLATION", 6165)) + cols = append(cols, createCol("EVENT_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("EVENT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("EVENT_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("DEFINER", 6165, "utf8mb3_general_ci", "", 93, 0, true, "")) + cols = append(cols, createCol("TIME_ZONE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("EVENT_BODY", 6165, "utf8mb3_general_ci", "", 8, 0, true, "")) + cols = append(cols, createCol("EVENT_DEFINITION", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("EVENT_TYPE", 6165, "utf8mb3_general_ci", "", 9, 0, true, "")) + cols = append(cols, createCol("EXECUTE_AT", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("INTERVAL_VALUE", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("INTERVAL_FIELD", 6165, "utf8mb3_general_ci", "", 18, 0, false, "")) + cols = append(cols, createCol("SQL_MODE", 6165, "utf8mb3_general_ci", "", 8192, 0, true, "")) + cols = append(cols, createCol("STARTS", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("ENDS", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("STATUS", 6165, "utf8mb3_general_ci", "", 18, 0, true, "")) + cols = append(cols, createCol("ON_COMPLETION", 6165, "utf8mb3_general_ci", "", 12, 0, true, "")) + cols = append(cols, createCol("CREATED", 2064, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("LAST_ALTERED", 2064, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("LAST_EXECUTED", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("EVENT_COMMENT", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ORIGINATOR", 265, "utf8mb3_general_ci", "0", 10, 0, true, "")) + cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("COLLATION_CONNECTION", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("DATABASE_COLLATION", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) infSchema["EVENTS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("FILE_ID", 265)) - cols = append(cols, createCol("FILE_NAME", 6165)) - cols = append(cols, createCol("FILE_TYPE", 6165)) - cols = append(cols, createCol("TABLESPACE_NAME", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("LOGFILE_GROUP_NAME", 6165)) - cols = append(cols, createCol("LOGFILE_GROUP_NUMBER", 265)) - cols = append(cols, createCol("ENGINE", 6165)) - cols = append(cols, createCol("FULLTEXT_KEYS", 6165)) - cols = append(cols, createCol("DELETED_ROWS", 265)) - cols = append(cols, createCol("UPDATE_COUNT", 265)) - cols = append(cols, createCol("FREE_EXTENTS", 265)) - cols = append(cols, createCol("TOTAL_EXTENTS", 265)) - cols = append(cols, createCol("EXTENT_SIZE", 265)) - cols = append(cols, createCol("INITIAL_SIZE", 265)) - cols = append(cols, createCol("MAXIMUM_SIZE", 265)) - cols = append(cols, createCol("AUTOEXTEND_SIZE", 265)) - cols = append(cols, createCol("CREATION_TIME", 2064)) - cols = append(cols, createCol("LAST_UPDATE_TIME", 2064)) - cols = append(cols, createCol("LAST_ACCESS_TIME", 2064)) - cols = append(cols, createCol("RECOVER_TIME", 265)) - cols = append(cols, createCol("TRANSACTION_COUNTER", 265)) - cols = append(cols, createCol("VERSION", 265)) - cols = append(cols, createCol("ROW_FORMAT", 6165)) - cols = append(cols, createCol("TABLE_ROWS", 265)) - cols = append(cols, createCol("AVG_ROW_LENGTH", 265)) - cols = append(cols, createCol("DATA_LENGTH", 265)) - cols = append(cols, createCol("MAX_DATA_LENGTH", 265)) - cols = append(cols, createCol("INDEX_LENGTH", 265)) - cols = append(cols, createCol("DATA_FREE", 265)) - cols = append(cols, createCol("CREATE_TIME", 2064)) - cols = append(cols, createCol("UPDATE_TIME", 2064)) - cols = append(cols, createCol("CHECK_TIME", 2064)) - cols = append(cols, createCol("CHECKSUM", 265)) - cols = append(cols, createCol("STATUS", 6165)) - cols = append(cols, createCol("EXTRA", 6165)) + cols = append(cols, createCol("FILE_ID", 265, "utf8mb3_general_ci", "0", 4, 0, true, "")) + cols = append(cols, createCol("FILE_NAME", 6165, "utf8mb3_general_ci", "", 4000, 0, false, "")) + cols = append(cols, createCol("FILE_TYPE", 6165, "utf8mb3_general_ci", "", 20, 0, true, "")) + cols = append(cols, createCol("TABLESPACE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("LOGFILE_GROUP_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("LOGFILE_GROUP_NUMBER", 265, "utf8mb3_general_ci", "", 4, 0, false, "")) + cols = append(cols, createCol("ENGINE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("FULLTEXT_KEYS", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("DELETED_ROWS", 265, "utf8mb3_general_ci", "", 4, 0, false, "")) + cols = append(cols, createCol("UPDATE_COUNT", 265, "utf8mb3_general_ci", "", 4, 0, false, "")) + cols = append(cols, createCol("FREE_EXTENTS", 265, "utf8mb3_general_ci", "", 4, 0, false, "")) + cols = append(cols, createCol("TOTAL_EXTENTS", 265, "utf8mb3_general_ci", "", 4, 0, false, "")) + cols = append(cols, createCol("EXTENT_SIZE", 265, "utf8mb3_general_ci", "0", 4, 0, true, "")) + cols = append(cols, createCol("INITIAL_SIZE", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("MAXIMUM_SIZE", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("AUTOEXTEND_SIZE", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("CREATION_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("LAST_UPDATE_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("LAST_ACCESS_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("RECOVER_TIME", 265, "utf8mb3_general_ci", "", 4, 0, false, "")) + cols = append(cols, createCol("TRANSACTION_COUNTER", 265, "utf8mb3_general_ci", "", 4, 0, false, "")) + cols = append(cols, createCol("VERSION", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("ROW_FORMAT", 6165, "utf8mb3_general_ci", "", 10, 0, false, "")) + cols = append(cols, createCol("TABLE_ROWS", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("AVG_ROW_LENGTH", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("DATA_LENGTH", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("MAX_DATA_LENGTH", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("INDEX_LENGTH", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("DATA_FREE", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("CREATE_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("UPDATE_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHECK_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHECKSUM", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("STATUS", 6165, "utf8mb3_general_ci", "", 20, 0, true, "")) + cols = append(cols, createCol("EXTRA", 6165, "utf8mb3_general_ci", "", 255, 0, false, "")) infSchema["FILES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("VARIABLE_NAME", 6165)) - cols = append(cols, createCol("VARIABLE_VALUE", 6165)) + cols = append(cols, createCol("VARIABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("VARIABLE_VALUE", 6165, "utf8mb3_general_ci", "", 1024, 0, false, "")) infSchema["GLOBAL_STATUS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("VARIABLE_NAME", 6165)) - cols = append(cols, createCol("VARIABLE_VALUE", 6165)) + cols = append(cols, createCol("VARIABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("VARIABLE_VALUE", 6165, "utf8mb3_general_ci", "", 1024, 0, false, "")) infSchema["GLOBAL_VARIABLES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("POOL_ID", 265)) - cols = append(cols, createCol("BLOCK_ID", 265)) - cols = append(cols, createCol("SPACE", 265)) - cols = append(cols, createCol("PAGE_NUMBER", 265)) - cols = append(cols, createCol("PAGE_TYPE", 6165)) - cols = append(cols, createCol("FLUSH_TYPE", 265)) - cols = append(cols, createCol("FIX_COUNT", 265)) - cols = append(cols, createCol("IS_HASHED", 6165)) - cols = append(cols, createCol("NEWEST_MODIFICATION", 265)) - cols = append(cols, createCol("OLDEST_MODIFICATION", 265)) - cols = append(cols, createCol("ACCESS_TIME", 265)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("INDEX_NAME", 6165)) - cols = append(cols, createCol("NUMBER_RECORDS", 265)) - cols = append(cols, createCol("DATA_SIZE", 265)) - cols = append(cols, createCol("COMPRESSED_SIZE", 265)) - cols = append(cols, createCol("PAGE_STATE", 6165)) - cols = append(cols, createCol("IO_FIX", 6165)) - cols = append(cols, createCol("IS_OLD", 6165)) - cols = append(cols, createCol("FREE_PAGE_CLOCK", 265)) + cols = append(cols, createCol("POOL_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("BLOCK_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("SPACE", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PAGE_NUMBER", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PAGE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("FLUSH_TYPE", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("FIX_COUNT", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("IS_HASHED", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("NEWEST_MODIFICATION", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("OLDEST_MODIFICATION", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("ACCESS_TIME", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 1024, 0, false, "")) + cols = append(cols, createCol("INDEX_NAME", 6165, "utf8mb3_general_ci", "", 1024, 0, false, "")) + cols = append(cols, createCol("NUMBER_RECORDS", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("DATA_SIZE", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("COMPRESSED_SIZE", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PAGE_STATE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("IO_FIX", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("IS_OLD", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("FREE_PAGE_CLOCK", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) infSchema["INNODB_BUFFER_PAGE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("POOL_ID", 265)) - cols = append(cols, createCol("LRU_POSITION", 265)) - cols = append(cols, createCol("SPACE", 265)) - cols = append(cols, createCol("PAGE_NUMBER", 265)) - cols = append(cols, createCol("PAGE_TYPE", 6165)) - cols = append(cols, createCol("FLUSH_TYPE", 265)) - cols = append(cols, createCol("FIX_COUNT", 265)) - cols = append(cols, createCol("IS_HASHED", 6165)) - cols = append(cols, createCol("NEWEST_MODIFICATION", 265)) - cols = append(cols, createCol("OLDEST_MODIFICATION", 265)) - cols = append(cols, createCol("ACCESS_TIME", 265)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("INDEX_NAME", 6165)) - cols = append(cols, createCol("NUMBER_RECORDS", 265)) - cols = append(cols, createCol("DATA_SIZE", 265)) - cols = append(cols, createCol("COMPRESSED_SIZE", 265)) - cols = append(cols, createCol("COMPRESSED", 6165)) - cols = append(cols, createCol("IO_FIX", 6165)) - cols = append(cols, createCol("IS_OLD", 6165)) - cols = append(cols, createCol("FREE_PAGE_CLOCK", 265)) + cols = append(cols, createCol("POOL_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("LRU_POSITION", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("SPACE", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PAGE_NUMBER", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PAGE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("FLUSH_TYPE", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("FIX_COUNT", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("IS_HASHED", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("NEWEST_MODIFICATION", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("OLDEST_MODIFICATION", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("ACCESS_TIME", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 1024, 0, false, "")) + cols = append(cols, createCol("INDEX_NAME", 6165, "utf8mb3_general_ci", "", 1024, 0, false, "")) + cols = append(cols, createCol("NUMBER_RECORDS", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("DATA_SIZE", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("COMPRESSED_SIZE", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("COMPRESSED", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("IO_FIX", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("IS_OLD", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("FREE_PAGE_CLOCK", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) infSchema["INNODB_BUFFER_PAGE_LRU"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("POOL_ID", 265)) - cols = append(cols, createCol("POOL_SIZE", 265)) - cols = append(cols, createCol("FREE_BUFFERS", 265)) - cols = append(cols, createCol("DATABASE_PAGES", 265)) - cols = append(cols, createCol("OLD_DATABASE_PAGES", 265)) - cols = append(cols, createCol("MODIFIED_DATABASE_PAGES", 265)) - cols = append(cols, createCol("PENDING_DECOMPRESS", 265)) - cols = append(cols, createCol("PENDING_READS", 265)) - cols = append(cols, createCol("PENDING_FLUSH_LRU", 265)) - cols = append(cols, createCol("PENDING_FLUSH_LIST", 265)) - cols = append(cols, createCol("PAGES_MADE_YOUNG", 265)) - cols = append(cols, createCol("PAGES_NOT_MADE_YOUNG", 265)) - cols = append(cols, createCol("PAGES_MADE_YOUNG_RATE", 1036)) - cols = append(cols, createCol("PAGES_MADE_NOT_YOUNG_RATE", 1036)) - cols = append(cols, createCol("NUMBER_PAGES_READ", 265)) - cols = append(cols, createCol("NUMBER_PAGES_CREATED", 265)) - cols = append(cols, createCol("NUMBER_PAGES_WRITTEN", 265)) - cols = append(cols, createCol("PAGES_READ_RATE", 1036)) - cols = append(cols, createCol("PAGES_CREATE_RATE", 1036)) - cols = append(cols, createCol("PAGES_WRITTEN_RATE", 1036)) - cols = append(cols, createCol("NUMBER_PAGES_GET", 265)) - cols = append(cols, createCol("HIT_RATE", 265)) - cols = append(cols, createCol("YOUNG_MAKE_PER_THOUSAND_GETS", 265)) - cols = append(cols, createCol("NOT_YOUNG_MAKE_PER_THOUSAND_GETS", 265)) - cols = append(cols, createCol("NUMBER_PAGES_READ_AHEAD", 265)) - cols = append(cols, createCol("NUMBER_READ_AHEAD_EVICTED", 265)) - cols = append(cols, createCol("READ_AHEAD_RATE", 1036)) - cols = append(cols, createCol("READ_AHEAD_EVICTED_RATE", 1036)) - cols = append(cols, createCol("LRU_IO_TOTAL", 265)) - cols = append(cols, createCol("LRU_IO_CURRENT", 265)) - cols = append(cols, createCol("UNCOMPRESS_TOTAL", 265)) - cols = append(cols, createCol("UNCOMPRESS_CURRENT", 265)) + cols = append(cols, createCol("POOL_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("POOL_SIZE", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("FREE_BUFFERS", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("DATABASE_PAGES", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("OLD_DATABASE_PAGES", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("MODIFIED_DATABASE_PAGES", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PENDING_DECOMPRESS", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PENDING_READS", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PENDING_FLUSH_LRU", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PENDING_FLUSH_LIST", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PAGES_MADE_YOUNG", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PAGES_NOT_MADE_YOUNG", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PAGES_MADE_YOUNG_RATE", 1036, "utf8mb3_general_ci", "0", 0, 0, true, "")) + cols = append(cols, createCol("PAGES_MADE_NOT_YOUNG_RATE", 1036, "utf8mb3_general_ci", "0", 0, 0, true, "")) + cols = append(cols, createCol("NUMBER_PAGES_READ", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("NUMBER_PAGES_CREATED", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("NUMBER_PAGES_WRITTEN", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PAGES_READ_RATE", 1036, "utf8mb3_general_ci", "0", 0, 0, true, "")) + cols = append(cols, createCol("PAGES_CREATE_RATE", 1036, "utf8mb3_general_ci", "0", 0, 0, true, "")) + cols = append(cols, createCol("PAGES_WRITTEN_RATE", 1036, "utf8mb3_general_ci", "0", 0, 0, true, "")) + cols = append(cols, createCol("NUMBER_PAGES_GET", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("HIT_RATE", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("YOUNG_MAKE_PER_THOUSAND_GETS", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("NOT_YOUNG_MAKE_PER_THOUSAND_GETS", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("NUMBER_PAGES_READ_AHEAD", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("NUMBER_READ_AHEAD_EVICTED", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("READ_AHEAD_RATE", 1036, "utf8mb3_general_ci", "0", 0, 0, true, "")) + cols = append(cols, createCol("READ_AHEAD_EVICTED_RATE", 1036, "utf8mb3_general_ci", "0", 0, 0, true, "")) + cols = append(cols, createCol("LRU_IO_TOTAL", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("LRU_IO_CURRENT", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("UNCOMPRESS_TOTAL", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("UNCOMPRESS_CURRENT", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) infSchema["INNODB_BUFFER_POOL_STATS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("page_size", 263)) - cols = append(cols, createCol("compress_ops", 263)) - cols = append(cols, createCol("compress_ops_ok", 263)) - cols = append(cols, createCol("compress_time", 263)) - cols = append(cols, createCol("uncompress_ops", 263)) - cols = append(cols, createCol("uncompress_time", 263)) + cols = append(cols, createCol("page_size", 263, "utf8mb3_general_ci", "0", 5, 0, true, "")) + cols = append(cols, createCol("compress_ops", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("compress_ops_ok", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("compress_time", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("uncompress_ops", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("uncompress_time", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) infSchema["INNODB_CMP"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("database_name", 6165)) - cols = append(cols, createCol("table_name", 6165)) - cols = append(cols, createCol("index_name", 6165)) - cols = append(cols, createCol("compress_ops", 263)) - cols = append(cols, createCol("compress_ops_ok", 263)) - cols = append(cols, createCol("compress_time", 263)) - cols = append(cols, createCol("uncompress_ops", 263)) - cols = append(cols, createCol("uncompress_time", 263)) + cols = append(cols, createCol("database_name", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("table_name", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("index_name", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("compress_ops", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("compress_ops_ok", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("compress_time", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("uncompress_ops", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("uncompress_time", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) infSchema["INNODB_CMP_PER_INDEX"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("database_name", 6165)) - cols = append(cols, createCol("table_name", 6165)) - cols = append(cols, createCol("index_name", 6165)) - cols = append(cols, createCol("compress_ops", 263)) - cols = append(cols, createCol("compress_ops_ok", 263)) - cols = append(cols, createCol("compress_time", 263)) - cols = append(cols, createCol("uncompress_ops", 263)) - cols = append(cols, createCol("uncompress_time", 263)) + cols = append(cols, createCol("database_name", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("table_name", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("index_name", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("compress_ops", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("compress_ops_ok", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("compress_time", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("uncompress_ops", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("uncompress_time", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) infSchema["INNODB_CMP_PER_INDEX_RESET"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("page_size", 263)) - cols = append(cols, createCol("compress_ops", 263)) - cols = append(cols, createCol("compress_ops_ok", 263)) - cols = append(cols, createCol("compress_time", 263)) - cols = append(cols, createCol("uncompress_ops", 263)) - cols = append(cols, createCol("uncompress_time", 263)) + cols = append(cols, createCol("page_size", 263, "utf8mb3_general_ci", "0", 5, 0, true, "")) + cols = append(cols, createCol("compress_ops", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("compress_ops_ok", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("compress_time", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("uncompress_ops", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("uncompress_time", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) infSchema["INNODB_CMP_RESET"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("page_size", 263)) - cols = append(cols, createCol("buffer_pool_instance", 263)) - cols = append(cols, createCol("pages_used", 263)) - cols = append(cols, createCol("pages_free", 263)) - cols = append(cols, createCol("relocation_ops", 265)) - cols = append(cols, createCol("relocation_time", 263)) + cols = append(cols, createCol("page_size", 263, "utf8mb3_general_ci", "0", 5, 0, true, "")) + cols = append(cols, createCol("buffer_pool_instance", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("pages_used", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("pages_free", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("relocation_ops", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("relocation_time", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) infSchema["INNODB_CMPMEM"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("page_size", 263)) - cols = append(cols, createCol("buffer_pool_instance", 263)) - cols = append(cols, createCol("pages_used", 263)) - cols = append(cols, createCol("pages_free", 263)) - cols = append(cols, createCol("relocation_ops", 265)) - cols = append(cols, createCol("relocation_time", 263)) + cols = append(cols, createCol("page_size", 263, "utf8mb3_general_ci", "0", 5, 0, true, "")) + cols = append(cols, createCol("buffer_pool_instance", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("pages_used", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("pages_free", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("relocation_ops", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("relocation_time", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) infSchema["INNODB_CMPMEM_RESET"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("DOC_ID", 265)) + cols = append(cols, createCol("DOC_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) infSchema["INNODB_FT_BEING_DELETED"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("KEY", 6165)) - cols = append(cols, createCol("VALUE", 6165)) + cols = append(cols, createCol("KEY", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("VALUE", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) infSchema["INNODB_FT_CONFIG"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("value", 6165)) + cols = append(cols, createCol("value", 6165, "utf8mb3_general_ci", "", 18, 0, true, "")) infSchema["INNODB_FT_DEFAULT_STOPWORD"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("DOC_ID", 265)) + cols = append(cols, createCol("DOC_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) infSchema["INNODB_FT_DELETED"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("WORD", 6165)) - cols = append(cols, createCol("FIRST_DOC_ID", 265)) - cols = append(cols, createCol("LAST_DOC_ID", 265)) - cols = append(cols, createCol("DOC_COUNT", 265)) - cols = append(cols, createCol("DOC_ID", 265)) - cols = append(cols, createCol("POSITION", 265)) + cols = append(cols, createCol("WORD", 6165, "utf8mb3_general_ci", "", 337, 0, true, "")) + cols = append(cols, createCol("FIRST_DOC_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("LAST_DOC_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("DOC_COUNT", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("DOC_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("POSITION", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) infSchema["INNODB_FT_INDEX_CACHE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("WORD", 6165)) - cols = append(cols, createCol("FIRST_DOC_ID", 265)) - cols = append(cols, createCol("LAST_DOC_ID", 265)) - cols = append(cols, createCol("DOC_COUNT", 265)) - cols = append(cols, createCol("DOC_ID", 265)) - cols = append(cols, createCol("POSITION", 265)) + cols = append(cols, createCol("WORD", 6165, "utf8mb3_general_ci", "", 337, 0, true, "")) + cols = append(cols, createCol("FIRST_DOC_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("LAST_DOC_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("DOC_COUNT", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("DOC_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("POSITION", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) infSchema["INNODB_FT_INDEX_TABLE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("requesting_trx_id", 6165)) - cols = append(cols, createCol("requested_lock_id", 6165)) - cols = append(cols, createCol("blocking_trx_id", 6165)) - cols = append(cols, createCol("blocking_lock_id", 6165)) - infSchema["INNODB_LOCK_WAITS"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("lock_id", 6165)) - cols = append(cols, createCol("lock_trx_id", 6165)) - cols = append(cols, createCol("lock_mode", 6165)) - cols = append(cols, createCol("lock_type", 6165)) - cols = append(cols, createCol("lock_table", 6165)) - cols = append(cols, createCol("lock_index", 6165)) - cols = append(cols, createCol("lock_space", 265)) - cols = append(cols, createCol("lock_page", 265)) - cols = append(cols, createCol("lock_rec", 265)) - cols = append(cols, createCol("lock_data", 6165)) - infSchema["INNODB_LOCKS"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("SUBSYSTEM", 6165)) - cols = append(cols, createCol("COUNT", 265)) - cols = append(cols, createCol("MAX_COUNT", 265)) - cols = append(cols, createCol("MIN_COUNT", 265)) - cols = append(cols, createCol("AVG_COUNT", 1036)) - cols = append(cols, createCol("COUNT_RESET", 265)) - cols = append(cols, createCol("MAX_COUNT_RESET", 265)) - cols = append(cols, createCol("MIN_COUNT_RESET", 265)) - cols = append(cols, createCol("AVG_COUNT_RESET", 1036)) - cols = append(cols, createCol("TIME_ENABLED", 2064)) - cols = append(cols, createCol("TIME_DISABLED", 2064)) - cols = append(cols, createCol("TIME_ELAPSED", 265)) - cols = append(cols, createCol("TIME_RESET", 2064)) - cols = append(cols, createCol("STATUS", 6165)) - cols = append(cols, createCol("TYPE", 6165)) - cols = append(cols, createCol("COMMENT", 6165)) + cols = append(cols, createCol("NAME", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("SUBSYSTEM", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("COUNT", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("MAX_COUNT", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("MIN_COUNT", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("AVG_COUNT", 1036, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("COUNT_RESET", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("MAX_COUNT_RESET", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("MIN_COUNT_RESET", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("AVG_COUNT_RESET", 1036, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TIME_ENABLED", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TIME_DISABLED", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TIME_ELAPSED", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("TIME_RESET", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("STATUS", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("TYPE", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("COMMENT", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) infSchema["INNODB_METRICS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_ID", 265)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("POS", 265)) - cols = append(cols, createCol("MTYPE", 263)) - cols = append(cols, createCol("PRTYPE", 263)) - cols = append(cols, createCol("LEN", 263)) - infSchema["INNODB_SYS_COLUMNS"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("SPACE", 263)) - cols = append(cols, createCol("PATH", 6165)) - infSchema["INNODB_SYS_DATAFILES"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("INDEX_ID", 265)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("POS", 263)) - infSchema["INNODB_SYS_FIELDS"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("ID", 6165)) - cols = append(cols, createCol("FOR_NAME", 6165)) - cols = append(cols, createCol("REF_NAME", 6165)) - cols = append(cols, createCol("N_COLS", 263)) - cols = append(cols, createCol("TYPE", 263)) - infSchema["INNODB_SYS_FOREIGN"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("ID", 6165)) - cols = append(cols, createCol("FOR_COL_NAME", 6165)) - cols = append(cols, createCol("REF_COL_NAME", 6165)) - cols = append(cols, createCol("POS", 263)) - infSchema["INNODB_SYS_FOREIGN_COLS"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("INDEX_ID", 265)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("TABLE_ID", 265)) - cols = append(cols, createCol("TYPE", 263)) - cols = append(cols, createCol("N_FIELDS", 263)) - cols = append(cols, createCol("PAGE_NO", 263)) - cols = append(cols, createCol("SPACE", 263)) - cols = append(cols, createCol("MERGE_THRESHOLD", 263)) - infSchema["INNODB_SYS_INDEXES"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_ID", 265)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("FLAG", 263)) - cols = append(cols, createCol("N_COLS", 263)) - cols = append(cols, createCol("SPACE", 263)) - cols = append(cols, createCol("FILE_FORMAT", 6165)) - cols = append(cols, createCol("ROW_FORMAT", 6165)) - cols = append(cols, createCol("ZIP_PAGE_SIZE", 263)) - cols = append(cols, createCol("SPACE_TYPE", 6165)) - infSchema["INNODB_SYS_TABLES"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("SPACE", 263)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("FLAG", 263)) - cols = append(cols, createCol("FILE_FORMAT", 6165)) - cols = append(cols, createCol("ROW_FORMAT", 6165)) - cols = append(cols, createCol("PAGE_SIZE", 263)) - cols = append(cols, createCol("ZIP_PAGE_SIZE", 263)) - cols = append(cols, createCol("SPACE_TYPE", 6165)) - cols = append(cols, createCol("FS_BLOCK_SIZE", 263)) - cols = append(cols, createCol("FILE_SIZE", 265)) - cols = append(cols, createCol("ALLOCATED_SIZE", 265)) - infSchema["INNODB_SYS_TABLESPACES"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_ID", 265)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("STATS_INITIALIZED", 6165)) - cols = append(cols, createCol("NUM_ROWS", 265)) - cols = append(cols, createCol("CLUST_INDEX_SIZE", 265)) - cols = append(cols, createCol("OTHER_INDEX_SIZE", 265)) - cols = append(cols, createCol("MODIFIED_COUNTER", 265)) - cols = append(cols, createCol("AUTOINC", 265)) - cols = append(cols, createCol("REF_COUNT", 263)) - infSchema["INNODB_SYS_TABLESTATS"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_ID", 265)) - cols = append(cols, createCol("POS", 263)) - cols = append(cols, createCol("BASE_POS", 263)) - infSchema["INNODB_SYS_VIRTUAL"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_ID", 265)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("N_COLS", 263)) - cols = append(cols, createCol("SPACE", 263)) - cols = append(cols, createCol("PER_TABLE_TABLESPACE", 6165)) - cols = append(cols, createCol("IS_COMPRESSED", 6165)) + cols = append(cols, createCol("TABLE_ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("NAME", 6165, "utf8mb3_general_ci", "", 202, 0, false, "")) + cols = append(cols, createCol("N_COLS", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("SPACE", 263, "utf8mb3_general_ci", "0", 11, 0, true, "")) + cols = append(cols, createCol("PER_TABLE_TABLESPACE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("IS_COMPRESSED", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) infSchema["INNODB_TEMP_TABLE_INFO"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("trx_id", 6165)) - cols = append(cols, createCol("trx_state", 6165)) - cols = append(cols, createCol("trx_started", 2064)) - cols = append(cols, createCol("trx_requested_lock_id", 6165)) - cols = append(cols, createCol("trx_wait_started", 2064)) - cols = append(cols, createCol("trx_weight", 265)) - cols = append(cols, createCol("trx_mysql_thread_id", 265)) - cols = append(cols, createCol("trx_query", 6165)) - cols = append(cols, createCol("trx_operation_state", 6165)) - cols = append(cols, createCol("trx_tables_in_use", 265)) - cols = append(cols, createCol("trx_tables_locked", 265)) - cols = append(cols, createCol("trx_lock_structs", 265)) - cols = append(cols, createCol("trx_lock_memory_bytes", 265)) - cols = append(cols, createCol("trx_rows_locked", 265)) - cols = append(cols, createCol("trx_rows_modified", 265)) - cols = append(cols, createCol("trx_concurrency_tickets", 265)) - cols = append(cols, createCol("trx_isolation_level", 6165)) - cols = append(cols, createCol("trx_unique_checks", 263)) - cols = append(cols, createCol("trx_foreign_key_checks", 263)) - cols = append(cols, createCol("trx_last_foreign_key_error", 6165)) - cols = append(cols, createCol("trx_adaptive_hash_latched", 263)) - cols = append(cols, createCol("trx_adaptive_hash_timeout", 265)) - cols = append(cols, createCol("trx_is_read_only", 263)) - cols = append(cols, createCol("trx_autocommit_non_locking", 263)) + cols = append(cols, createCol("trx_id", 6165, "utf8mb3_general_ci", "", 18, 0, true, "")) + cols = append(cols, createCol("trx_state", 6165, "utf8mb3_general_ci", "", 13, 0, true, "")) + cols = append(cols, createCol("trx_started", 2064, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_requested_lock_id", 6165, "utf8mb3_general_ci", "", 81, 0, false, "")) + cols = append(cols, createCol("trx_wait_started", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("trx_weight", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("trx_mysql_thread_id", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("trx_query", 6165, "utf8mb3_general_ci", "", 1024, 0, false, "")) + cols = append(cols, createCol("trx_operation_state", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("trx_tables_in_use", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("trx_tables_locked", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("trx_lock_structs", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("trx_lock_memory_bytes", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("trx_rows_locked", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("trx_rows_modified", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("trx_concurrency_tickets", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("trx_isolation_level", 6165, "utf8mb3_general_ci", "", 16, 0, true, "")) + cols = append(cols, createCol("trx_unique_checks", 263, "utf8mb3_general_ci", "0", 1, 0, true, "")) + cols = append(cols, createCol("trx_foreign_key_checks", 263, "utf8mb3_general_ci", "0", 1, 0, true, "")) + cols = append(cols, createCol("trx_last_foreign_key_error", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("trx_adaptive_hash_latched", 263, "utf8mb3_general_ci", "0", 1, 0, true, "")) + cols = append(cols, createCol("trx_adaptive_hash_timeout", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("trx_is_read_only", 263, "utf8mb3_general_ci", "0", 1, 0, true, "")) + cols = append(cols, createCol("trx_autocommit_non_locking", 263, "utf8mb3_general_ci", "0", 1, 0, true, "")) infSchema["INNODB_TRX"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165)) - cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165)) - cols = append(cols, createCol("CONSTRAINT_NAME", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("COLUMN_NAME", 6165)) - cols = append(cols, createCol("ORDINAL_POSITION", 265)) - cols = append(cols, createCol("POSITION_IN_UNIQUE_CONSTRAINT", 265)) - cols = append(cols, createCol("REFERENCED_TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("REFERENCED_TABLE_NAME", 6165)) - cols = append(cols, createCol("REFERENCED_COLUMN_NAME", 6165)) + cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CONSTRAINT_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ORDINAL_POSITION", 265, "utf8mb3_general_ci", "0", 10, 0, true, "")) + cols = append(cols, createCol("POSITION_IN_UNIQUE_CONSTRAINT", 265, "utf8mb3_general_ci", "", 10, 0, false, "")) + cols = append(cols, createCol("REFERENCED_TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("REFERENCED_TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("REFERENCED_COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) infSchema["KEY_COLUMN_USAGE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("QUERY", 6163)) - cols = append(cols, createCol("TRACE", 6163)) - cols = append(cols, createCol("MISSING_BYTES_BEYOND_MAX_MEM_SIZE", 263)) - cols = append(cols, createCol("INSUFFICIENT_PRIVILEGES", 257)) + cols = append(cols, createCol("QUERY", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("TRACE", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("MISSING_BYTES_BEYOND_MAX_MEM_SIZE", 263, "utf8mb3_general_ci", "0", 20, 0, true, "")) + cols = append(cols, createCol("INSUFFICIENT_PRIVILEGES", 257, "utf8mb3_general_ci", "0", 1, 0, true, "")) infSchema["OPTIMIZER_TRACE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("SPECIFIC_CATALOG", 6165)) - cols = append(cols, createCol("SPECIFIC_SCHEMA", 6165)) - cols = append(cols, createCol("SPECIFIC_NAME", 6165)) - cols = append(cols, createCol("ORDINAL_POSITION", 263)) - cols = append(cols, createCol("PARAMETER_MODE", 6165)) - cols = append(cols, createCol("PARAMETER_NAME", 6165)) - cols = append(cols, createCol("DATA_TYPE", 6165)) - cols = append(cols, createCol("CHARACTER_MAXIMUM_LENGTH", 263)) - cols = append(cols, createCol("CHARACTER_OCTET_LENGTH", 263)) - cols = append(cols, createCol("NUMERIC_PRECISION", 265)) - cols = append(cols, createCol("NUMERIC_SCALE", 263)) - cols = append(cols, createCol("DATETIME_PRECISION", 265)) - cols = append(cols, createCol("CHARACTER_SET_NAME", 6165)) - cols = append(cols, createCol("COLLATION_NAME", 6165)) - cols = append(cols, createCol("DTD_IDENTIFIER", 6163)) - cols = append(cols, createCol("ROUTINE_TYPE", 6165)) + cols = append(cols, createCol("SPECIFIC_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("SPECIFIC_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("SPECIFIC_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ORDINAL_POSITION", 263, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("PARAMETER_MODE", 6165, "utf8mb3_general_ci", "", 5, 0, false, "")) + cols = append(cols, createCol("PARAMETER_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("DATA_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CHARACTER_MAXIMUM_LENGTH", 263, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("CHARACTER_OCTET_LENGTH", 263, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("NUMERIC_PRECISION", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("NUMERIC_SCALE", 263, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("DATETIME_PRECISION", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("COLLATION_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("DTD_IDENTIFIER", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ROUTINE_TYPE", 6165, "utf8mb3_general_ci", "", 9, 0, true, "")) infSchema["PARAMETERS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("PARTITION_NAME", 6165)) - cols = append(cols, createCol("SUBPARTITION_NAME", 6165)) - cols = append(cols, createCol("PARTITION_ORDINAL_POSITION", 265)) - cols = append(cols, createCol("SUBPARTITION_ORDINAL_POSITION", 265)) - cols = append(cols, createCol("PARTITION_METHOD", 6165)) - cols = append(cols, createCol("SUBPARTITION_METHOD", 6165)) - cols = append(cols, createCol("PARTITION_EXPRESSION", 6163)) - cols = append(cols, createCol("SUBPARTITION_EXPRESSION", 6163)) - cols = append(cols, createCol("PARTITION_DESCRIPTION", 6163)) - cols = append(cols, createCol("TABLE_ROWS", 265)) - cols = append(cols, createCol("AVG_ROW_LENGTH", 265)) - cols = append(cols, createCol("DATA_LENGTH", 265)) - cols = append(cols, createCol("MAX_DATA_LENGTH", 265)) - cols = append(cols, createCol("INDEX_LENGTH", 265)) - cols = append(cols, createCol("DATA_FREE", 265)) - cols = append(cols, createCol("CREATE_TIME", 2064)) - cols = append(cols, createCol("UPDATE_TIME", 2064)) - cols = append(cols, createCol("CHECK_TIME", 2064)) - cols = append(cols, createCol("CHECKSUM", 265)) - cols = append(cols, createCol("PARTITION_COMMENT", 6165)) - cols = append(cols, createCol("NODEGROUP", 6165)) - cols = append(cols, createCol("TABLESPACE_NAME", 6165)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PARTITION_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("SUBPARTITION_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("PARTITION_ORDINAL_POSITION", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("SUBPARTITION_ORDINAL_POSITION", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("PARTITION_METHOD", 6165, "utf8mb3_general_ci", "", 18, 0, false, "")) + cols = append(cols, createCol("SUBPARTITION_METHOD", 6165, "utf8mb3_general_ci", "", 12, 0, false, "")) + cols = append(cols, createCol("PARTITION_EXPRESSION", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("SUBPARTITION_EXPRESSION", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("PARTITION_DESCRIPTION", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TABLE_ROWS", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("AVG_ROW_LENGTH", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("DATA_LENGTH", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("MAX_DATA_LENGTH", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("INDEX_LENGTH", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("DATA_FREE", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("CREATE_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("UPDATE_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHECK_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHECKSUM", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("PARTITION_COMMENT", 6165, "utf8mb3_general_ci", "", 80, 0, true, "")) + cols = append(cols, createCol("NODEGROUP", 6165, "utf8mb3_general_ci", "", 12, 0, true, "")) + cols = append(cols, createCol("TABLESPACE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) infSchema["PARTITIONS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("PLUGIN_NAME", 6165)) - cols = append(cols, createCol("PLUGIN_VERSION", 6165)) - cols = append(cols, createCol("PLUGIN_STATUS", 6165)) - cols = append(cols, createCol("PLUGIN_TYPE", 6165)) - cols = append(cols, createCol("PLUGIN_TYPE_VERSION", 6165)) - cols = append(cols, createCol("PLUGIN_LIBRARY", 6165)) - cols = append(cols, createCol("PLUGIN_LIBRARY_VERSION", 6165)) - cols = append(cols, createCol("PLUGIN_AUTHOR", 6165)) - cols = append(cols, createCol("PLUGIN_DESCRIPTION", 6163)) - cols = append(cols, createCol("PLUGIN_LICENSE", 6165)) - cols = append(cols, createCol("LOAD_OPTION", 6165)) + cols = append(cols, createCol("PLUGIN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PLUGIN_VERSION", 6165, "utf8mb3_general_ci", "", 20, 0, true, "")) + cols = append(cols, createCol("PLUGIN_STATUS", 6165, "utf8mb3_general_ci", "", 10, 0, true, "")) + cols = append(cols, createCol("PLUGIN_TYPE", 6165, "utf8mb3_general_ci", "", 80, 0, true, "")) + cols = append(cols, createCol("PLUGIN_TYPE_VERSION", 6165, "utf8mb3_general_ci", "", 20, 0, true, "")) + cols = append(cols, createCol("PLUGIN_LIBRARY", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("PLUGIN_LIBRARY_VERSION", 6165, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("PLUGIN_AUTHOR", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("PLUGIN_DESCRIPTION", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("PLUGIN_LICENSE", 6165, "utf8mb3_general_ci", "", 80, 0, false, "")) + cols = append(cols, createCol("LOAD_OPTION", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) infSchema["PLUGINS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("ID", 265)) - cols = append(cols, createCol("USER", 6165)) - cols = append(cols, createCol("HOST", 6165)) - cols = append(cols, createCol("DB", 6165)) - cols = append(cols, createCol("COMMAND", 6165)) - cols = append(cols, createCol("TIME", 263)) - cols = append(cols, createCol("STATE", 6165)) - cols = append(cols, createCol("INFO", 6163)) + cols = append(cols, createCol("ID", 265, "utf8mb3_general_ci", "0", 21, 0, true, "")) + cols = append(cols, createCol("USER", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("HOST", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("DB", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("COMMAND", 6165, "utf8mb3_general_ci", "", 16, 0, true, "")) + cols = append(cols, createCol("TIME", 263, "utf8mb3_general_ci", "0", 7, 0, true, "")) + cols = append(cols, createCol("STATE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("INFO", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["PROCESSLIST"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("QUERY_ID", 263)) - cols = append(cols, createCol("SEQ", 263)) - cols = append(cols, createCol("STATE", 6165)) - cols = append(cols, createCol("DURATION", 18)) - cols = append(cols, createCol("CPU_USER", 18)) - cols = append(cols, createCol("CPU_SYSTEM", 18)) - cols = append(cols, createCol("CONTEXT_VOLUNTARY", 263)) - cols = append(cols, createCol("CONTEXT_INVOLUNTARY", 263)) - cols = append(cols, createCol("BLOCK_OPS_IN", 263)) - cols = append(cols, createCol("BLOCK_OPS_OUT", 263)) - cols = append(cols, createCol("MESSAGES_SENT", 263)) - cols = append(cols, createCol("MESSAGES_RECEIVED", 263)) - cols = append(cols, createCol("PAGE_FAULTS_MAJOR", 263)) - cols = append(cols, createCol("PAGE_FAULTS_MINOR", 263)) - cols = append(cols, createCol("SWAPS", 263)) - cols = append(cols, createCol("SOURCE_FUNCTION", 6165)) - cols = append(cols, createCol("SOURCE_FILE", 6165)) - cols = append(cols, createCol("SOURCE_LINE", 263)) + cols = append(cols, createCol("QUERY_ID", 263, "utf8mb3_general_ci", "0", 20, 0, true, "")) + cols = append(cols, createCol("SEQ", 263, "utf8mb3_general_ci", "0", 20, 0, true, "")) + cols = append(cols, createCol("STATE", 6165, "utf8mb3_general_ci", "", 30, 0, true, "")) + cols = append(cols, createCol("DURATION", 18, "utf8mb3_general_ci", "0.000000", 9, 6, true, "")) + cols = append(cols, createCol("CPU_USER", 18, "utf8mb3_general_ci", "", 9, 6, false, "")) + cols = append(cols, createCol("CPU_SYSTEM", 18, "utf8mb3_general_ci", "", 9, 6, false, "")) + cols = append(cols, createCol("CONTEXT_VOLUNTARY", 263, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("CONTEXT_INVOLUNTARY", 263, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("BLOCK_OPS_IN", 263, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("BLOCK_OPS_OUT", 263, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("MESSAGES_SENT", 263, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("MESSAGES_RECEIVED", 263, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("PAGE_FAULTS_MAJOR", 263, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("PAGE_FAULTS_MINOR", 263, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("SWAPS", 263, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("SOURCE_FUNCTION", 6165, "utf8mb3_general_ci", "", 30, 0, false, "")) + cols = append(cols, createCol("SOURCE_FILE", 6165, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("SOURCE_LINE", 263, "utf8mb3_general_ci", "", 20, 0, false, "")) infSchema["PROFILING"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165)) - cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165)) - cols = append(cols, createCol("CONSTRAINT_NAME", 6165)) - cols = append(cols, createCol("UNIQUE_CONSTRAINT_CATALOG", 6165)) - cols = append(cols, createCol("UNIQUE_CONSTRAINT_SCHEMA", 6165)) - cols = append(cols, createCol("UNIQUE_CONSTRAINT_NAME", 6165)) - cols = append(cols, createCol("MATCH_OPTION", 6165)) - cols = append(cols, createCol("UPDATE_RULE", 6165)) - cols = append(cols, createCol("DELETE_RULE", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("REFERENCED_TABLE_NAME", 6165)) + cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CONSTRAINT_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("UNIQUE_CONSTRAINT_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("UNIQUE_CONSTRAINT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("UNIQUE_CONSTRAINT_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("MATCH_OPTION", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("UPDATE_RULE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("DELETE_RULE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("REFERENCED_TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) infSchema["REFERENTIAL_CONSTRAINTS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("SPECIFIC_NAME", 6165)) - cols = append(cols, createCol("ROUTINE_CATALOG", 6165)) - cols = append(cols, createCol("ROUTINE_SCHEMA", 6165)) - cols = append(cols, createCol("ROUTINE_NAME", 6165)) - cols = append(cols, createCol("ROUTINE_TYPE", 6165)) - cols = append(cols, createCol("DATA_TYPE", 6165)) - cols = append(cols, createCol("CHARACTER_MAXIMUM_LENGTH", 263)) - cols = append(cols, createCol("CHARACTER_OCTET_LENGTH", 263)) - cols = append(cols, createCol("NUMERIC_PRECISION", 265)) - cols = append(cols, createCol("NUMERIC_SCALE", 263)) - cols = append(cols, createCol("DATETIME_PRECISION", 265)) - cols = append(cols, createCol("CHARACTER_SET_NAME", 6165)) - cols = append(cols, createCol("COLLATION_NAME", 6165)) - cols = append(cols, createCol("DTD_IDENTIFIER", 6163)) - cols = append(cols, createCol("ROUTINE_BODY", 6165)) - cols = append(cols, createCol("ROUTINE_DEFINITION", 6163)) - cols = append(cols, createCol("EXTERNAL_NAME", 6165)) - cols = append(cols, createCol("EXTERNAL_LANGUAGE", 6165)) - cols = append(cols, createCol("PARAMETER_STYLE", 6165)) - cols = append(cols, createCol("IS_DETERMINISTIC", 6165)) - cols = append(cols, createCol("SQL_DATA_ACCESS", 6165)) - cols = append(cols, createCol("SQL_PATH", 6165)) - cols = append(cols, createCol("SECURITY_TYPE", 6165)) - cols = append(cols, createCol("CREATED", 2064)) - cols = append(cols, createCol("LAST_ALTERED", 2064)) - cols = append(cols, createCol("SQL_MODE", 6165)) - cols = append(cols, createCol("ROUTINE_COMMENT", 6163)) - cols = append(cols, createCol("DEFINER", 6165)) - cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165)) - cols = append(cols, createCol("COLLATION_CONNECTION", 6165)) - cols = append(cols, createCol("DATABASE_COLLATION", 6165)) + cols = append(cols, createCol("SPECIFIC_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ROUTINE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("ROUTINE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ROUTINE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ROUTINE_TYPE", 6165, "utf8mb3_general_ci", "", 9, 0, true, "")) + cols = append(cols, createCol("DATA_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CHARACTER_MAXIMUM_LENGTH", 263, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("CHARACTER_OCTET_LENGTH", 263, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("NUMERIC_PRECISION", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("NUMERIC_SCALE", 263, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("DATETIME_PRECISION", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("COLLATION_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("DTD_IDENTIFIER", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("ROUTINE_BODY", 6165, "utf8mb3_general_ci", "", 8, 0, true, "")) + cols = append(cols, createCol("ROUTINE_DEFINITION", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("EXTERNAL_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("EXTERNAL_LANGUAGE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("PARAMETER_STYLE", 6165, "utf8mb3_general_ci", "", 8, 0, true, "")) + cols = append(cols, createCol("IS_DETERMINISTIC", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("SQL_DATA_ACCESS", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("SQL_PATH", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("SECURITY_TYPE", 6165, "utf8mb3_general_ci", "", 7, 0, true, "")) + cols = append(cols, createCol("CREATED", 2064, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("LAST_ALTERED", 2064, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SQL_MODE", 6165, "utf8mb3_general_ci", "", 8192, 0, true, "")) + cols = append(cols, createCol("ROUTINE_COMMENT", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("DEFINER", 6165, "utf8mb3_general_ci", "", 93, 0, true, "")) + cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("COLLATION_CONNECTION", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("DATABASE_COLLATION", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) infSchema["ROUTINES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("GRANTEE", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("PRIVILEGE_TYPE", 6165)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) + cols = append(cols, createCol("GRANTEE", 6165, "utf8mb3_general_ci", "", 81, 0, true, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PRIVILEGE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["SCHEMA_PRIVILEGES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("CATALOG_NAME", 6165)) - cols = append(cols, createCol("SCHEMA_NAME", 6165)) - cols = append(cols, createCol("DEFAULT_CHARACTER_SET_NAME", 6165)) - cols = append(cols, createCol("DEFAULT_COLLATION_NAME", 6165)) - cols = append(cols, createCol("SQL_PATH", 6165)) + cols = append(cols, createCol("CATALOG_NAME", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("SCHEMA_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("DEFAULT_CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("DEFAULT_COLLATION_NAME", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("SQL_PATH", 6165, "utf8mb3_general_ci", "", 512, 0, false, "")) infSchema["SCHEMATA"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("VARIABLE_NAME", 6165)) - cols = append(cols, createCol("VARIABLE_VALUE", 6165)) - infSchema["SESSION_STATUS"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("VARIABLE_NAME", 6165)) - cols = append(cols, createCol("VARIABLE_VALUE", 6165)) - infSchema["SESSION_VARIABLES"] = cols - cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("NON_UNIQUE", 265)) - cols = append(cols, createCol("INDEX_SCHEMA", 6165)) - cols = append(cols, createCol("INDEX_NAME", 6165)) - cols = append(cols, createCol("SEQ_IN_INDEX", 265)) - cols = append(cols, createCol("COLUMN_NAME", 6165)) - cols = append(cols, createCol("COLLATION", 6165)) - cols = append(cols, createCol("CARDINALITY", 265)) - cols = append(cols, createCol("SUB_PART", 265)) - cols = append(cols, createCol("PACKED", 6165)) - cols = append(cols, createCol("NULLABLE", 6165)) - cols = append(cols, createCol("INDEX_TYPE", 6165)) - cols = append(cols, createCol("COMMENT", 6165)) - cols = append(cols, createCol("INDEX_COMMENT", 6165)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("NON_UNIQUE", 265, "utf8mb3_general_ci", "0", 1, 0, true, "")) + cols = append(cols, createCol("INDEX_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("INDEX_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("SEQ_IN_INDEX", 265, "utf8mb3_general_ci", "0", 2, 0, true, "")) + cols = append(cols, createCol("COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("COLLATION", 6165, "utf8mb3_general_ci", "", 1, 0, false, "")) + cols = append(cols, createCol("CARDINALITY", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("SUB_PART", 265, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("PACKED", 6165, "utf8mb3_general_ci", "", 10, 0, false, "")) + cols = append(cols, createCol("NULLABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("INDEX_TYPE", 6165, "utf8mb3_general_ci", "", 16, 0, true, "")) + cols = append(cols, createCol("COMMENT", 6165, "utf8mb3_general_ci", "", 16, 0, false, "")) + cols = append(cols, createCol("INDEX_COMMENT", 6165, "utf8mb3_general_ci", "", 1024, 0, true, "")) infSchema["STATISTICS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165)) - cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165)) - cols = append(cols, createCol("CONSTRAINT_NAME", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("CONSTRAINT_TYPE", 6165)) + cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CONSTRAINT_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CONSTRAINT_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) infSchema["TABLE_CONSTRAINTS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("GRANTEE", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("PRIVILEGE_TYPE", 6165)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) + cols = append(cols, createCol("GRANTEE", 6165, "utf8mb3_general_ci", "", 81, 0, true, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PRIVILEGE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["TABLE_PRIVILEGES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("TABLE_TYPE", 6165)) - cols = append(cols, createCol("ENGINE", 6165)) - cols = append(cols, createCol("VERSION", 265)) - cols = append(cols, createCol("ROW_FORMAT", 6165)) - cols = append(cols, createCol("TABLE_ROWS", 265)) - cols = append(cols, createCol("AVG_ROW_LENGTH", 265)) - cols = append(cols, createCol("DATA_LENGTH", 265)) - cols = append(cols, createCol("MAX_DATA_LENGTH", 265)) - cols = append(cols, createCol("INDEX_LENGTH", 265)) - cols = append(cols, createCol("DATA_FREE", 265)) - cols = append(cols, createCol("AUTO_INCREMENT", 265)) - cols = append(cols, createCol("CREATE_TIME", 2064)) - cols = append(cols, createCol("UPDATE_TIME", 2064)) - cols = append(cols, createCol("CHECK_TIME", 2064)) - cols = append(cols, createCol("TABLE_COLLATION", 6165)) - cols = append(cols, createCol("CHECKSUM", 265)) - cols = append(cols, createCol("CREATE_OPTIONS", 6165)) - cols = append(cols, createCol("TABLE_COMMENT", 6165)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ENGINE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("VERSION", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("ROW_FORMAT", 6165, "utf8mb3_general_ci", "", 10, 0, false, "")) + cols = append(cols, createCol("TABLE_ROWS", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("AVG_ROW_LENGTH", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("DATA_LENGTH", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("MAX_DATA_LENGTH", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("INDEX_LENGTH", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("DATA_FREE", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("AUTO_INCREMENT", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("CREATE_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("UPDATE_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHECK_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TABLE_COLLATION", 6165, "utf8mb3_general_ci", "", 32, 0, false, "")) + cols = append(cols, createCol("CHECKSUM", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("CREATE_OPTIONS", 6165, "utf8mb3_general_ci", "", 255, 0, false, "")) + cols = append(cols, createCol("TABLE_COMMENT", 6165, "utf8mb3_general_ci", "", 2048, 0, true, "")) infSchema["TABLES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLESPACE_NAME", 6165)) - cols = append(cols, createCol("ENGINE", 6165)) - cols = append(cols, createCol("TABLESPACE_TYPE", 6165)) - cols = append(cols, createCol("LOGFILE_GROUP_NAME", 6165)) - cols = append(cols, createCol("EXTENT_SIZE", 265)) - cols = append(cols, createCol("AUTOEXTEND_SIZE", 265)) - cols = append(cols, createCol("MAXIMUM_SIZE", 265)) - cols = append(cols, createCol("NODEGROUP_ID", 265)) - cols = append(cols, createCol("TABLESPACE_COMMENT", 6165)) + cols = append(cols, createCol("TABLESPACE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ENGINE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLESPACE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("LOGFILE_GROUP_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("EXTENT_SIZE", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("AUTOEXTEND_SIZE", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("MAXIMUM_SIZE", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("NODEGROUP_ID", 265, "utf8mb3_general_ci", "", 21, 0, false, "")) + cols = append(cols, createCol("TABLESPACE_COMMENT", 6165, "utf8mb3_general_ci", "", 2048, 0, false, "")) infSchema["TABLESPACES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TRIGGER_CATALOG", 6165)) - cols = append(cols, createCol("TRIGGER_SCHEMA", 6165)) - cols = append(cols, createCol("TRIGGER_NAME", 6165)) - cols = append(cols, createCol("EVENT_MANIPULATION", 6165)) - cols = append(cols, createCol("EVENT_OBJECT_CATALOG", 6165)) - cols = append(cols, createCol("EVENT_OBJECT_SCHEMA", 6165)) - cols = append(cols, createCol("EVENT_OBJECT_TABLE", 6165)) - cols = append(cols, createCol("ACTION_ORDER", 265)) - cols = append(cols, createCol("ACTION_CONDITION", 6163)) - cols = append(cols, createCol("ACTION_STATEMENT", 6163)) - cols = append(cols, createCol("ACTION_ORIENTATION", 6165)) - cols = append(cols, createCol("ACTION_TIMING", 6165)) - cols = append(cols, createCol("ACTION_REFERENCE_OLD_TABLE", 6165)) - cols = append(cols, createCol("ACTION_REFERENCE_NEW_TABLE", 6165)) - cols = append(cols, createCol("ACTION_REFERENCE_OLD_ROW", 6165)) - cols = append(cols, createCol("ACTION_REFERENCE_NEW_ROW", 6165)) - cols = append(cols, createCol("CREATED", 2064)) - cols = append(cols, createCol("SQL_MODE", 6165)) - cols = append(cols, createCol("DEFINER", 6165)) - cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165)) - cols = append(cols, createCol("COLLATION_CONNECTION", 6165)) - cols = append(cols, createCol("DATABASE_COLLATION", 6165)) + cols = append(cols, createCol("TRIGGER_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TRIGGER_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TRIGGER_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("EVENT_MANIPULATION", 6165, "utf8mb3_general_ci", "", 6, 0, true, "")) + cols = append(cols, createCol("EVENT_OBJECT_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("EVENT_OBJECT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("EVENT_OBJECT_TABLE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ACTION_ORDER", 265, "utf8mb3_general_ci", "0", 4, 0, true, "")) + cols = append(cols, createCol("ACTION_CONDITION", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("ACTION_STATEMENT", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ACTION_ORIENTATION", 6165, "utf8mb3_general_ci", "", 9, 0, true, "")) + cols = append(cols, createCol("ACTION_TIMING", 6165, "utf8mb3_general_ci", "", 6, 0, true, "")) + cols = append(cols, createCol("ACTION_REFERENCE_OLD_TABLE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("ACTION_REFERENCE_NEW_TABLE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("ACTION_REFERENCE_OLD_ROW", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("ACTION_REFERENCE_NEW_ROW", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("CREATED", 2064, "utf8mb3_general_ci", "", 2, 0, false, "")) + cols = append(cols, createCol("SQL_MODE", 6165, "utf8mb3_general_ci", "", 8192, 0, true, "")) + cols = append(cols, createCol("DEFINER", 6165, "utf8mb3_general_ci", "", 93, 0, true, "")) + cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("COLLATION_CONNECTION", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("DATABASE_COLLATION", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) infSchema["TRIGGERS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("GRANTEE", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("PRIVILEGE_TYPE", 6165)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) + cols = append(cols, createCol("GRANTEE", 6165, "utf8mb3_general_ci", "", 81, 0, true, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("PRIVILEGE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["USER_PRIVILEGES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("VIEW_DEFINITION", 6163)) - cols = append(cols, createCol("CHECK_OPTION", 6165)) - cols = append(cols, createCol("IS_UPDATABLE", 6165)) - cols = append(cols, createCol("DEFINER", 6165)) - cols = append(cols, createCol("SECURITY_TYPE", 6165)) - cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165)) - cols = append(cols, createCol("COLLATION_CONNECTION", 6165)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("VIEW_DEFINITION", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("CHECK_OPTION", 6165, "utf8mb3_general_ci", "", 8, 0, true, "")) + cols = append(cols, createCol("IS_UPDATABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("DEFINER", 6165, "utf8mb3_general_ci", "", 93, 0, true, "")) + cols = append(cols, createCol("SECURITY_TYPE", 6165, "utf8mb3_general_ci", "", 7, 0, true, "")) + cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("COLLATION_CONNECTION", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) infSchema["VIEWS"] = cols - return infSchema } @@ -774,896 +697,896 @@ func getInfoSchema57() map[string][]vindexes.Column { func getInfoSchema80() map[string][]vindexes.Column { infSchema := map[string][]vindexes.Column{} var cols []vindexes.Column - cols = append(cols, createCol("USER", 6165)) - cols = append(cols, createCol("HOST", 6165)) - cols = append(cols, createCol("GRANTEE", 6165)) - cols = append(cols, createCol("GRANTEE_HOST", 6165)) - cols = append(cols, createCol("ROLE_NAME", 6165)) - cols = append(cols, createCol("ROLE_HOST", 6165)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) - cols = append(cols, createCol("IS_DEFAULT", 6165)) - cols = append(cols, createCol("IS_MANDATORY", 6165)) + cols = append(cols, createCol("USER", 6165, "utf8mb3_general_ci", "", 97, 0, false, "")) + cols = append(cols, createCol("HOST", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("GRANTEE", 6165, "utf8mb3_general_ci", "", 97, 0, false, "")) + cols = append(cols, createCol("GRANTEE_HOST", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("ROLE_NAME", 6165, "utf8mb3_general_ci", "", 255, 0, false, "")) + cols = append(cols, createCol("ROLE_HOST", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("IS_DEFAULT", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("IS_MANDATORY", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["ADMINISTRABLE_ROLE_AUTHORIZATIONS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("USER", 6165)) - cols = append(cols, createCol("HOST", 6165)) - cols = append(cols, createCol("GRANTEE", 6165)) - cols = append(cols, createCol("GRANTEE_HOST", 6165)) - cols = append(cols, createCol("ROLE_NAME", 6165)) - cols = append(cols, createCol("ROLE_HOST", 6165)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) - cols = append(cols, createCol("IS_DEFAULT", 6165)) - cols = append(cols, createCol("IS_MANDATORY", 6165)) + cols = append(cols, createCol("USER", 6165, "utf8mb3_general_ci", "", 97, 0, false, "")) + cols = append(cols, createCol("HOST", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("GRANTEE", 6165, "utf8mb3_general_ci", "", 97, 0, false, "")) + cols = append(cols, createCol("GRANTEE_HOST", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("ROLE_NAME", 6165, "utf8mb3_general_ci", "", 255, 0, false, "")) + cols = append(cols, createCol("ROLE_HOST", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("IS_DEFAULT", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("IS_MANDATORY", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["APPLICABLE_ROLES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("CHARACTER_SET_NAME", 6165)) - cols = append(cols, createCol("DEFAULT_COLLATE_NAME", 6165)) - cols = append(cols, createCol("DESCRIPTION", 6165)) - cols = append(cols, createCol("MAXLEN", 776)) + cols = append(cols, createCol("CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("DEFAULT_COLLATE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("DESCRIPTION", 6165, "utf8mb3_general_ci", "", 2048, 0, true, "")) + cols = append(cols, createCol("MAXLEN", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["CHARACTER_SETS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165)) - cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165)) - cols = append(cols, createCol("CONSTRAINT_NAME", 6165)) - cols = append(cols, createCol("CHECK_CLAUSE", 6163)) + cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("CONSTRAINT_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CHECK_CLAUSE", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["CHECK_CONSTRAINTS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("COLLATION_NAME", 6165)) - cols = append(cols, createCol("CHARACTER_SET_NAME", 6165)) + cols = append(cols, createCol("COLLATION_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) infSchema["COLLATION_CHARACTER_SET_APPLICABILITY"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("COLLATION_NAME", 6165)) - cols = append(cols, createCol("CHARACTER_SET_NAME", 6165)) - cols = append(cols, createCol("ID", 778)) - cols = append(cols, createCol("IS_DEFAULT", 6165)) - cols = append(cols, createCol("IS_COMPILED", 6165)) - cols = append(cols, createCol("SORTLEN", 776)) - cols = append(cols, createCol("PAD_ATTRIBUTE", 2074)) + cols = append(cols, createCol("COLLATION_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ID", 778, "utf8mb3_general_ci", "0", 0, 0, true, "")) + cols = append(cols, createCol("IS_DEFAULT", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("IS_COMPILED", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("SORTLEN", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PAD_ATTRIBUTE", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'PAD SPACE','NO PAD'")) infSchema["COLLATIONS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("GRANTEE", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("COLUMN_NAME", 6165)) - cols = append(cols, createCol("PRIVILEGE_TYPE", 6165)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) + cols = append(cols, createCol("GRANTEE", 6165, "utf8mb3_general_ci", "", 292, 0, true, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PRIVILEGE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["COLUMN_PRIVILEGES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("SCHEMA_NAME", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("COLUMN_NAME", 6165)) - cols = append(cols, createCol("HISTOGRAM", 2078)) + cols = append(cols, createCol("SCHEMA_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("HISTOGRAM", 2078, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["COLUMN_STATISTICS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("COLUMN_NAME", 6165)) - cols = append(cols, createCol("ORDINAL_POSITION", 776)) - cols = append(cols, createCol("COLUMN_DEFAULT", 6163)) - cols = append(cols, createCol("IS_NULLABLE", 6165)) - cols = append(cols, createCol("DATA_TYPE", 6163)) - cols = append(cols, createCol("CHARACTER_MAXIMUM_LENGTH", 265)) - cols = append(cols, createCol("CHARACTER_OCTET_LENGTH", 265)) - cols = append(cols, createCol("NUMERIC_PRECISION", 778)) - cols = append(cols, createCol("NUMERIC_SCALE", 778)) - cols = append(cols, createCol("DATETIME_PRECISION", 776)) - cols = append(cols, createCol("CHARACTER_SET_NAME", 6165)) - cols = append(cols, createCol("COLLATION_NAME", 6165)) - cols = append(cols, createCol("COLUMN_TYPE", 6163)) - cols = append(cols, createCol("COLUMN_KEY", 2074)) - cols = append(cols, createCol("EXTRA", 6165)) - cols = append(cols, createCol("PRIVILEGES", 6165)) - cols = append(cols, createCol("COLUMN_COMMENT", 6163)) - cols = append(cols, createCol("GENERATION_EXPRESSION", 6163)) - cols = append(cols, createCol("SRS_ID", 776)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("ORDINAL_POSITION", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("COLUMN_DEFAULT", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("IS_NULLABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("DATA_TYPE", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHARACTER_MAXIMUM_LENGTH", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHARACTER_OCTET_LENGTH", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("NUMERIC_PRECISION", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("NUMERIC_SCALE", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DATETIME_PRECISION", 776, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("COLLATION_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("COLUMN_TYPE", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("COLUMN_KEY", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'','PRI','UNI','MUL'")) + cols = append(cols, createCol("EXTRA", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("PRIVILEGES", 6165, "utf8mb3_general_ci", "", 154, 0, false, "")) + cols = append(cols, createCol("COLUMN_COMMENT", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("GENERATION_EXPRESSION", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SRS_ID", 776, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["COLUMNS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("COLUMN_NAME", 6165)) - cols = append(cols, createCol("ENGINE_ATTRIBUTE", 2078)) - cols = append(cols, createCol("SECONDARY_ENGINE_ATTRIBUTE", 2078)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("ENGINE_ATTRIBUTE", 2078, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("SECONDARY_ENGINE_ATTRIBUTE", 2078, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["COLUMNS_EXTENSIONS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("ROLE_NAME", 6165)) - cols = append(cols, createCol("ROLE_HOST", 6165)) - cols = append(cols, createCol("IS_DEFAULT", 6165)) - cols = append(cols, createCol("IS_MANDATORY", 6165)) + cols = append(cols, createCol("ROLE_NAME", 6165, "utf8mb3_general_ci", "", 255, 0, false, "")) + cols = append(cols, createCol("ROLE_HOST", 6165, "utf8mb3_general_ci", "", 255, 0, false, "")) + cols = append(cols, createCol("IS_DEFAULT", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("IS_MANDATORY", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["ENABLED_ROLES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("ENGINE", 6165)) - cols = append(cols, createCol("SUPPORT", 6165)) - cols = append(cols, createCol("COMMENT", 6165)) - cols = append(cols, createCol("TRANSACTIONS", 6165)) - cols = append(cols, createCol("XA", 6165)) - cols = append(cols, createCol("SAVEPOINTS", 6165)) + cols = append(cols, createCol("ENGINE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("SUPPORT", 6165, "utf8mb3_general_ci", "", 8, 0, true, "")) + cols = append(cols, createCol("COMMENT", 6165, "utf8mb3_general_ci", "", 80, 0, true, "")) + cols = append(cols, createCol("TRANSACTIONS", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("XA", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("SAVEPOINTS", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) infSchema["ENGINES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("EVENT_CATALOG", 6165)) - cols = append(cols, createCol("EVENT_SCHEMA", 6165)) - cols = append(cols, createCol("EVENT_NAME", 6165)) - cols = append(cols, createCol("DEFINER", 6165)) - cols = append(cols, createCol("TIME_ZONE", 6165)) - cols = append(cols, createCol("EVENT_BODY", 6165)) - cols = append(cols, createCol("EVENT_DEFINITION", 6163)) - cols = append(cols, createCol("EVENT_TYPE", 6165)) - cols = append(cols, createCol("EXECUTE_AT", 2064)) - cols = append(cols, createCol("INTERVAL_VALUE", 6165)) - cols = append(cols, createCol("INTERVAL_FIELD", 2074)) - cols = append(cols, createCol("SQL_MODE", 2075)) - cols = append(cols, createCol("STARTS", 2064)) - cols = append(cols, createCol("ENDS", 2064)) - cols = append(cols, createCol("STATUS", 2074)) - cols = append(cols, createCol("ON_COMPLETION", 6165)) - cols = append(cols, createCol("CREATED", 2061)) - cols = append(cols, createCol("LAST_ALTERED", 2061)) - cols = append(cols, createCol("LAST_EXECUTED", 2064)) - cols = append(cols, createCol("EVENT_COMMENT", 6165)) - cols = append(cols, createCol("ORIGINATOR", 776)) - cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165)) - cols = append(cols, createCol("COLLATION_CONNECTION", 6165)) - cols = append(cols, createCol("DATABASE_COLLATION", 6165)) + cols = append(cols, createCol("EVENT_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("EVENT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("EVENT_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("DEFINER", 6165, "utf8mb3_general_ci", "", 288, 0, true, "")) + cols = append(cols, createCol("TIME_ZONE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("EVENT_BODY", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("EVENT_DEFINITION", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("EVENT_TYPE", 6165, "utf8mb3_general_ci", "", 9, 0, true, "")) + cols = append(cols, createCol("EXECUTE_AT", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("INTERVAL_VALUE", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("INTERVAL_FIELD", 2074, "utf8mb3_general_ci", "", 0, 0, false, "'YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND'")) + cols = append(cols, createCol("SQL_MODE", 2075, "utf8mb3_general_ci", "", 0, 0, true, "'REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','NOT_USED_9','NOT_USED_10','NOT_USED_11','NOT_USED_12','NOT_USED_13','NOT_USED_14','NOT_USED_15','NOT_USED_16','NOT_USED_17','NOT_USED_18','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','ALLOW_INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NOT_USED_29','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','TIME_TRUNCATE_FRACTIONAL'")) + cols = append(cols, createCol("STARTS", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("ENDS", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("STATUS", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'ENABLED','DISABLED','SLAVESIDE_DISABLED'")) + cols = append(cols, createCol("ON_COMPLETION", 6165, "utf8mb3_general_ci", "", 12, 0, true, "")) + cols = append(cols, createCol("CREATED", 2061, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("LAST_ALTERED", 2061, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("LAST_EXECUTED", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("EVENT_COMMENT", 6165, "utf8mb3_general_ci", "", 2048, 0, true, "")) + cols = append(cols, createCol("ORIGINATOR", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("COLLATION_CONNECTION", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("DATABASE_COLLATION", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) infSchema["EVENTS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("FILE_ID", 265)) - cols = append(cols, createCol("FILE_NAME", 6163)) - cols = append(cols, createCol("FILE_TYPE", 6165)) - cols = append(cols, createCol("TABLESPACE_NAME", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6167)) - cols = append(cols, createCol("TABLE_SCHEMA", 10264)) - cols = append(cols, createCol("TABLE_NAME", 10264)) - cols = append(cols, createCol("LOGFILE_GROUP_NAME", 6165)) - cols = append(cols, createCol("LOGFILE_GROUP_NUMBER", 265)) - cols = append(cols, createCol("ENGINE", 6165)) - cols = append(cols, createCol("FULLTEXT_KEYS", 10264)) - cols = append(cols, createCol("DELETED_ROWS", 10264)) - cols = append(cols, createCol("UPDATE_COUNT", 10264)) - cols = append(cols, createCol("FREE_EXTENTS", 265)) - cols = append(cols, createCol("TOTAL_EXTENTS", 265)) - cols = append(cols, createCol("EXTENT_SIZE", 265)) - cols = append(cols, createCol("INITIAL_SIZE", 265)) - cols = append(cols, createCol("MAXIMUM_SIZE", 265)) - cols = append(cols, createCol("AUTOEXTEND_SIZE", 265)) - cols = append(cols, createCol("CREATION_TIME", 10264)) - cols = append(cols, createCol("LAST_UPDATE_TIME", 10264)) - cols = append(cols, createCol("LAST_ACCESS_TIME", 10264)) - cols = append(cols, createCol("RECOVER_TIME", 10264)) - cols = append(cols, createCol("TRANSACTION_COUNTER", 10264)) - cols = append(cols, createCol("VERSION", 265)) - cols = append(cols, createCol("ROW_FORMAT", 6165)) - cols = append(cols, createCol("TABLE_ROWS", 10264)) - cols = append(cols, createCol("AVG_ROW_LENGTH", 10264)) - cols = append(cols, createCol("DATA_LENGTH", 10264)) - cols = append(cols, createCol("MAX_DATA_LENGTH", 10264)) - cols = append(cols, createCol("INDEX_LENGTH", 10264)) - cols = append(cols, createCol("DATA_FREE", 265)) - cols = append(cols, createCol("CREATE_TIME", 10264)) - cols = append(cols, createCol("UPDATE_TIME", 10264)) - cols = append(cols, createCol("CHECK_TIME", 10264)) - cols = append(cols, createCol("CHECKSUM", 10264)) - cols = append(cols, createCol("STATUS", 6165)) - cols = append(cols, createCol("EXTRA", 6165)) + cols = append(cols, createCol("FILE_ID", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("FILE_NAME", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("FILE_TYPE", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("TABLESPACE_NAME", 6165, "utf8mb3_general_ci", "", 268, 0, true, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6167, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TABLE_NAME", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("LOGFILE_GROUP_NAME", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("LOGFILE_GROUP_NUMBER", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("ENGINE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("FULLTEXT_KEYS", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DELETED_ROWS", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("UPDATE_COUNT", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("FREE_EXTENTS", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TOTAL_EXTENTS", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("EXTENT_SIZE", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("INITIAL_SIZE", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("MAXIMUM_SIZE", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("AUTOEXTEND_SIZE", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CREATION_TIME", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("LAST_UPDATE_TIME", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("LAST_ACCESS_TIME", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("RECOVER_TIME", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TRANSACTION_COUNTER", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("VERSION", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("ROW_FORMAT", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("TABLE_ROWS", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("AVG_ROW_LENGTH", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DATA_LENGTH", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("MAX_DATA_LENGTH", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("INDEX_LENGTH", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DATA_FREE", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CREATE_TIME", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("UPDATE_TIME", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHECK_TIME", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHECKSUM", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("STATUS", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("EXTRA", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) infSchema["FILES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("POOL_ID", 778)) - cols = append(cols, createCol("BLOCK_ID", 778)) - cols = append(cols, createCol("SPACE", 778)) - cols = append(cols, createCol("PAGE_NUMBER", 778)) - cols = append(cols, createCol("PAGE_TYPE", 6165)) - cols = append(cols, createCol("FLUSH_TYPE", 778)) - cols = append(cols, createCol("FIX_COUNT", 778)) - cols = append(cols, createCol("IS_HASHED", 6165)) - cols = append(cols, createCol("NEWEST_MODIFICATION", 778)) - cols = append(cols, createCol("OLDEST_MODIFICATION", 778)) - cols = append(cols, createCol("ACCESS_TIME", 778)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("INDEX_NAME", 6165)) - cols = append(cols, createCol("NUMBER_RECORDS", 778)) - cols = append(cols, createCol("DATA_SIZE", 778)) - cols = append(cols, createCol("COMPRESSED_SIZE", 778)) - cols = append(cols, createCol("PAGE_STATE", 6165)) - cols = append(cols, createCol("IO_FIX", 6165)) - cols = append(cols, createCol("IS_OLD", 6165)) - cols = append(cols, createCol("FREE_PAGE_CLOCK", 778)) - cols = append(cols, createCol("IS_STALE", 6165)) + cols = append(cols, createCol("POOL_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("BLOCK_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SPACE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PAGE_NUMBER", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PAGE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("FLUSH_TYPE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("FIX_COUNT", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("IS_HASHED", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("NEWEST_MODIFICATION", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("OLDEST_MODIFICATION", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ACCESS_TIME", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 1024, 0, false, "")) + cols = append(cols, createCol("INDEX_NAME", 6165, "utf8mb3_general_ci", "", 1024, 0, false, "")) + cols = append(cols, createCol("NUMBER_RECORDS", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("DATA_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("COMPRESSED_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PAGE_STATE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("IO_FIX", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("IS_OLD", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("FREE_PAGE_CLOCK", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("IS_STALE", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) infSchema["INNODB_BUFFER_PAGE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("POOL_ID", 778)) - cols = append(cols, createCol("LRU_POSITION", 778)) - cols = append(cols, createCol("SPACE", 778)) - cols = append(cols, createCol("PAGE_NUMBER", 778)) - cols = append(cols, createCol("PAGE_TYPE", 6165)) - cols = append(cols, createCol("FLUSH_TYPE", 778)) - cols = append(cols, createCol("FIX_COUNT", 778)) - cols = append(cols, createCol("IS_HASHED", 6165)) - cols = append(cols, createCol("NEWEST_MODIFICATION", 778)) - cols = append(cols, createCol("OLDEST_MODIFICATION", 778)) - cols = append(cols, createCol("ACCESS_TIME", 778)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("INDEX_NAME", 6165)) - cols = append(cols, createCol("NUMBER_RECORDS", 778)) - cols = append(cols, createCol("DATA_SIZE", 778)) - cols = append(cols, createCol("COMPRESSED_SIZE", 778)) - cols = append(cols, createCol("COMPRESSED", 6165)) - cols = append(cols, createCol("IO_FIX", 6165)) - cols = append(cols, createCol("IS_OLD", 6165)) - cols = append(cols, createCol("FREE_PAGE_CLOCK", 778)) + cols = append(cols, createCol("POOL_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("LRU_POSITION", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SPACE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PAGE_NUMBER", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PAGE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("FLUSH_TYPE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("FIX_COUNT", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("IS_HASHED", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("NEWEST_MODIFICATION", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("OLDEST_MODIFICATION", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ACCESS_TIME", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 1024, 0, false, "")) + cols = append(cols, createCol("INDEX_NAME", 6165, "utf8mb3_general_ci", "", 1024, 0, false, "")) + cols = append(cols, createCol("NUMBER_RECORDS", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("DATA_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("COMPRESSED_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("COMPRESSED", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("IO_FIX", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("IS_OLD", 6165, "utf8mb3_general_ci", "", 3, 0, false, "")) + cols = append(cols, createCol("FREE_PAGE_CLOCK", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_BUFFER_PAGE_LRU"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("POOL_ID", 778)) - cols = append(cols, createCol("POOL_SIZE", 778)) - cols = append(cols, createCol("FREE_BUFFERS", 778)) - cols = append(cols, createCol("DATABASE_PAGES", 778)) - cols = append(cols, createCol("OLD_DATABASE_PAGES", 778)) - cols = append(cols, createCol("MODIFIED_DATABASE_PAGES", 778)) - cols = append(cols, createCol("PENDING_DECOMPRESS", 778)) - cols = append(cols, createCol("PENDING_READS", 778)) - cols = append(cols, createCol("PENDING_FLUSH_LRU", 778)) - cols = append(cols, createCol("PENDING_FLUSH_LIST", 778)) - cols = append(cols, createCol("PAGES_MADE_YOUNG", 778)) - cols = append(cols, createCol("PAGES_NOT_MADE_YOUNG", 778)) - cols = append(cols, createCol("PAGES_MADE_YOUNG_RATE", 1035)) - cols = append(cols, createCol("PAGES_MADE_NOT_YOUNG_RATE", 1035)) - cols = append(cols, createCol("NUMBER_PAGES_READ", 778)) - cols = append(cols, createCol("NUMBER_PAGES_CREATED", 778)) - cols = append(cols, createCol("NUMBER_PAGES_WRITTEN", 778)) - cols = append(cols, createCol("PAGES_READ_RATE", 1035)) - cols = append(cols, createCol("PAGES_CREATE_RATE", 1035)) - cols = append(cols, createCol("PAGES_WRITTEN_RATE", 1035)) - cols = append(cols, createCol("NUMBER_PAGES_GET", 778)) - cols = append(cols, createCol("HIT_RATE", 778)) - cols = append(cols, createCol("YOUNG_MAKE_PER_THOUSAND_GETS", 778)) - cols = append(cols, createCol("NOT_YOUNG_MAKE_PER_THOUSAND_GETS", 778)) - cols = append(cols, createCol("NUMBER_PAGES_READ_AHEAD", 778)) - cols = append(cols, createCol("NUMBER_READ_AHEAD_EVICTED", 778)) - cols = append(cols, createCol("READ_AHEAD_RATE", 1035)) - cols = append(cols, createCol("READ_AHEAD_EVICTED_RATE", 1035)) - cols = append(cols, createCol("LRU_IO_TOTAL", 778)) - cols = append(cols, createCol("LRU_IO_CURRENT", 778)) - cols = append(cols, createCol("UNCOMPRESS_TOTAL", 778)) - cols = append(cols, createCol("UNCOMPRESS_CURRENT", 778)) + cols = append(cols, createCol("POOL_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("POOL_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("FREE_BUFFERS", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("DATABASE_PAGES", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("OLD_DATABASE_PAGES", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("MODIFIED_DATABASE_PAGES", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PENDING_DECOMPRESS", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PENDING_READS", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PENDING_FLUSH_LRU", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PENDING_FLUSH_LIST", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PAGES_MADE_YOUNG", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PAGES_NOT_MADE_YOUNG", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PAGES_MADE_YOUNG_RATE", 1035, "utf8mb3_general_ci", "", 12, 0, true, "")) + cols = append(cols, createCol("PAGES_MADE_NOT_YOUNG_RATE", 1035, "utf8mb3_general_ci", "", 12, 0, true, "")) + cols = append(cols, createCol("NUMBER_PAGES_READ", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("NUMBER_PAGES_CREATED", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("NUMBER_PAGES_WRITTEN", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PAGES_READ_RATE", 1035, "utf8mb3_general_ci", "", 12, 0, true, "")) + cols = append(cols, createCol("PAGES_CREATE_RATE", 1035, "utf8mb3_general_ci", "", 12, 0, true, "")) + cols = append(cols, createCol("PAGES_WRITTEN_RATE", 1035, "utf8mb3_general_ci", "", 12, 0, true, "")) + cols = append(cols, createCol("NUMBER_PAGES_GET", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("HIT_RATE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("YOUNG_MAKE_PER_THOUSAND_GETS", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("NOT_YOUNG_MAKE_PER_THOUSAND_GETS", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("NUMBER_PAGES_READ_AHEAD", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("NUMBER_READ_AHEAD_EVICTED", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("READ_AHEAD_RATE", 1035, "utf8mb3_general_ci", "", 12, 0, true, "")) + cols = append(cols, createCol("READ_AHEAD_EVICTED_RATE", 1035, "utf8mb3_general_ci", "", 12, 0, true, "")) + cols = append(cols, createCol("LRU_IO_TOTAL", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("LRU_IO_CURRENT", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("UNCOMPRESS_TOTAL", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("UNCOMPRESS_CURRENT", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_BUFFER_POOL_STATS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("SPACE_ID", 776)) - cols = append(cols, createCol("INDEX_ID", 778)) - cols = append(cols, createCol("N_CACHED_PAGES", 778)) + cols = append(cols, createCol("SPACE_ID", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("INDEX_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("N_CACHED_PAGES", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_CACHED_INDEXES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("page_size", 263)) - cols = append(cols, createCol("compress_ops", 263)) - cols = append(cols, createCol("compress_ops_ok", 263)) - cols = append(cols, createCol("compress_time", 263)) - cols = append(cols, createCol("uncompress_ops", 263)) - cols = append(cols, createCol("uncompress_time", 263)) + cols = append(cols, createCol("page_size", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("compress_ops", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("compress_ops_ok", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("compress_time", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("uncompress_ops", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("uncompress_time", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_CMP"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("database_name", 6165)) - cols = append(cols, createCol("table_name", 6165)) - cols = append(cols, createCol("index_name", 6165)) - cols = append(cols, createCol("compress_ops", 263)) - cols = append(cols, createCol("compress_ops_ok", 263)) - cols = append(cols, createCol("compress_time", 263)) - cols = append(cols, createCol("uncompress_ops", 263)) - cols = append(cols, createCol("uncompress_time", 263)) + cols = append(cols, createCol("database_name", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("table_name", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("index_name", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("compress_ops", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("compress_ops_ok", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("compress_time", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("uncompress_ops", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("uncompress_time", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_CMP_PER_INDEX"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("database_name", 6165)) - cols = append(cols, createCol("table_name", 6165)) - cols = append(cols, createCol("index_name", 6165)) - cols = append(cols, createCol("compress_ops", 263)) - cols = append(cols, createCol("compress_ops_ok", 263)) - cols = append(cols, createCol("compress_time", 263)) - cols = append(cols, createCol("uncompress_ops", 263)) - cols = append(cols, createCol("uncompress_time", 263)) + cols = append(cols, createCol("database_name", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("table_name", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("index_name", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("compress_ops", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("compress_ops_ok", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("compress_time", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("uncompress_ops", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("uncompress_time", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_CMP_PER_INDEX_RESET"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("page_size", 263)) - cols = append(cols, createCol("compress_ops", 263)) - cols = append(cols, createCol("compress_ops_ok", 263)) - cols = append(cols, createCol("compress_time", 263)) - cols = append(cols, createCol("uncompress_ops", 263)) - cols = append(cols, createCol("uncompress_time", 263)) + cols = append(cols, createCol("page_size", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("compress_ops", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("compress_ops_ok", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("compress_time", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("uncompress_ops", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("uncompress_time", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_CMP_RESET"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("page_size", 263)) - cols = append(cols, createCol("buffer_pool_instance", 263)) - cols = append(cols, createCol("pages_used", 263)) - cols = append(cols, createCol("pages_free", 263)) - cols = append(cols, createCol("relocation_ops", 265)) - cols = append(cols, createCol("relocation_time", 263)) + cols = append(cols, createCol("page_size", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("buffer_pool_instance", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("pages_used", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("pages_free", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("relocation_ops", 265, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("relocation_time", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_CMPMEM"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("page_size", 263)) - cols = append(cols, createCol("buffer_pool_instance", 263)) - cols = append(cols, createCol("pages_used", 263)) - cols = append(cols, createCol("pages_free", 263)) - cols = append(cols, createCol("relocation_ops", 265)) - cols = append(cols, createCol("relocation_time", 263)) + cols = append(cols, createCol("page_size", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("buffer_pool_instance", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("pages_used", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("pages_free", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("relocation_ops", 265, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("relocation_time", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_CMPMEM_RESET"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_ID", 778)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("POS", 778)) - cols = append(cols, createCol("MTYPE", 263)) - cols = append(cols, createCol("PRTYPE", 263)) - cols = append(cols, createCol("LEN", 263)) - cols = append(cols, createCol("HAS_DEFAULT", 263)) - cols = append(cols, createCol("DEFAULT_VALUE", 6163)) + cols = append(cols, createCol("TABLE_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("NAME", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("POS", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("MTYPE", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PRTYPE", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("LEN", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("HAS_DEFAULT", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("DEFAULT_VALUE", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["INNODB_COLUMNS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("SPACE", 10262)) - cols = append(cols, createCol("PATH", 6165)) + cols = append(cols, createCol("SPACE", 10262, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("PATH", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) infSchema["INNODB_DATAFILES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("INDEX_ID", 10262)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("POS", 778)) + cols = append(cols, createCol("INDEX_ID", 10262, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("POS", 778, "utf8mb3_general_ci", "0", 0, 0, true, "")) infSchema["INNODB_FIELDS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("ID", 6165)) - cols = append(cols, createCol("FOR_NAME", 6165)) - cols = append(cols, createCol("REF_NAME", 6165)) - cols = append(cols, createCol("N_COLS", 265)) - cols = append(cols, createCol("TYPE", 778)) + cols = append(cols, createCol("ID", 6165, "utf8mb3_general_ci", "", 129, 0, false, "")) + cols = append(cols, createCol("FOR_NAME", 6165, "utf8mb3_general_ci", "", 129, 0, false, "")) + cols = append(cols, createCol("REF_NAME", 6165, "utf8mb3_general_ci", "", 129, 0, false, "")) + cols = append(cols, createCol("N_COLS", 265, "utf8mb3_general_ci", "0", 0, 0, true, "")) + cols = append(cols, createCol("TYPE", 778, "utf8mb3_general_ci", "0", 0, 0, true, "")) infSchema["INNODB_FOREIGN"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("ID", 6165)) - cols = append(cols, createCol("FOR_COL_NAME", 6165)) - cols = append(cols, createCol("REF_COL_NAME", 6165)) - cols = append(cols, createCol("POS", 776)) + cols = append(cols, createCol("ID", 6165, "utf8mb3_general_ci", "", 129, 0, false, "")) + cols = append(cols, createCol("FOR_COL_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("REF_COL_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("POS", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_FOREIGN_COLS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("DOC_ID", 778)) + cols = append(cols, createCol("DOC_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_FT_BEING_DELETED"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("KEY", 6165)) - cols = append(cols, createCol("VALUE", 6165)) + cols = append(cols, createCol("KEY", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("VALUE", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) infSchema["INNODB_FT_CONFIG"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("value", 6165)) + cols = append(cols, createCol("value", 6165, "utf8mb3_general_ci", "", 18, 0, true, "")) infSchema["INNODB_FT_DEFAULT_STOPWORD"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("DOC_ID", 778)) + cols = append(cols, createCol("DOC_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_FT_DELETED"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("WORD", 6165)) - cols = append(cols, createCol("FIRST_DOC_ID", 778)) - cols = append(cols, createCol("LAST_DOC_ID", 778)) - cols = append(cols, createCol("DOC_COUNT", 778)) - cols = append(cols, createCol("DOC_ID", 778)) - cols = append(cols, createCol("POSITION", 778)) + cols = append(cols, createCol("WORD", 6165, "utf8mb3_general_ci", "", 337, 0, true, "")) + cols = append(cols, createCol("FIRST_DOC_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("LAST_DOC_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("DOC_COUNT", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("DOC_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("POSITION", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_FT_INDEX_CACHE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("WORD", 6165)) - cols = append(cols, createCol("FIRST_DOC_ID", 778)) - cols = append(cols, createCol("LAST_DOC_ID", 778)) - cols = append(cols, createCol("DOC_COUNT", 778)) - cols = append(cols, createCol("DOC_ID", 778)) - cols = append(cols, createCol("POSITION", 778)) + cols = append(cols, createCol("WORD", 6165, "utf8mb3_general_ci", "", 337, 0, true, "")) + cols = append(cols, createCol("FIRST_DOC_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("LAST_DOC_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("DOC_COUNT", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("DOC_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("POSITION", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_FT_INDEX_TABLE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("INDEX_ID", 778)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("TABLE_ID", 778)) - cols = append(cols, createCol("TYPE", 263)) - cols = append(cols, createCol("N_FIELDS", 263)) - cols = append(cols, createCol("PAGE_NO", 263)) - cols = append(cols, createCol("SPACE", 263)) - cols = append(cols, createCol("MERGE_THRESHOLD", 263)) + cols = append(cols, createCol("INDEX_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("NAME", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("TABLE_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("TYPE", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("N_FIELDS", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PAGE_NO", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SPACE", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("MERGE_THRESHOLD", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_INDEXES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("SUBSYSTEM", 6165)) - cols = append(cols, createCol("COUNT", 265)) - cols = append(cols, createCol("MAX_COUNT", 265)) - cols = append(cols, createCol("MIN_COUNT", 265)) - cols = append(cols, createCol("AVG_COUNT", 1035)) - cols = append(cols, createCol("COUNT_RESET", 265)) - cols = append(cols, createCol("MAX_COUNT_RESET", 265)) - cols = append(cols, createCol("MIN_COUNT_RESET", 265)) - cols = append(cols, createCol("AVG_COUNT_RESET", 1035)) - cols = append(cols, createCol("TIME_ENABLED", 2064)) - cols = append(cols, createCol("TIME_DISABLED", 2064)) - cols = append(cols, createCol("TIME_ELAPSED", 265)) - cols = append(cols, createCol("TIME_RESET", 2064)) - cols = append(cols, createCol("STATUS", 6165)) - cols = append(cols, createCol("TYPE", 6165)) - cols = append(cols, createCol("COMMENT", 6165)) + cols = append(cols, createCol("NAME", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("SUBSYSTEM", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("COUNT", 265, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("MAX_COUNT", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("MIN_COUNT", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("AVG_COUNT", 1035, "utf8mb3_general_ci", "", 12, 0, false, "")) + cols = append(cols, createCol("COUNT_RESET", 265, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("MAX_COUNT_RESET", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("MIN_COUNT_RESET", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("AVG_COUNT_RESET", 1035, "utf8mb3_general_ci", "", 12, 0, false, "")) + cols = append(cols, createCol("TIME_ENABLED", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TIME_DISABLED", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TIME_ELAPSED", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TIME_RESET", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("STATUS", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("TYPE", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("COMMENT", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) infSchema["INNODB_METRICS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("ID", 776)) - cols = append(cols, createCol("SPACE", 776)) - cols = append(cols, createCol("PATH", 6165)) - cols = append(cols, createCol("SIZE", 778)) - cols = append(cols, createCol("STATE", 6165)) - cols = append(cols, createCol("PURPOSE", 6165)) + cols = append(cols, createCol("ID", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SPACE", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("PATH", 6165, "utf8mb3_general_ci", "", 4001, 0, true, "")) + cols = append(cols, createCol("SIZE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("STATE", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) + cols = append(cols, createCol("PURPOSE", 6165, "utf8mb3_general_ci", "", 192, 0, true, "")) infSchema["INNODB_SESSION_TEMP_TABLESPACES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_ID", 778)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("FLAG", 263)) - cols = append(cols, createCol("N_COLS", 263)) - cols = append(cols, createCol("SPACE", 265)) - cols = append(cols, createCol("ROW_FORMAT", 6165)) - cols = append(cols, createCol("ZIP_PAGE_SIZE", 776)) - cols = append(cols, createCol("SPACE_TYPE", 6165)) - cols = append(cols, createCol("INSTANT_COLS", 263)) + cols = append(cols, createCol("TABLE_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("NAME", 6165, "utf8mb3_general_ci", "", 655, 0, true, "")) + cols = append(cols, createCol("FLAG", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("N_COLS", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SPACE", 265, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ROW_FORMAT", 6165, "utf8mb3_general_ci", "", 12, 0, false, "")) + cols = append(cols, createCol("ZIP_PAGE_SIZE", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SPACE_TYPE", 6165, "utf8mb3_general_ci", "", 10, 0, false, "")) + cols = append(cols, createCol("INSTANT_COLS", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("TOTAL_ROW_VERSIONS", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_TABLES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("SPACE", 776)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("FLAG", 776)) - cols = append(cols, createCol("ROW_FORMAT", 6165)) - cols = append(cols, createCol("PAGE_SIZE", 776)) - cols = append(cols, createCol("ZIP_PAGE_SIZE", 776)) - cols = append(cols, createCol("SPACE_TYPE", 6165)) - cols = append(cols, createCol("FS_BLOCK_SIZE", 776)) - cols = append(cols, createCol("FILE_SIZE", 778)) - cols = append(cols, createCol("ALLOCATED_SIZE", 778)) - cols = append(cols, createCol("AUTOEXTEND_SIZE", 778)) - cols = append(cols, createCol("SERVER_VERSION", 6165)) - cols = append(cols, createCol("SPACE_VERSION", 776)) - cols = append(cols, createCol("ENCRYPTION", 6165)) - cols = append(cols, createCol("STATE", 6165)) + cols = append(cols, createCol("SPACE", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("NAME", 6165, "utf8mb3_general_ci", "", 655, 0, true, "")) + cols = append(cols, createCol("FLAG", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ROW_FORMAT", 6165, "utf8mb3_general_ci", "", 22, 0, false, "")) + cols = append(cols, createCol("PAGE_SIZE", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ZIP_PAGE_SIZE", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SPACE_TYPE", 6165, "utf8mb3_general_ci", "", 10, 0, false, "")) + cols = append(cols, createCol("FS_BLOCK_SIZE", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("FILE_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ALLOCATED_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("AUTOEXTEND_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SERVER_VERSION", 6165, "utf8mb3_general_ci", "", 10, 0, false, "")) + cols = append(cols, createCol("SPACE_VERSION", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ENCRYPTION", 6165, "utf8mb3_general_ci", "", 1, 0, false, "")) + cols = append(cols, createCol("STATE", 6165, "utf8mb3_general_ci", "", 10, 0, false, "")) infSchema["INNODB_TABLESPACES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("SPACE", 10262)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("PATH", 6165)) - cols = append(cols, createCol("FLAG", 10262)) - cols = append(cols, createCol("SPACE_TYPE", 6165)) + cols = append(cols, createCol("SPACE", 10262, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("NAME", 6165, "utf8mb3_general_ci", "", 268, 0, true, "")) + cols = append(cols, createCol("PATH", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("FLAG", 10262, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("SPACE_TYPE", 6165, "utf8mb3_general_ci", "", 7, 0, true, "")) infSchema["INNODB_TABLESPACES_BRIEF"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_ID", 778)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("STATS_INITIALIZED", 6165)) - cols = append(cols, createCol("NUM_ROWS", 778)) - cols = append(cols, createCol("CLUST_INDEX_SIZE", 778)) - cols = append(cols, createCol("OTHER_INDEX_SIZE", 778)) - cols = append(cols, createCol("MODIFIED_COUNTER", 778)) - cols = append(cols, createCol("AUTOINC", 778)) - cols = append(cols, createCol("REF_COUNT", 263)) + cols = append(cols, createCol("TABLE_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("NAME", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("STATS_INITIALIZED", 6165, "utf8mb3_general_ci", "", 193, 0, true, "")) + cols = append(cols, createCol("NUM_ROWS", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("CLUST_INDEX_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("OTHER_INDEX_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("MODIFIED_COUNTER", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("AUTOINC", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("REF_COUNT", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_TABLESTATS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_ID", 778)) - cols = append(cols, createCol("NAME", 6165)) - cols = append(cols, createCol("N_COLS", 776)) - cols = append(cols, createCol("SPACE", 776)) + cols = append(cols, createCol("TABLE_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("N_COLS", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SPACE", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_TEMP_TABLE_INFO"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("trx_id", 778)) - cols = append(cols, createCol("trx_state", 6165)) - cols = append(cols, createCol("trx_started", 2064)) - cols = append(cols, createCol("trx_requested_lock_id", 6165)) - cols = append(cols, createCol("trx_wait_started", 2064)) - cols = append(cols, createCol("trx_weight", 778)) - cols = append(cols, createCol("trx_mysql_thread_id", 778)) - cols = append(cols, createCol("trx_query", 6165)) - cols = append(cols, createCol("trx_operation_state", 6165)) - cols = append(cols, createCol("trx_tables_in_use", 778)) - cols = append(cols, createCol("trx_tables_locked", 778)) - cols = append(cols, createCol("trx_lock_structs", 778)) - cols = append(cols, createCol("trx_lock_memory_bytes", 778)) - cols = append(cols, createCol("trx_rows_locked", 778)) - cols = append(cols, createCol("trx_rows_modified", 778)) - cols = append(cols, createCol("trx_concurrency_tickets", 778)) - cols = append(cols, createCol("trx_isolation_level", 6165)) - cols = append(cols, createCol("trx_unique_checks", 263)) - cols = append(cols, createCol("trx_foreign_key_checks", 263)) - cols = append(cols, createCol("trx_last_foreign_key_error", 6165)) - cols = append(cols, createCol("trx_adaptive_hash_latched", 263)) - cols = append(cols, createCol("trx_adaptive_hash_timeout", 778)) - cols = append(cols, createCol("trx_is_read_only", 263)) - cols = append(cols, createCol("trx_autocommit_non_locking", 263)) - cols = append(cols, createCol("trx_schedule_weight", 778)) + cols = append(cols, createCol("trx_id", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_state", 6165, "utf8mb3_general_ci", "", 13, 0, true, "")) + cols = append(cols, createCol("trx_started", 2064, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_requested_lock_id", 6165, "utf8mb3_general_ci", "", 105, 0, false, "")) + cols = append(cols, createCol("trx_wait_started", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("trx_weight", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_mysql_thread_id", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_query", 6165, "utf8mb3_general_ci", "", 1024, 0, false, "")) + cols = append(cols, createCol("trx_operation_state", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("trx_tables_in_use", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_tables_locked", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_lock_structs", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_lock_memory_bytes", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_rows_locked", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_rows_modified", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_concurrency_tickets", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_isolation_level", 6165, "utf8mb3_general_ci", "", 16, 0, true, "")) + cols = append(cols, createCol("trx_unique_checks", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_foreign_key_checks", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_last_foreign_key_error", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("trx_adaptive_hash_latched", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_adaptive_hash_timeout", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_is_read_only", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_autocommit_non_locking", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("trx_schedule_weight", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["INNODB_TRX"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_ID", 778)) - cols = append(cols, createCol("POS", 776)) - cols = append(cols, createCol("BASE_POS", 776)) + cols = append(cols, createCol("TABLE_ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("POS", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("BASE_POS", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["INNODB_VIRTUAL"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165)) - cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165)) - cols = append(cols, createCol("CONSTRAINT_NAME", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("COLUMN_NAME", 6165)) - cols = append(cols, createCol("ORDINAL_POSITION", 776)) - cols = append(cols, createCol("POSITION_IN_UNIQUE_CONSTRAINT", 776)) - cols = append(cols, createCol("REFERENCED_TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("REFERENCED_TABLE_NAME", 6165)) - cols = append(cols, createCol("REFERENCED_COLUMN_NAME", 6165)) + cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("CONSTRAINT_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("ORDINAL_POSITION", 776, "utf8mb3_general_ci", "0", 0, 0, true, "")) + cols = append(cols, createCol("POSITION_IN_UNIQUE_CONSTRAINT", 776, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("REFERENCED_TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("REFERENCED_TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("REFERENCED_COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) infSchema["KEY_COLUMN_USAGE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("WORD", 6165)) - cols = append(cols, createCol("RESERVED", 263)) + cols = append(cols, createCol("WORD", 6165, "utf8mb3_general_ci", "", 128, 0, false, "")) + cols = append(cols, createCol("RESERVED", 263, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["KEYWORDS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("QUERY", 6165)) - cols = append(cols, createCol("TRACE", 6165)) - cols = append(cols, createCol("MISSING_BYTES_BEYOND_MAX_MEM_SIZE", 263)) - cols = append(cols, createCol("INSUFFICIENT_PRIVILEGES", 257)) + cols = append(cols, createCol("QUERY", 6165, "utf8mb3_general_ci", "", 65535, 0, true, "")) + cols = append(cols, createCol("TRACE", 6165, "utf8mb3_general_ci", "", 65535, 0, true, "")) + cols = append(cols, createCol("MISSING_BYTES_BEYOND_MAX_MEM_SIZE", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("INSUFFICIENT_PRIVILEGES", 257, "utf8mb3_general_ci", "", 1, 0, true, "")) infSchema["OPTIMIZER_TRACE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("SPECIFIC_CATALOG", 6165)) - cols = append(cols, createCol("SPECIFIC_SCHEMA", 6165)) - cols = append(cols, createCol("SPECIFIC_NAME", 6165)) - cols = append(cols, createCol("ORDINAL_POSITION", 778)) - cols = append(cols, createCol("PARAMETER_MODE", 6165)) - cols = append(cols, createCol("PARAMETER_NAME", 6165)) - cols = append(cols, createCol("DATA_TYPE", 6163)) - cols = append(cols, createCol("CHARACTER_MAXIMUM_LENGTH", 265)) - cols = append(cols, createCol("CHARACTER_OCTET_LENGTH", 265)) - cols = append(cols, createCol("NUMERIC_PRECISION", 776)) - cols = append(cols, createCol("NUMERIC_SCALE", 265)) - cols = append(cols, createCol("DATETIME_PRECISION", 776)) - cols = append(cols, createCol("CHARACTER_SET_NAME", 6165)) - cols = append(cols, createCol("COLLATION_NAME", 6165)) - cols = append(cols, createCol("DTD_IDENTIFIER", 6163)) - cols = append(cols, createCol("ROUTINE_TYPE", 2074)) + cols = append(cols, createCol("SPECIFIC_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("SPECIFIC_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("SPECIFIC_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ORDINAL_POSITION", 778, "utf8mb3_general_ci", "0", 0, 0, true, "")) + cols = append(cols, createCol("PARAMETER_MODE", 6165, "utf8mb3_general_ci", "", 5, 0, false, "")) + cols = append(cols, createCol("PARAMETER_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("DATA_TYPE", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHARACTER_MAXIMUM_LENGTH", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHARACTER_OCTET_LENGTH", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("NUMERIC_PRECISION", 776, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("NUMERIC_SCALE", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DATETIME_PRECISION", 776, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("COLLATION_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("DTD_IDENTIFIER", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ROUTINE_TYPE", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'FUNCTION','PROCEDURE'")) infSchema["PARAMETERS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("PARTITION_NAME", 6165)) - cols = append(cols, createCol("SUBPARTITION_NAME", 6165)) - cols = append(cols, createCol("PARTITION_ORDINAL_POSITION", 776)) - cols = append(cols, createCol("SUBPARTITION_ORDINAL_POSITION", 776)) - cols = append(cols, createCol("PARTITION_METHOD", 6165)) - cols = append(cols, createCol("SUBPARTITION_METHOD", 6165)) - cols = append(cols, createCol("PARTITION_EXPRESSION", 6165)) - cols = append(cols, createCol("SUBPARTITION_EXPRESSION", 6165)) - cols = append(cols, createCol("PARTITION_DESCRIPTION", 6163)) - cols = append(cols, createCol("TABLE_ROWS", 778)) - cols = append(cols, createCol("AVG_ROW_LENGTH", 778)) - cols = append(cols, createCol("DATA_LENGTH", 778)) - cols = append(cols, createCol("MAX_DATA_LENGTH", 778)) - cols = append(cols, createCol("INDEX_LENGTH", 778)) - cols = append(cols, createCol("DATA_FREE", 778)) - cols = append(cols, createCol("CREATE_TIME", 2061)) - cols = append(cols, createCol("UPDATE_TIME", 2064)) - cols = append(cols, createCol("CHECK_TIME", 2064)) - cols = append(cols, createCol("CHECKSUM", 265)) - cols = append(cols, createCol("PARTITION_COMMENT", 6163)) - cols = append(cols, createCol("NODEGROUP", 6165)) - cols = append(cols, createCol("TABLESPACE_NAME", 6165)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PARTITION_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("SUBPARTITION_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("PARTITION_ORDINAL_POSITION", 776, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("SUBPARTITION_ORDINAL_POSITION", 776, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("PARTITION_METHOD", 6165, "utf8mb3_general_ci", "", 13, 0, false, "")) + cols = append(cols, createCol("SUBPARTITION_METHOD", 6165, "utf8mb3_general_ci", "", 13, 0, false, "")) + cols = append(cols, createCol("PARTITION_EXPRESSION", 6165, "utf8mb3_general_ci", "", 2048, 0, false, "")) + cols = append(cols, createCol("SUBPARTITION_EXPRESSION", 6165, "utf8mb3_general_ci", "", 2048, 0, false, "")) + cols = append(cols, createCol("PARTITION_DESCRIPTION", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TABLE_ROWS", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("AVG_ROW_LENGTH", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DATA_LENGTH", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("MAX_DATA_LENGTH", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("INDEX_LENGTH", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DATA_FREE", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CREATE_TIME", 2061, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("UPDATE_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHECK_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHECKSUM", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("PARTITION_COMMENT", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("NODEGROUP", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("TABLESPACE_NAME", 6165, "utf8mb3_general_ci", "", 268, 0, false, "")) infSchema["PARTITIONS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("PLUGIN_NAME", 6165)) - cols = append(cols, createCol("PLUGIN_VERSION", 6165)) - cols = append(cols, createCol("PLUGIN_STATUS", 6165)) - cols = append(cols, createCol("PLUGIN_TYPE", 6165)) - cols = append(cols, createCol("PLUGIN_TYPE_VERSION", 6165)) - cols = append(cols, createCol("PLUGIN_LIBRARY", 6165)) - cols = append(cols, createCol("PLUGIN_LIBRARY_VERSION", 6165)) - cols = append(cols, createCol("PLUGIN_AUTHOR", 6165)) - cols = append(cols, createCol("PLUGIN_DESCRIPTION", 6165)) - cols = append(cols, createCol("PLUGIN_LICENSE", 6165)) - cols = append(cols, createCol("LOAD_OPTION", 6165)) + cols = append(cols, createCol("PLUGIN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PLUGIN_VERSION", 6165, "utf8mb3_general_ci", "", 20, 0, true, "")) + cols = append(cols, createCol("PLUGIN_STATUS", 6165, "utf8mb3_general_ci", "", 10, 0, true, "")) + cols = append(cols, createCol("PLUGIN_TYPE", 6165, "utf8mb3_general_ci", "", 80, 0, true, "")) + cols = append(cols, createCol("PLUGIN_TYPE_VERSION", 6165, "utf8mb3_general_ci", "", 20, 0, true, "")) + cols = append(cols, createCol("PLUGIN_LIBRARY", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("PLUGIN_LIBRARY_VERSION", 6165, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("PLUGIN_AUTHOR", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("PLUGIN_DESCRIPTION", 6165, "utf8mb3_general_ci", "", 65535, 0, false, "")) + cols = append(cols, createCol("PLUGIN_LICENSE", 6165, "utf8mb3_general_ci", "", 80, 0, false, "")) + cols = append(cols, createCol("LOAD_OPTION", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) infSchema["PLUGINS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("ID", 778)) - cols = append(cols, createCol("USER", 6165)) - cols = append(cols, createCol("HOST", 6165)) - cols = append(cols, createCol("DB", 6165)) - cols = append(cols, createCol("COMMAND", 6165)) - cols = append(cols, createCol("TIME", 263)) - cols = append(cols, createCol("STATE", 6165)) - cols = append(cols, createCol("INFO", 6165)) + cols = append(cols, createCol("ID", 778, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("USER", 6165, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("HOST", 6165, "utf8mb3_general_ci", "", 261, 0, true, "")) + cols = append(cols, createCol("DB", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("COMMAND", 6165, "utf8mb3_general_ci", "", 16, 0, true, "")) + cols = append(cols, createCol("TIME", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("STATE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("INFO", 6165, "utf8mb3_general_ci", "", 65535, 0, false, "")) infSchema["PROCESSLIST"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("QUERY_ID", 263)) - cols = append(cols, createCol("SEQ", 263)) - cols = append(cols, createCol("STATE", 6165)) - cols = append(cols, createCol("DURATION", 18)) - cols = append(cols, createCol("CPU_USER", 18)) - cols = append(cols, createCol("CPU_SYSTEM", 18)) - cols = append(cols, createCol("CONTEXT_VOLUNTARY", 263)) - cols = append(cols, createCol("CONTEXT_INVOLUNTARY", 263)) - cols = append(cols, createCol("BLOCK_OPS_IN", 263)) - cols = append(cols, createCol("BLOCK_OPS_OUT", 263)) - cols = append(cols, createCol("MESSAGES_SENT", 263)) - cols = append(cols, createCol("MESSAGES_RECEIVED", 263)) - cols = append(cols, createCol("PAGE_FAULTS_MAJOR", 263)) - cols = append(cols, createCol("PAGE_FAULTS_MINOR", 263)) - cols = append(cols, createCol("SWAPS", 263)) - cols = append(cols, createCol("SOURCE_FUNCTION", 6165)) - cols = append(cols, createCol("SOURCE_FILE", 6165)) - cols = append(cols, createCol("SOURCE_LINE", 263)) + cols = append(cols, createCol("QUERY_ID", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SEQ", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("STATE", 6165, "utf8mb3_general_ci", "", 30, 0, true, "")) + cols = append(cols, createCol("DURATION", 18, "utf8mb3_general_ci", "", 905, 0, true, "")) + cols = append(cols, createCol("CPU_USER", 18, "utf8mb3_general_ci", "", 905, 0, false, "")) + cols = append(cols, createCol("CPU_SYSTEM", 18, "utf8mb3_general_ci", "", 905, 0, false, "")) + cols = append(cols, createCol("CONTEXT_VOLUNTARY", 263, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CONTEXT_INVOLUNTARY", 263, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("BLOCK_OPS_IN", 263, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("BLOCK_OPS_OUT", 263, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("MESSAGES_SENT", 263, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("MESSAGES_RECEIVED", 263, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("PAGE_FAULTS_MAJOR", 263, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("PAGE_FAULTS_MINOR", 263, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("SWAPS", 263, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("SOURCE_FUNCTION", 6165, "utf8mb3_general_ci", "", 30, 0, false, "")) + cols = append(cols, createCol("SOURCE_FILE", 6165, "utf8mb3_general_ci", "", 20, 0, false, "")) + cols = append(cols, createCol("SOURCE_LINE", 263, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["PROFILING"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165)) - cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165)) - cols = append(cols, createCol("CONSTRAINT_NAME", 6165)) - cols = append(cols, createCol("UNIQUE_CONSTRAINT_CATALOG", 6165)) - cols = append(cols, createCol("UNIQUE_CONSTRAINT_SCHEMA", 6165)) - cols = append(cols, createCol("UNIQUE_CONSTRAINT_NAME", 6165)) - cols = append(cols, createCol("MATCH_OPTION", 2074)) - cols = append(cols, createCol("UPDATE_RULE", 2074)) - cols = append(cols, createCol("DELETE_RULE", 2074)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("REFERENCED_TABLE_NAME", 6165)) + cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CONSTRAINT_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("UNIQUE_CONSTRAINT_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("UNIQUE_CONSTRAINT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("UNIQUE_CONSTRAINT_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("MATCH_OPTION", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'NONE','PARTIAL','FULL'")) + cols = append(cols, createCol("UPDATE_RULE", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'NO ACTION','RESTRICT','CASCADE','SET NULL','SET DEFAULT'")) + cols = append(cols, createCol("DELETE_RULE", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'NO ACTION','RESTRICT','CASCADE','SET NULL','SET DEFAULT'")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("REFERENCED_TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) infSchema["REFERENTIAL_CONSTRAINTS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("RESOURCE_GROUP_NAME", 6165)) - cols = append(cols, createCol("RESOURCE_GROUP_TYPE", 2074)) - cols = append(cols, createCol("RESOURCE_GROUP_ENABLED", 257)) - cols = append(cols, createCol("VCPU_IDS", 10260)) - cols = append(cols, createCol("THREAD_PRIORITY", 263)) + cols = append(cols, createCol("RESOURCE_GROUP_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("RESOURCE_GROUP_TYPE", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'SYSTEM','USER'")) + cols = append(cols, createCol("RESOURCE_GROUP_ENABLED", 257, "utf8mb3_general_ci", "", 1, 0, true, "")) + cols = append(cols, createCol("VCPU_IDS", 10260, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("THREAD_PRIORITY", 263, "utf8mb3_general_ci", "", 0, 0, true, "")) infSchema["RESOURCE_GROUPS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("GRANTOR", 6165)) - cols = append(cols, createCol("GRANTOR_HOST", 6165)) - cols = append(cols, createCol("GRANTEE", 6167)) - cols = append(cols, createCol("GRANTEE_HOST", 6167)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6167)) - cols = append(cols, createCol("TABLE_NAME", 6167)) - cols = append(cols, createCol("COLUMN_NAME", 6167)) - cols = append(cols, createCol("PRIVILEGE_TYPE", 2075)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) + cols = append(cols, createCol("GRANTOR", 6165, "utf8mb3_general_ci", "", 97, 0, false, "")) + cols = append(cols, createCol("GRANTOR_HOST", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("GRANTEE", 6167, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("GRANTEE_HOST", 6167, "utf8mb3_general_ci", "", 255, 0, true, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6167, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6167, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("COLUMN_NAME", 6167, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PRIVILEGE_TYPE", 2075, "utf8mb3_general_ci", "", 0, 0, true, "'Select','Insert','Update','References'")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["ROLE_COLUMN_GRANTS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("GRANTOR", 6165)) - cols = append(cols, createCol("GRANTOR_HOST", 6165)) - cols = append(cols, createCol("GRANTEE", 6167)) - cols = append(cols, createCol("GRANTEE_HOST", 6167)) - cols = append(cols, createCol("SPECIFIC_CATALOG", 6165)) - cols = append(cols, createCol("SPECIFIC_SCHEMA", 6167)) - cols = append(cols, createCol("SPECIFIC_NAME", 6167)) - cols = append(cols, createCol("ROUTINE_CATALOG", 6165)) - cols = append(cols, createCol("ROUTINE_SCHEMA", 6167)) - cols = append(cols, createCol("ROUTINE_NAME", 6167)) - cols = append(cols, createCol("PRIVILEGE_TYPE", 2075)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) + cols = append(cols, createCol("GRANTOR", 6165, "utf8mb3_general_ci", "", 97, 0, false, "")) + cols = append(cols, createCol("GRANTOR_HOST", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("GRANTEE", 6167, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("GRANTEE_HOST", 6167, "utf8mb3_general_ci", "", 255, 0, true, "")) + cols = append(cols, createCol("SPECIFIC_CATALOG", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("SPECIFIC_SCHEMA", 6167, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("SPECIFIC_NAME", 6167, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ROUTINE_CATALOG", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("ROUTINE_SCHEMA", 6167, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ROUTINE_NAME", 6167, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PRIVILEGE_TYPE", 2075, "utf8mb3_general_ci", "", 0, 0, true, "'Execute','Alter Routine','Grant'")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["ROLE_ROUTINE_GRANTS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("GRANTOR", 6165)) - cols = append(cols, createCol("GRANTOR_HOST", 6165)) - cols = append(cols, createCol("GRANTEE", 6167)) - cols = append(cols, createCol("GRANTEE_HOST", 6167)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6167)) - cols = append(cols, createCol("TABLE_NAME", 6167)) - cols = append(cols, createCol("PRIVILEGE_TYPE", 2075)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) + cols = append(cols, createCol("GRANTOR", 6165, "utf8mb3_general_ci", "", 97, 0, false, "")) + cols = append(cols, createCol("GRANTOR_HOST", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("GRANTEE", 6167, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("GRANTEE_HOST", 6167, "utf8mb3_general_ci", "", 255, 0, true, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6167, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6167, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PRIVILEGE_TYPE", 2075, "utf8mb3_general_ci", "", 0, 0, true, "'Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger'")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["ROLE_TABLE_GRANTS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("SPECIFIC_NAME", 6165)) - cols = append(cols, createCol("ROUTINE_CATALOG", 6165)) - cols = append(cols, createCol("ROUTINE_SCHEMA", 6165)) - cols = append(cols, createCol("ROUTINE_NAME", 6165)) - cols = append(cols, createCol("ROUTINE_TYPE", 2074)) - cols = append(cols, createCol("DATA_TYPE", 6163)) - cols = append(cols, createCol("CHARACTER_MAXIMUM_LENGTH", 265)) - cols = append(cols, createCol("CHARACTER_OCTET_LENGTH", 265)) - cols = append(cols, createCol("NUMERIC_PRECISION", 776)) - cols = append(cols, createCol("NUMERIC_SCALE", 776)) - cols = append(cols, createCol("DATETIME_PRECISION", 776)) - cols = append(cols, createCol("CHARACTER_SET_NAME", 6165)) - cols = append(cols, createCol("COLLATION_NAME", 6165)) - cols = append(cols, createCol("DTD_IDENTIFIER", 6163)) - cols = append(cols, createCol("ROUTINE_BODY", 6165)) - cols = append(cols, createCol("ROUTINE_DEFINITION", 6163)) - cols = append(cols, createCol("EXTERNAL_NAME", 10264)) - cols = append(cols, createCol("EXTERNAL_LANGUAGE", 6165)) - cols = append(cols, createCol("PARAMETER_STYLE", 6165)) - cols = append(cols, createCol("IS_DETERMINISTIC", 6165)) - cols = append(cols, createCol("SQL_DATA_ACCESS", 2074)) - cols = append(cols, createCol("SQL_PATH", 10264)) - cols = append(cols, createCol("SECURITY_TYPE", 2074)) - cols = append(cols, createCol("CREATED", 2061)) - cols = append(cols, createCol("LAST_ALTERED", 2061)) - cols = append(cols, createCol("SQL_MODE", 2075)) - cols = append(cols, createCol("ROUTINE_COMMENT", 6163)) - cols = append(cols, createCol("DEFINER", 6165)) - cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165)) - cols = append(cols, createCol("COLLATION_CONNECTION", 6165)) - cols = append(cols, createCol("DATABASE_COLLATION", 6165)) + cols = append(cols, createCol("SPECIFIC_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ROUTINE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("ROUTINE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("ROUTINE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ROUTINE_TYPE", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'FUNCTION','PROCEDURE'")) + cols = append(cols, createCol("DATA_TYPE", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHARACTER_MAXIMUM_LENGTH", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHARACTER_OCTET_LENGTH", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("NUMERIC_PRECISION", 776, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("NUMERIC_SCALE", 776, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DATETIME_PRECISION", 776, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("COLLATION_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("DTD_IDENTIFIER", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("ROUTINE_BODY", 6165, "utf8mb3_general_ci", "", 8, 0, true, "")) + cols = append(cols, createCol("ROUTINE_DEFINITION", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("EXTERNAL_NAME", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("EXTERNAL_LANGUAGE", 6165, "utf8mb3_general_ci", "SQL", 64, 0, true, "")) + cols = append(cols, createCol("PARAMETER_STYLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("IS_DETERMINISTIC", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("SQL_DATA_ACCESS", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'CONTAINS SQL','NO SQL','READS SQL DATA','MODIFIES SQL DATA'")) + cols = append(cols, createCol("SQL_PATH", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("SECURITY_TYPE", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'DEFAULT','INVOKER','DEFINER'")) + cols = append(cols, createCol("CREATED", 2061, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("LAST_ALTERED", 2061, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("SQL_MODE", 2075, "utf8mb3_general_ci", "", 0, 0, true, "'REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','NOT_USED_9','NOT_USED_10','NOT_USED_11','NOT_USED_12','NOT_USED_13','NOT_USED_14','NOT_USED_15','NOT_USED_16','NOT_USED_17','NOT_USED_18','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','ALLOW_INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NOT_USED_29','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','TIME_TRUNCATE_FRACTIONAL'")) + cols = append(cols, createCol("ROUTINE_COMMENT", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("DEFINER", 6165, "utf8mb3_general_ci", "", 288, 0, true, "")) + cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("COLLATION_CONNECTION", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("DATABASE_COLLATION", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) infSchema["ROUTINES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("GRANTEE", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("PRIVILEGE_TYPE", 6165)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) + cols = append(cols, createCol("GRANTEE", 6165, "utf8mb3_general_ci", "", 292, 0, true, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PRIVILEGE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["SCHEMA_PRIVILEGES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("CATALOG_NAME", 6165)) - cols = append(cols, createCol("SCHEMA_NAME", 6165)) - cols = append(cols, createCol("DEFAULT_CHARACTER_SET_NAME", 6165)) - cols = append(cols, createCol("DEFAULT_COLLATION_NAME", 6165)) - cols = append(cols, createCol("SQL_PATH", 10264)) - cols = append(cols, createCol("DEFAULT_ENCRYPTION", 2074)) + cols = append(cols, createCol("CATALOG_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("SCHEMA_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("DEFAULT_CHARACTER_SET_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("DEFAULT_COLLATION_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("SQL_PATH", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DEFAULT_ENCRYPTION", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'NO','YES'")) infSchema["SCHEMATA"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("CATALOG_NAME", 6165)) - cols = append(cols, createCol("SCHEMA_NAME", 6165)) - cols = append(cols, createCol("OPTIONS", 6165)) + cols = append(cols, createCol("CATALOG_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("SCHEMA_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("OPTIONS", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) infSchema["SCHEMATA_EXTENSIONS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("COLUMN_NAME", 6165)) - cols = append(cols, createCol("SRS_NAME", 6165)) - cols = append(cols, createCol("SRS_ID", 776)) - cols = append(cols, createCol("GEOMETRY_TYPE_NAME", 6163)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("SRS_NAME", 6165, "utf8mb3_general_ci", "", 80, 0, false, "")) + cols = append(cols, createCol("SRS_ID", 776, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("GEOMETRY_TYPE_NAME", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["ST_GEOMETRY_COLUMNS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("SRS_NAME", 6165)) - cols = append(cols, createCol("SRS_ID", 776)) - cols = append(cols, createCol("ORGANIZATION", 6165)) - cols = append(cols, createCol("ORGANIZATION_COORDSYS_ID", 776)) - cols = append(cols, createCol("DEFINITION", 6165)) - cols = append(cols, createCol("DESCRIPTION", 6165)) + cols = append(cols, createCol("SRS_NAME", 6165, "utf8mb3_general_ci", "", 80, 0, true, "")) + cols = append(cols, createCol("SRS_ID", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ORGANIZATION", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("ORGANIZATION_COORDSYS_ID", 776, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DEFINITION", 6165, "utf8mb3_general_ci", "", 4096, 0, true, "")) + cols = append(cols, createCol("DESCRIPTION", 6165, "utf8mb3_general_ci", "", 2048, 0, false, "")) infSchema["ST_SPATIAL_REFERENCE_SYSTEMS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("UNIT_NAME", 6165)) - cols = append(cols, createCol("UNIT_TYPE", 6165)) - cols = append(cols, createCol("CONVERSION_FACTOR", 1036)) - cols = append(cols, createCol("DESCRIPTION", 6165)) + cols = append(cols, createCol("UNIT_NAME", 6165, "utf8mb3_general_ci", "", 255, 0, false, "")) + cols = append(cols, createCol("UNIT_TYPE", 6165, "utf8mb3_general_ci", "", 7, 0, false, "")) + cols = append(cols, createCol("CONVERSION_FACTOR", 1036, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DESCRIPTION", 6165, "utf8mb3_general_ci", "", 255, 0, false, "")) infSchema["ST_UNITS_OF_MEASURE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("NON_UNIQUE", 263)) - cols = append(cols, createCol("INDEX_SCHEMA", 6165)) - cols = append(cols, createCol("INDEX_NAME", 6165)) - cols = append(cols, createCol("SEQ_IN_INDEX", 776)) - cols = append(cols, createCol("COLUMN_NAME", 6165)) - cols = append(cols, createCol("COLLATION", 6165)) - cols = append(cols, createCol("CARDINALITY", 265)) - cols = append(cols, createCol("SUB_PART", 265)) - cols = append(cols, createCol("PACKED", 10264)) - cols = append(cols, createCol("NULLABLE", 6165)) - cols = append(cols, createCol("INDEX_TYPE", 6165)) - cols = append(cols, createCol("COMMENT", 6165)) - cols = append(cols, createCol("INDEX_COMMENT", 6165)) - cols = append(cols, createCol("IS_VISIBLE", 6165)) - cols = append(cols, createCol("EXPRESSION", 6163)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("NON_UNIQUE", 263, "utf8mb3_general_ci", "0", 0, 0, true, "")) + cols = append(cols, createCol("INDEX_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("INDEX_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("SEQ_IN_INDEX", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("COLUMN_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("COLLATION", 6165, "utf8mb3_general_ci", "", 1, 0, false, "")) + cols = append(cols, createCol("CARDINALITY", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("SUB_PART", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("PACKED", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("NULLABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("INDEX_TYPE", 6165, "utf8mb3_general_ci", "", 11, 0, true, "")) + cols = append(cols, createCol("COMMENT", 6165, "utf8mb3_general_ci", "", 8, 0, true, "")) + cols = append(cols, createCol("INDEX_COMMENT", 6165, "utf8mb3_general_ci", "", 2048, 0, true, "")) + cols = append(cols, createCol("IS_VISIBLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("EXPRESSION", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["STATISTICS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165)) - cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165)) - cols = append(cols, createCol("CONSTRAINT_NAME", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("CONSTRAINT_TYPE", 6165)) - cols = append(cols, createCol("ENFORCED", 6165)) + cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("CONSTRAINT_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("CONSTRAINT_TYPE", 6165, "utf8mb3_general_ci", "", 11, 0, true, "")) + cols = append(cols, createCol("ENFORCED", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["TABLE_CONSTRAINTS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165)) - cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165)) - cols = append(cols, createCol("CONSTRAINT_NAME", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("ENGINE_ATTRIBUTE", 2078)) - cols = append(cols, createCol("SECONDARY_ENGINE_ATTRIBUTE", 2078)) + cols = append(cols, createCol("CONSTRAINT_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CONSTRAINT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("CONSTRAINT_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ENGINE_ATTRIBUTE", 2078, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("SECONDARY_ENGINE_ATTRIBUTE", 2078, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["TABLE_CONSTRAINTS_EXTENSIONS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("GRANTEE", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("PRIVILEGE_TYPE", 6165)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) + cols = append(cols, createCol("GRANTEE", 6165, "utf8mb3_general_ci", "", 292, 0, true, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("PRIVILEGE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["TABLE_PRIVILEGES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("TABLE_TYPE", 2074)) - cols = append(cols, createCol("ENGINE", 6165)) - cols = append(cols, createCol("VERSION", 263)) - cols = append(cols, createCol("ROW_FORMAT", 2074)) - cols = append(cols, createCol("TABLE_ROWS", 778)) - cols = append(cols, createCol("AVG_ROW_LENGTH", 778)) - cols = append(cols, createCol("DATA_LENGTH", 778)) - cols = append(cols, createCol("MAX_DATA_LENGTH", 778)) - cols = append(cols, createCol("INDEX_LENGTH", 778)) - cols = append(cols, createCol("DATA_FREE", 778)) - cols = append(cols, createCol("AUTO_INCREMENT", 778)) - cols = append(cols, createCol("CREATE_TIME", 2061)) - cols = append(cols, createCol("UPDATE_TIME", 2064)) - cols = append(cols, createCol("CHECK_TIME", 2064)) - cols = append(cols, createCol("TABLE_COLLATION", 6165)) - cols = append(cols, createCol("CHECKSUM", 265)) - cols = append(cols, createCol("CREATE_OPTIONS", 6165)) - cols = append(cols, createCol("TABLE_COMMENT", 6163)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_TYPE", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'BASE TABLE','VIEW','SYSTEM VIEW'")) + cols = append(cols, createCol("ENGINE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("VERSION", 263, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("ROW_FORMAT", 2074, "utf8mb3_general_ci", "", 0, 0, false, "'Fixed','Dynamic','Compressed','Redundant','Compact','Paged'")) + cols = append(cols, createCol("TABLE_ROWS", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("AVG_ROW_LENGTH", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DATA_LENGTH", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("MAX_DATA_LENGTH", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("INDEX_LENGTH", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("DATA_FREE", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("AUTO_INCREMENT", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CREATE_TIME", 2061, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("UPDATE_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHECK_TIME", 2064, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TABLE_COLLATION", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("CHECKSUM", 265, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CREATE_OPTIONS", 6165, "utf8mb3_general_ci", "", 256, 0, false, "")) + cols = append(cols, createCol("TABLE_COMMENT", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["TABLES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("ENGINE_ATTRIBUTE", 2078)) - cols = append(cols, createCol("SECONDARY_ENGINE_ATTRIBUTE", 2078)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ENGINE_ATTRIBUTE", 2078, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("SECONDARY_ENGINE_ATTRIBUTE", 2078, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["TABLES_EXTENSIONS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLESPACE_NAME", 6165)) - cols = append(cols, createCol("ENGINE", 6165)) - cols = append(cols, createCol("TABLESPACE_TYPE", 6165)) - cols = append(cols, createCol("LOGFILE_GROUP_NAME", 6165)) - cols = append(cols, createCol("EXTENT_SIZE", 778)) - cols = append(cols, createCol("AUTOEXTEND_SIZE", 778)) - cols = append(cols, createCol("MAXIMUM_SIZE", 778)) - cols = append(cols, createCol("NODEGROUP_ID", 778)) - cols = append(cols, createCol("TABLESPACE_COMMENT", 6165)) + cols = append(cols, createCol("TABLESPACE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("ENGINE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("TABLESPACE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("LOGFILE_GROUP_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("EXTENT_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("AUTOEXTEND_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("MAXIMUM_SIZE", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("NODEGROUP_ID", 778, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("TABLESPACE_COMMENT", 6165, "utf8mb3_general_ci", "", 2048, 0, false, "")) infSchema["TABLESPACES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLESPACE_NAME", 6165)) - cols = append(cols, createCol("ENGINE_ATTRIBUTE", 2078)) + cols = append(cols, createCol("TABLESPACE_NAME", 6165, "utf8mb3_general_ci", "", 268, 0, true, "")) + cols = append(cols, createCol("ENGINE_ATTRIBUTE", 2078, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["TABLESPACES_EXTENSIONS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TRIGGER_CATALOG", 6165)) - cols = append(cols, createCol("TRIGGER_SCHEMA", 6165)) - cols = append(cols, createCol("TRIGGER_NAME", 6165)) - cols = append(cols, createCol("EVENT_MANIPULATION", 2074)) - cols = append(cols, createCol("EVENT_OBJECT_CATALOG", 6165)) - cols = append(cols, createCol("EVENT_OBJECT_SCHEMA", 6165)) - cols = append(cols, createCol("EVENT_OBJECT_TABLE", 6165)) - cols = append(cols, createCol("ACTION_ORDER", 776)) - cols = append(cols, createCol("ACTION_CONDITION", 10264)) - cols = append(cols, createCol("ACTION_STATEMENT", 6163)) - cols = append(cols, createCol("ACTION_ORIENTATION", 6165)) - cols = append(cols, createCol("ACTION_TIMING", 2074)) - cols = append(cols, createCol("ACTION_REFERENCE_OLD_TABLE", 10264)) - cols = append(cols, createCol("ACTION_REFERENCE_NEW_TABLE", 10264)) - cols = append(cols, createCol("ACTION_REFERENCE_OLD_ROW", 6165)) - cols = append(cols, createCol("ACTION_REFERENCE_NEW_ROW", 6165)) - cols = append(cols, createCol("CREATED", 2061)) - cols = append(cols, createCol("SQL_MODE", 2075)) - cols = append(cols, createCol("DEFINER", 6165)) - cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165)) - cols = append(cols, createCol("COLLATION_CONNECTION", 6165)) - cols = append(cols, createCol("DATABASE_COLLATION", 6165)) + cols = append(cols, createCol("TRIGGER_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TRIGGER_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TRIGGER_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("EVENT_MANIPULATION", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'INSERT','UPDATE','DELETE'")) + cols = append(cols, createCol("EVENT_OBJECT_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("EVENT_OBJECT_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("EVENT_OBJECT_TABLE", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("ACTION_ORDER", 776, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ACTION_CONDITION", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("ACTION_STATEMENT", 6163, "utf8mb3_general_ci", "", 0, 0, true, "")) + cols = append(cols, createCol("ACTION_ORIENTATION", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("ACTION_TIMING", 2074, "utf8mb3_general_ci", "", 0, 0, true, "'BEFORE','AFTER'")) + cols = append(cols, createCol("ACTION_REFERENCE_OLD_TABLE", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("ACTION_REFERENCE_NEW_TABLE", 10264, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("ACTION_REFERENCE_OLD_ROW", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("ACTION_REFERENCE_NEW_ROW", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) + cols = append(cols, createCol("CREATED", 2061, "utf8mb3_general_ci", "", 2, 0, true, "")) + cols = append(cols, createCol("SQL_MODE", 2075, "utf8mb3_general_ci", "", 0, 0, true, "'REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','NOT_USED_9','NOT_USED_10','NOT_USED_11','NOT_USED_12','NOT_USED_13','NOT_USED_14','NOT_USED_15','NOT_USED_16','NOT_USED_17','NOT_USED_18','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','ALLOW_INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NOT_USED_29','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','TIME_TRUNCATE_FRACTIONAL'")) + cols = append(cols, createCol("DEFINER", 6165, "utf8mb3_general_ci", "", 288, 0, true, "")) + cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("COLLATION_CONNECTION", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("DATABASE_COLLATION", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) infSchema["TRIGGERS"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("USER", 6167)) - cols = append(cols, createCol("HOST", 6167)) - cols = append(cols, createCol("ATTRIBUTE", 6163)) + cols = append(cols, createCol("USER", 6167, "utf8mb3_general_ci", "", 32, 0, true, "")) + cols = append(cols, createCol("HOST", 6167, "utf8mb3_general_ci", "", 255, 0, true, "")) + cols = append(cols, createCol("ATTRIBUTE", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) infSchema["USER_ATTRIBUTES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("GRANTEE", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("PRIVILEGE_TYPE", 6165)) - cols = append(cols, createCol("IS_GRANTABLE", 6165)) + cols = append(cols, createCol("GRANTEE", 6165, "utf8mb3_general_ci", "", 292, 0, true, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 512, 0, true, "")) + cols = append(cols, createCol("PRIVILEGE_TYPE", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("IS_GRANTABLE", 6165, "utf8mb3_general_ci", "", 3, 0, true, "")) infSchema["USER_PRIVILEGES"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("SPECIFIC_CATALOG", 6165)) - cols = append(cols, createCol("SPECIFIC_SCHEMA", 6165)) - cols = append(cols, createCol("SPECIFIC_NAME", 6165)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("SPECIFIC_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("SPECIFIC_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("SPECIFIC_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) infSchema["VIEW_ROUTINE_USAGE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("VIEW_CATALOG", 6165)) - cols = append(cols, createCol("VIEW_SCHEMA", 6165)) - cols = append(cols, createCol("VIEW_NAME", 6165)) - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) + cols = append(cols, createCol("VIEW_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("VIEW_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("VIEW_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) infSchema["VIEW_TABLE_USAGE"] = cols cols = []vindexes.Column{} - cols = append(cols, createCol("TABLE_CATALOG", 6165)) - cols = append(cols, createCol("TABLE_SCHEMA", 6165)) - cols = append(cols, createCol("TABLE_NAME", 6165)) - cols = append(cols, createCol("VIEW_DEFINITION", 6163)) - cols = append(cols, createCol("CHECK_OPTION", 2074)) - cols = append(cols, createCol("IS_UPDATABLE", 2074)) - cols = append(cols, createCol("DEFINER", 6165)) - cols = append(cols, createCol("SECURITY_TYPE", 6165)) - cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165)) - cols = append(cols, createCol("COLLATION_CONNECTION", 6165)) + cols = append(cols, createCol("TABLE_CATALOG", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_SCHEMA", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("TABLE_NAME", 6165, "utf8mb3_general_ci", "", 64, 0, false, "")) + cols = append(cols, createCol("VIEW_DEFINITION", 6163, "utf8mb3_general_ci", "", 0, 0, false, "")) + cols = append(cols, createCol("CHECK_OPTION", 2074, "utf8mb3_general_ci", "", 0, 0, false, "'NONE','LOCAL','CASCADED'")) + cols = append(cols, createCol("IS_UPDATABLE", 2074, "utf8mb3_general_ci", "", 0, 0, false, "'NO','YES'")) + cols = append(cols, createCol("DEFINER", 6165, "utf8mb3_general_ci", "", 288, 0, false, "")) + cols = append(cols, createCol("SECURITY_TYPE", 6165, "utf8mb3_general_ci", "", 7, 0, false, "")) + cols = append(cols, createCol("CHARACTER_SET_CLIENT", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) + cols = append(cols, createCol("COLLATION_CONNECTION", 6165, "utf8mb3_general_ci", "", 64, 0, true, "")) infSchema["VIEWS"] = cols - return infSchema } diff --git a/go/vt/vtgate/semantics/info_schema_gen_test.go b/go/vt/vtgate/semantics/info_schema_gen_test.go index 61241d96653..da06b80ac30 100644 --- a/go/vt/vtgate/semantics/info_schema_gen_test.go +++ b/go/vt/vtgate/semantics/info_schema_gen_test.go @@ -20,12 +20,16 @@ import ( "database/sql" "fmt" "regexp" + "strconv" "strings" "testing" _ "github.com/go-sql-driver/mysql" "github.com/stretchr/testify/require" + "vitess.io/vitess/go/mysql/collations" + "vitess.io/vitess/go/sqltypes" + "vitess.io/vitess/go/vt/sqlparser" ) @@ -37,11 +41,16 @@ func TestGenerateInfoSchemaMap(t *testing.T) { require.NoError(t, err) defer db.Close() + collationName := collations.Local().LookupName(collations.SystemCollation.Collation) + for _, tbl := range informationSchemaTables80 { - b.WriteString("cols = []vindexes.Column{}\n") result, err := db.Query(fmt.Sprintf("show columns from information_schema.`%s`", tbl)) - require.NoError(t, err) + if err != nil { + t.Logf("error querying table %s: %v", tbl, err) + continue + } defer result.Close() + b.WriteString("cols = []vindexes.Column{}\n") for result.Next() { var r row result.Scan(&r.Field, &r.Type, &r.Null, &r.Key, &r.Default, &r.Extra) @@ -61,7 +70,24 @@ func TestGenerateInfoSchemaMap(t *testing.T) { if int(i2) == 0 { t.Fatalf("%s %s", tbl, r.Field) } - b.WriteString(fmt.Sprintf("cols = append(cols, createCol(\"%s\", %d))\n", r.Field, int(i2))) + var size, scale int64 + var values string + switch i2 { + case sqltypes.Enum, sqltypes.Set: + values = allString[2] + default: + if len(allString) > 1 && allString[2] != "" { + parts := strings.Split(allString[2], ",") + size, err = strconv.ParseInt(parts[0], 10, 32) + require.NoError(t, err) + if len(parts) > 1 { + scale, err = strconv.ParseInt(parts[1], 10, 32) + require.NoError(t, err) + } + } + } + // createCol(name string, typ int, collation string, def string, invisible bool, size, scale int32, notNullable bool) + b.WriteString(fmt.Sprintf("cols = append(cols, createCol(\"%s\", %d, \"%s\", \"%s\", %d, %d, %t, \"%s\"))\n", r.Field, int(i2), collationName, r.Default, size, scale, r.Null == "NO", values)) } b.WriteString(fmt.Sprintf("infSchema[\"%s\"] = cols\n", tbl)) } @@ -85,6 +111,8 @@ var ( "ENGINES", "EVENTS", "FILES", + "GLOBAL_STATUS", + "GLOBAL_VARIABLES", "INNODB_BUFFER_PAGE", "INNODB_BUFFER_PAGE_LRU", "INNODB_BUFFER_POOL_STATS", @@ -158,7 +186,7 @@ type row struct { Type string Null string Key any - Default any + Default string Extra any } diff --git a/go/vt/vtgate/semantics/real_table.go b/go/vt/vtgate/semantics/real_table.go index cf7811f4404..da55d95895f 100644 --- a/go/vt/vtgate/semantics/real_table.go +++ b/go/vt/vtgate/semantics/real_table.go @@ -19,12 +19,9 @@ package semantics import ( "strings" - "vitess.io/vitess/go/mysql/collations" - "vitess.io/vitess/go/sqltypes" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vterrors" - "vitess.io/vitess/go/vt/vtgate/evalengine" "vitess.io/vitess/go/vt/vtgate/vindexes" ) @@ -125,20 +122,10 @@ func vindexTableToColumnInfo(tbl *vindexes.Table) []ColumnInfo { nameMap := map[string]any{} cols := make([]ColumnInfo, 0, len(tbl.Columns)) for _, col := range tbl.Columns { - collation := collations.DefaultCollationForType(col.Type) - if sqltypes.IsText(col.Type) { - coll, found := collations.Local().LookupID(col.CollationName) - if found { - collation = coll - } - } cols = append(cols, ColumnInfo{ - Name: col.Name.String(), - Type: evalengine.Type{ - Type: col.Type, - Coll: collation, - }, + Name: col.Name.String(), + Type: col.ToEvalengineType(), Invisible: col.Invisible, }) nameMap[col.Name.String()] = nil diff --git a/go/vt/vtgate/semantics/semantic_state.go b/go/vt/vtgate/semantics/semantic_state.go index 8292ebdf4aa..6668070a575 100644 --- a/go/vt/vtgate/semantics/semantic_state.go +++ b/go/vt/vtgate/semantics/semantic_state.go @@ -176,7 +176,9 @@ func (st *SemTable) CopyDependencies(from, to sqlparser.Expr) { st.Recursive[to] = st.RecursiveDeps(from) st.Direct[to] = st.DirectDeps(from) if ValidAsMapKey(from) { - st.ExprTypes[to] = st.ExprTypes[from] + if typ, found := st.ExprTypes[from]; found { + st.ExprTypes[to] = typ + } } } } @@ -609,16 +611,13 @@ func (st *SemTable) TypeForExpr(e sqlparser.Expr) (evalengine.Type, bool) { // We add a lot of WeightString() expressions to queries at late stages of the planning, // which means that they don't have any type information. We can safely assume that they // are VarBinary, since that's the only type that WeightString() can return. - _, isWS := e.(*sqlparser.WeightStringFuncExpr) + ws, isWS := e.(*sqlparser.WeightStringFuncExpr) if isWS { - return evalengine.Type{ - Type: sqltypes.VarBinary, - Coll: collations.CollationBinaryID, - Nullable: false, // TODO: we should check if the argument is nullable - }, true + wt, _ := st.TypeForExpr(ws.Expr) + return evalengine.NewTypeEx(sqltypes.VarBinary, collations.CollationBinaryID, wt.Nullable(), 0, 0), true } - return evalengine.UnknownType(), false + return evalengine.Type{}, false } // NeedsWeightString returns true if the given expression needs weight_string to do safe comparisons @@ -631,7 +630,7 @@ func (st *SemTable) NeedsWeightString(e sqlparser.Expr) bool { if !found { return true } - return typ.Coll == collations.Unknown && !sqltypes.IsNumber(typ.Type) + return typ.Collation() == collations.Unknown && !sqltypes.IsNumber(typ.Type()) } } @@ -701,8 +700,7 @@ func RewriteDerivedTableExpression(expr sqlparser.Expr, vt TableInfo) sqlparser. // CopyExprInfo lookups src in the ExprTypes map and, if a key is found, assign // the corresponding Type value of src to dest. func (st *SemTable) CopyExprInfo(src, dest sqlparser.Expr) { - srcType, found := st.ExprTypes[src] - if found { + if srcType, found := st.ExprTypes[src]; found { st.ExprTypes[dest] = srcType } } diff --git a/go/vt/vtgate/semantics/typer.go b/go/vt/vtgate/semantics/typer.go index 625077f4da1..8b44105d255 100644 --- a/go/vt/vtgate/semantics/typer.go +++ b/go/vt/vtgate/semantics/typer.go @@ -37,21 +37,16 @@ func newTyper() *typer { } func (t *typer) exprType(expr sqlparser.Expr) evalengine.Type { - res, ok := t.m[expr] - if ok { - return res - } - - return evalengine.UnknownType() + return t.m[expr] } func (t *typer) up(cursor *sqlparser.Cursor) error { switch node := cursor.Node().(type) { case *sqlparser.Literal: - t.m[node] = evalengine.Type{Type: node.SQLType(), Coll: collations.DefaultCollationForType(node.SQLType())} + t.m[node] = evalengine.NewType(node.SQLType(), collations.DefaultCollationForType(node.SQLType())) case *sqlparser.Argument: if node.Type >= 0 { - t.m[node] = evalengine.Type{Type: node.Type, Coll: collations.DefaultCollationForType(node.Type)} + t.m[node] = evalengine.NewType(node.Type, collations.DefaultCollationForType(node.Type)) } case sqlparser.AggrFunc: code, ok := opcode.SupportedAggregates[node.AggrName()] @@ -61,11 +56,13 @@ func (t *typer) up(cursor *sqlparser.Cursor) error { inputType := sqltypes.Unknown if arg := node.GetArg(); arg != nil { if tt, ok := t.m[arg]; ok { - inputType = tt.Type + inputType = tt.Type() } } type_ := code.Type(inputType) - t.m[node] = evalengine.Type{Type: type_, Coll: collations.DefaultCollationForType(type_)} + _, isCount := node.(*sqlparser.Count) + _, isCountStart := node.(*sqlparser.CountStar) + t.m[node] = evalengine.NewTypeEx(type_, collations.DefaultCollationForType(type_), !(isCount || isCountStart), 0, 0) } return nil } diff --git a/go/vt/vtgate/semantics/typer_test.go b/go/vt/vtgate/semantics/typer_test.go index 4c77e6f5657..c5417edbf64 100644 --- a/go/vt/vtgate/semantics/typer_test.go +++ b/go/vt/vtgate/semantics/typer_test.go @@ -51,7 +51,7 @@ func TestNormalizerAndSemanticAnalysisIntegration(t *testing.T) { bv := parse.(*sqlparser.Select).SelectExprs[0].(*sqlparser.AliasedExpr).Expr.(*sqlparser.Argument) typ, found := st.ExprTypes[bv] require.True(t, found, "bindvar was not typed") - require.Equal(t, test.typ, typ.Type.String()) + require.Equal(t, test.typ, typ.Type().String()) }) } diff --git a/go/vt/vtgate/vindexes/vschema.go b/go/vt/vtgate/vindexes/vschema.go index 66321b7a41c..e724794b6cb 100644 --- a/go/vt/vtgate/vindexes/vschema.go +++ b/go/vt/vtgate/vindexes/vschema.go @@ -25,9 +25,11 @@ import ( "strings" "time" + "vitess.io/vitess/go/mysql/collations" "vitess.io/vitess/go/sqlescape" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/vterrors" + "vitess.io/vitess/go/vt/vtgate/evalengine" "vitess.io/vitess/go/json2" "vitess.io/vitess/go/sqltypes" @@ -188,7 +190,12 @@ type Column struct { Default sqlparser.Expr `json:"default,omitempty"` // Invisible marks this as a column that will not be automatically included in `*` projections - Invisible bool `json:"invisible"` + Invisible bool `json:"invisible,omitempty"` + Size int32 `json:"size,omitempty"` + Scale int32 `json:"scale,omitempty"` + Nullable bool `json:"nullable,omitempty"` + // Values contains the list of values for enum and set types. + Values []string `json:"values,omitempty"` } // MarshalJSON returns a JSON representation of Column. @@ -211,6 +218,17 @@ func (col *Column) MarshalJSON() ([]byte, error) { return json.Marshal(cj) } +func (col *Column) ToEvalengineType() evalengine.Type { + collation := collations.DefaultCollationForType(col.Type) + if sqltypes.IsText(col.Type) { + coll, found := collations.Local().LookupID(col.CollationName) + if found { + collation = coll + } + } + return evalengine.NewTypeEx(col.Type, collation, col.Nullable, col.Size, col.Scale) +} + // KeyspaceSchema contains the schema(table) for a keyspace. type KeyspaceSchema struct { Keyspace *Keyspace @@ -638,8 +656,22 @@ func buildTables(ks *vschemapb.Keyspace, vschema *VSchema, ksvschema *KeyspaceSc "could not parse the '%s' column's default expression '%s' for table '%s'", col.Name, col.Default, tname) } } + nullable := true + if col.Nullable != nil { + nullable = *col.Nullable + } colNames[name.Lowered()] = true - t.Columns = append(t.Columns, Column{Name: name, Type: col.Type, Invisible: col.Invisible, Default: colDefault}) + t.Columns = append(t.Columns, Column{ + Name: name, + Type: col.Type, + CollationName: col.CollationName, + Default: colDefault, + Invisible: col.Invisible, + Size: col.Size, + Scale: col.Scale, + Nullable: nullable, + Values: col.Values, + }) } // Initialize ColumnVindexes. diff --git a/go/vt/vtgate/vschema_manager_test.go b/go/vt/vtgate/vschema_manager_test.go index 2b6eaa6161d..4d414c9d58a 100644 --- a/go/vt/vtgate/vschema_manager_test.go +++ b/go/vt/vtgate/vschema_manager_test.go @@ -18,11 +18,13 @@ func TestVSchemaUpdate(t *testing.T) { Type: querypb.Type_INT64, }} cols2 := []vindexes.Column{{ - Name: sqlparser.NewIdentifierCI("uid"), - Type: querypb.Type_INT64, + Name: sqlparser.NewIdentifierCI("uid"), + Type: querypb.Type_INT64, + Nullable: true, }, { - Name: sqlparser.NewIdentifierCI("name"), - Type: querypb.Type_VARCHAR, + Name: sqlparser.NewIdentifierCI("name"), + Type: querypb.Type_VARCHAR, + Nullable: true, }} ks := &vindexes.Keyspace{Name: "ks"} tblNoCol := &vindexes.Table{Name: sqlparser.NewIdentifierCS("tbl"), Keyspace: ks, ColumnListAuthoritative: true} @@ -340,11 +342,13 @@ func TestRebuildVSchema(t *testing.T) { Type: querypb.Type_INT64, }} cols2 := []vindexes.Column{{ - Name: sqlparser.NewIdentifierCI("uid"), - Type: querypb.Type_INT64, + Name: sqlparser.NewIdentifierCI("uid"), + Type: querypb.Type_INT64, + Nullable: true, }, { - Name: sqlparser.NewIdentifierCI("name"), - Type: querypb.Type_VARCHAR, + Name: sqlparser.NewIdentifierCI("name"), + Type: querypb.Type_VARCHAR, + Nullable: true, }} ks := &vindexes.Keyspace{Name: "ks"} tblNoCol := &vindexes.Table{Name: sqlparser.NewIdentifierCS("tbl"), Keyspace: ks, ColumnListAuthoritative: true} diff --git a/go/vt/vttablet/tabletmanager/vdiff/utils.go b/go/vt/vttablet/tabletmanager/vdiff/utils.go index 5904fd41795..dc11dbf249c 100644 --- a/go/vt/vttablet/tabletmanager/vdiff/utils.go +++ b/go/vt/vttablet/tabletmanager/vdiff/utils.go @@ -42,14 +42,11 @@ func newMergeSorter(participants map[string]*shardStreamer, comparePKs []compare for i, cpk := range comparePKs { weightStringCol := -1 // if the collation is nil or unknown, use binary collation to compare as bytes - t := evalengine.Type{ - Type: sqltypes.Unknown, - Coll: collations.CollationBinaryID, - } + var collation collations.ID = collations.CollationBinaryID if cpk.collation != collations.Unknown { - t.Coll = cpk.collation + collation = cpk.collation } - ob[i] = evalengine.OrderByParams{Col: cpk.colIndex, WeightStringCol: weightStringCol, Type: t} + ob[i] = evalengine.OrderByParams{Col: cpk.colIndex, WeightStringCol: weightStringCol, Type: evalengine.NewType(sqltypes.Unknown, collation)} } return &engine.MergeSort{ Primitives: prims, @@ -69,7 +66,7 @@ func encodeString(in string) string { func pkColsToGroupByParams(pkCols []int) []*engine.GroupByParams { var res []*engine.GroupByParams for _, col := range pkCols { - res = append(res, &engine.GroupByParams{KeyCol: col, WeightStringCol: -1, Type: evalengine.UnknownType()}) + res = append(res, &engine.GroupByParams{KeyCol: col, WeightStringCol: -1}) } return res } diff --git a/go/vt/wrangler/vdiff.go b/go/vt/wrangler/vdiff.go index 2cbe5032c92..3084eba0e29 100644 --- a/go/vt/wrangler/vdiff.go +++ b/go/vt/wrangler/vdiff.go @@ -769,7 +769,7 @@ func (df *vdiff) buildTablePlan(table *tabletmanagerdatapb.TableDefinition, quer func pkColsToGroupByParams(pkCols []int) []*engine.GroupByParams { var res []*engine.GroupByParams for _, col := range pkCols { - res = append(res, &engine.GroupByParams{KeyCol: col, WeightStringCol: -1, Type: evalengine.UnknownType()}) + res = append(res, &engine.GroupByParams{KeyCol: col, WeightStringCol: -1, Type: evalengine.Type{}}) } return res } @@ -784,11 +784,11 @@ func newMergeSorter(participants map[string]*shardStreamer, comparePKs []compare for _, cpk := range comparePKs { weightStringCol := -1 // if the collation is nil or unknown, use binary collation to compare as bytes - t := evalengine.Type{Type: sqltypes.Unknown, Coll: collations.CollationBinaryID} + var collation collations.ID = collations.CollationBinaryID if cpk.collation != collations.Unknown { - t.Coll = cpk.collation + collation = cpk.collation } - ob = append(ob, evalengine.OrderByParams{Col: cpk.colIndex, WeightStringCol: weightStringCol, Type: t}) + ob = append(ob, evalengine.OrderByParams{Col: cpk.colIndex, WeightStringCol: weightStringCol, Type: evalengine.NewType(sqltypes.Unknown, collation)}) } return &engine.MergeSort{ Primitives: prims, diff --git a/go/vt/wrangler/vdiff_test.go b/go/vt/wrangler/vdiff_test.go index 28422b6cd4d..72e9e215c17 100644 --- a/go/vt/wrangler/vdiff_test.go +++ b/go/vt/wrangler/vdiff_test.go @@ -23,8 +23,6 @@ import ( "testing" "time" - "vitess.io/vitess/go/vt/vtgate/evalengine" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -406,7 +404,7 @@ func TestVDiffPlanSuccess(t *testing.T) { engine.NewAggregateParam(opcode.AggregateSum, 2, ""), engine.NewAggregateParam(opcode.AggregateSum, 3, ""), }, - GroupByKeys: []*engine.GroupByParams{{KeyCol: 0, WeightStringCol: -1, Type: evalengine.UnknownType()}}, + GroupByKeys: []*engine.GroupByParams{{KeyCol: 0, WeightStringCol: -1}}, Input: newMergeSorter(nil, []compareColInfo{{0, collations.Unknown, true}}), }, targetPrimitive: newMergeSorter(nil, []compareColInfo{{0, collations.Unknown, true}}), diff --git a/proto/vschema.proto b/proto/vschema.proto index c6665688c23..45c1b7a3aa9 100644 --- a/proto/vschema.proto +++ b/proto/vschema.proto @@ -128,6 +128,12 @@ message Column { query.Type type = 2; bool invisible = 3; string default = 4; + string collation_name = 5; + int32 size = 6; + int32 scale = 7; + optional bool nullable = 8; + // values contains the list of values for an enum or set column. + repeated string values = 9; } // SrvVSchema is the roll-up of all the Keyspace schema for a cell. diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index bda230c6570..d50ca0004ee 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -41595,6 +41595,21 @@ export namespace vschema { /** Column default */ "default"?: (string|null); + + /** Column collation_name */ + collation_name?: (string|null); + + /** Column size */ + size?: (number|null); + + /** Column scale */ + scale?: (number|null); + + /** Column nullable */ + nullable?: (boolean|null); + + /** Column values */ + values?: (string[]|null); } /** Represents a Column. */ @@ -41618,6 +41633,24 @@ export namespace vschema { /** Column default. */ public default: string; + /** Column collation_name. */ + public collation_name: string; + + /** Column size. */ + public size: number; + + /** Column scale. */ + public scale: number; + + /** Column nullable. */ + public nullable?: (boolean|null); + + /** Column values. */ + public values: string[]; + + /** Column _nullable. */ + public _nullable?: "nullable"; + /** * Creates a new Column instance using the specified properties. * @param [properties] Properties to set diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index dc1679ee3c0..7730d101e29 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -101274,6 +101274,11 @@ export const vschema = $root.vschema = (() => { * @property {query.Type|null} [type] Column type * @property {boolean|null} [invisible] Column invisible * @property {string|null} ["default"] Column default + * @property {string|null} [collation_name] Column collation_name + * @property {number|null} [size] Column size + * @property {number|null} [scale] Column scale + * @property {boolean|null} [nullable] Column nullable + * @property {Array.|null} [values] Column values */ /** @@ -101285,6 +101290,7 @@ export const vschema = $root.vschema = (() => { * @param {vschema.IColumn=} [properties] Properties to set */ function Column(properties) { + this.values = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -101323,6 +101329,60 @@ export const vschema = $root.vschema = (() => { */ Column.prototype["default"] = ""; + /** + * Column collation_name. + * @member {string} collation_name + * @memberof vschema.Column + * @instance + */ + Column.prototype.collation_name = ""; + + /** + * Column size. + * @member {number} size + * @memberof vschema.Column + * @instance + */ + Column.prototype.size = 0; + + /** + * Column scale. + * @member {number} scale + * @memberof vschema.Column + * @instance + */ + Column.prototype.scale = 0; + + /** + * Column nullable. + * @member {boolean|null|undefined} nullable + * @memberof vschema.Column + * @instance + */ + Column.prototype.nullable = null; + + /** + * Column values. + * @member {Array.} values + * @memberof vschema.Column + * @instance + */ + Column.prototype.values = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Column _nullable. + * @member {"nullable"|undefined} _nullable + * @memberof vschema.Column + * @instance + */ + Object.defineProperty(Column.prototype, "_nullable", { + get: $util.oneOfGetter($oneOfFields = ["nullable"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new Column instance using the specified properties. * @function create @@ -101355,6 +101415,17 @@ export const vschema = $root.vschema = (() => { writer.uint32(/* id 3, wireType 0 =*/24).bool(message.invisible); if (message["default"] != null && Object.hasOwnProperty.call(message, "default")) writer.uint32(/* id 4, wireType 2 =*/34).string(message["default"]); + if (message.collation_name != null && Object.hasOwnProperty.call(message, "collation_name")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.collation_name); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.size); + if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.scale); + if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.nullable); + if (message.values != null && message.values.length) + for (let i = 0; i < message.values.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.values[i]); return writer; }; @@ -101405,6 +101476,28 @@ export const vschema = $root.vschema = (() => { message["default"] = reader.string(); break; } + case 5: { + message.collation_name = reader.string(); + break; + } + case 6: { + message.size = reader.int32(); + break; + } + case 7: { + message.scale = reader.int32(); + break; + } + case 8: { + message.nullable = reader.bool(); + break; + } + case 9: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -101440,6 +101533,7 @@ export const vschema = $root.vschema = (() => { Column.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + let properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; @@ -101490,6 +101584,27 @@ export const vschema = $root.vschema = (() => { if (message["default"] != null && message.hasOwnProperty("default")) if (!$util.isString(message["default"])) return "default: string expected"; + if (message.collation_name != null && message.hasOwnProperty("collation_name")) + if (!$util.isString(message.collation_name)) + return "collation_name: string expected"; + if (message.size != null && message.hasOwnProperty("size")) + if (!$util.isInteger(message.size)) + return "size: integer expected"; + if (message.scale != null && message.hasOwnProperty("scale")) + if (!$util.isInteger(message.scale)) + return "scale: integer expected"; + if (message.nullable != null && message.hasOwnProperty("nullable")) { + properties._nullable = 1; + if (typeof message.nullable !== "boolean") + return "nullable: boolean expected"; + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (let i = 0; i < message.values.length; ++i) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } return null; }; @@ -101659,6 +101774,21 @@ export const vschema = $root.vschema = (() => { message.invisible = Boolean(object.invisible); if (object["default"] != null) message["default"] = String(object["default"]); + if (object.collation_name != null) + message.collation_name = String(object.collation_name); + if (object.size != null) + message.size = object.size | 0; + if (object.scale != null) + message.scale = object.scale | 0; + if (object.nullable != null) + message.nullable = Boolean(object.nullable); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".vschema.Column.values: array expected"); + message.values = []; + for (let i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } return message; }; @@ -101675,11 +101805,16 @@ export const vschema = $root.vschema = (() => { if (!options) options = {}; let object = {}; + if (options.arrays || options.defaults) + object.values = []; if (options.defaults) { object.name = ""; object.type = options.enums === String ? "NULL_TYPE" : 0; object.invisible = false; object["default"] = ""; + object.collation_name = ""; + object.size = 0; + object.scale = 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -101689,6 +101824,22 @@ export const vschema = $root.vschema = (() => { object.invisible = message.invisible; if (message["default"] != null && message.hasOwnProperty("default")) object["default"] = message["default"]; + if (message.collation_name != null && message.hasOwnProperty("collation_name")) + object.collation_name = message.collation_name; + if (message.size != null && message.hasOwnProperty("size")) + object.size = message.size; + if (message.scale != null && message.hasOwnProperty("scale")) + object.scale = message.scale; + if (message.nullable != null && message.hasOwnProperty("nullable")) { + object.nullable = message.nullable; + if (options.oneofs) + object._nullable = "nullable"; + } + if (message.values && message.values.length) { + object.values = []; + for (let j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } return object; };