{"record":{"id":"4209b65adc9e8783","repo":"vitessio/vitess","slug":"unknown-online-ddl-strategy-v","errorCode":null,"errorMessage":"Unknown online DDL strategy: '%v'","messagePattern":"Unknown online DDL strategy: '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/schema/ddl_strategy.go","lineNumber":129,"sourceCode":"\t}\n}\n\n// ParseDDLStrategy parses and validates the value of @@ddl_strategy or -ddl_strategy variables\nfunc ParseDDLStrategy(strategyVariable string) (*DDLStrategySetting, error) {\n\tsetting := &DDLStrategySetting{}\n\tstrategyName := strategyVariable\n\tif submatch := strategyParserRegexp.FindStringSubmatch(strategyVariable); len(submatch) > 0 {\n\t\tstrategyName = submatch[1]\n\t\tsetting.Options = submatch[2]\n\t}\n\n\tswitch strategy := DDLStrategy(strategyName); strategy {\n\tcase \"\": // backward compatiblity and to handle unspecified values\n\t\tsetting.Strategy = DDLStrategyDirect\n\tcase DDLStrategyVitess, DDLStrategyOnline, DDLStrategyMySQL, DDLStrategyDirect:\n\t\tsetting.Strategy = strategy\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Unknown online DDL strategy: '%v'\", strategy)\n\t}\n\tif _, err := setting.CutOverThreshold(); err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := setting.RetainArtifactsDuration(); err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := setting.SessionVariables(); err != nil {\n\t\treturn nil, err\n\t}\n\tcutoverAfter, err := setting.ForceCutOverAfter()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch setting.Strategy {\n\tcase DDLStrategyVitess, DDLStrategyOnline:\n\tdefault:\n\t\tif cutoverAfter != 0 {","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/schema/ddl_strategy.go#L111-L147","documentation":"ParseDDLStrategy parses the value of the @@ddl_strategy session variable. If the strategy token (the part before any '@' parameters) is not one of vitess, online, mysql, direct (or empty), parsing fails with this error listing the unknown value.","triggerScenarios":"Executing SET @@ddl_strategy='gh-ost' (or any misspelled/unrecognized strategy), or calling schema.ParseDDLStrategy programmatically with a bad strategyName.","commonSituations":"Typo in the strategy name; copied a gh-ost/pt-osc style value from another system; older clients passing deprecated values after upgrade; tools setting ddl_strategy via connection state.","solutions":["Set ddl_strategy to a supported value: '', 'vitess', 'online', 'mysql', or 'direct' (e.g. SET @@ddl_strategy='vitess').","Fix the typo in the strategy name; use 'online' or 'vitess' for online schema changes.","Check Vitess docs for the current list of strategies; older strategy names (gh-ost, pt-osc) were removed.","Use vtctldclient or the app's allowed-strategy validation before issuing the SET statement."],"exampleFix":"// before\nSET @@ddl_strategy='gh-ost';\n// after\nSET @@ddl_strategy='vitess';","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"\": true, \"vitess\": true, \"online\": true, \"mysql\": true, \"direct\": true}\nif !valid[strings.ToLower(strategy)] { return fmt.Errorf(\"unknown ddl strategy %q\", strategy) }","typeGuard":"func isKnownStrategy(s string) bool {\n  switch schema.DDLStrategy(s) {\n  case \"\", schema.DDLStrategyVitess, schema.DDLStrategyOnline, schema.DDLStrategyMySQL, schema.DDLStrategyDirect:\n    return true\n  }\n  return false\n}","tryCatchPattern":"setting, err := schema.ParseDDLStrategy(strategyName)\nif err != nil {\n  return fmt.Errorf(\"bad ddl_strategy %q: %w\", strategyName, err)\n}","preventionTips":["Use only documented strategies: vitess, online, mysql, direct","Whitelist strategy values in application config","Migrate off gh-ost/pt-osc strategy values"],"tags":["ddl","online-schema-change","validation"],"backgroundTag":"invalid-ddl-strategy","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}