{"record":{"id":"d9f51844aa58990c","repo":"vitessio/vitess","slug":"unsupported-data-type-s","errorCode":null,"errorMessage":"unsupported data type: %s","messagePattern":"unsupported data type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtctl/workflow/utils.go","lineNumber":924,"sourceCode":"\t// If we were racing with another caller to create the initial routing rules, then\n\t// we can immediately retry the operation.\n\tif !topo.IsErrType(err, topo.NodeExists) {\n\t\treturn err\n\t}\n\treturn update()\n}\n\nfunc validateTenantId(dataType querypb.Type, value string) error {\n\tswitch dataType {\n\tcase querypb.Type_INT64:\n\t\t_, err := strconv.Atoi(value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"value %s is not a valid int\", value)\n\t\t}\n\tcase querypb.Type_VARCHAR:\n\t// no validation needed\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported data type: %s\", dataType)\n\t}\n\treturn nil\n}\n\nfunc updateKeyspaceRoutingState(ctx context.Context, ts *topo.Server, sourceKeyspace, targetKeyspace string, state *State) error {\n\t// For multi-tenant migrations, we only support switching traffic to all cells at once.\n\tcells, err := ts.GetCellInfoNames(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\trules, err := topotools.GetKeyspaceRoutingRules(ctx, ts)\n\tif err != nil {\n\t\treturn err\n\t}\n\thasSwitched := func(tabletTypePrefix string) bool {\n\t\tks, ok := rules[sourceKeyspace+tabletTypePrefix]\n\t\treturn ok && ks == targetKeyspace","sourceCodeStart":906,"sourceCodeEnd":942,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtctl/workflow/utils.go#L906-L942","documentation":"validateTenantId accepts only INT64 (integer validation) and VARCHAR (no validation) tenant column data types. Any other querypb.Type reaches the default branch and produces this error, because the code has no validation strategy for it.","triggerScenarios":"MoveTables Create with a tenant filter where the tenant column's resolved querypb.Type is neither INT64 nor VARCHAR (e.g. INT32, UINT64, DECIMAL, TEXT/ENUM).","commonSituations":"Schema uses INT or INT UNSIGNED for the tenant column (maps to Type_INT32/UINT32); tenant column is ENUM or DECIMAL; mismatch between assumed and actual column type in the source table.","solutions":["Alter the tenant column to BIGINT (INT64) or VARCHAR before creating the tenant-filtered MoveTables workflow.","Run SHOW CREATE TABLE and confirm the tenant column type maps to INT64 or VARCHAR in Vitess.","Drop the tenant filter if the column type cannot be changed and filter manually after migration.","Patch validateTenantId/getTenantClause to support the type if you own a Vitess fork."],"exampleFix":"// before\nCREATE TABLE t (tenant_id INT UNSIGNED, ...); // Type_UINT32 unsupported\n// after\nALTER TABLE t MODIFY tenant_id BIGINT; // Type_INT64 supported","handlingStrategy":"validation","validationCode":"switch dataType {\ncase querypb.Type_INT64, querypb.Type_VARCHAR:\n\t// supported\ndefault:\n\treturn fmt.Errorf(\"tenant data type %s unsupported; schema must use BIGINT or VARCHAR\", dataType)\n}","typeGuard":"func tenantDataTypeOK(t querypb.Type) bool { return t == querypb.Type_INT64 || t == querypb.Type_VARCHAR }","tryCatchPattern":"if err := validateTenantId(dataType, value); err != nil {\n\tif strings.Contains(err.Error(), \"unsupported data type\") {\n\t\treturn fmt.Errorf(\"alter tenant column to BIGINT or VARCHAR first: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Verify the tenant column resolves to INT64 or VARCHAR before enabling tenant filtering","Avoid INT UNSIGNED/INT/ENUM tenant columns in schemas destined for tenant-aware MoveTables","Add schema prechecks in migration tooling that fail before workflow creation"],"tags":["validation","tenant","schema","movetables"],"backgroundTag":"unsupported-column-type","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}