{"record":{"id":"2594004896d2640b","repo":"go-sql-driver/mysql","slug":"invalid-bool-value-s","errorCode":null,"errorMessage":"invalid bool value: %s","messagePattern":"invalid bool value: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dsn.go","lineNumber":498,"sourceCode":"}\n\n// parseDSNParams parses the DSN \"query string\"\n// Values must be url.QueryEscape'ed\nfunc parseDSNParams(cfg *Config, params string) (err error) {\n\tfor v := range strings.SplitSeq(params, \"&\") {\n\t\tkey, value, found := strings.Cut(v, \"=\")\n\t\tif !found {\n\t\t\tcontinue\n\t\t}\n\n\t\t// cfg params\n\t\tswitch key {\n\t\t// Disable INFILE allowlist / enable all files\n\t\tcase \"allowAllFiles\":\n\t\t\tvar isBool bool\n\t\t\tcfg.AllowAllFiles, isBool = readBool(value)\n\t\t\tif !isBool {\n\t\t\t\treturn errors.New(\"invalid bool value: \" + value)\n\t\t\t}\n\n\t\t// Use cleartext authentication mode (MySQL 5.5.10+)\n\t\tcase \"allowCleartextPasswords\":\n\t\t\tvar isBool bool\n\t\t\tcfg.AllowCleartextPasswords, isBool = readBool(value)\n\t\t\tif !isBool {\n\t\t\t\treturn errors.New(\"invalid bool value: \" + value)\n\t\t\t}\n\n\t\t// Allow fallback to unencrypted connection if server does not support TLS\n\t\tcase \"allowFallbackToPlaintext\":\n\t\t\tvar isBool bool\n\t\t\tcfg.AllowFallbackToPlaintext, isBool = readBool(value)\n\t\t\tif !isBool {\n\t\t\t\treturn errors.New(\"invalid bool value: \" + value)\n\t\t\t}\n","sourceCodeStart":480,"sourceCodeEnd":516,"githubUrl":"https://github.com/go-sql-driver/mysql/blob/03d76c7e07908e255ce62d126d07ede3f2365d86/dsn.go#L480-L516","documentation":"Error \"invalid bool value: %s\" thrown in go-sql-driver/mysql.","triggerScenarios":"A boolean DSN parameter (e.g. allowAllFiles, allowCleartextPasswords, parseTime, multiStatements) is given a value that readBool cannot parse as true or false.","commonSituations":"Values like 'yes', 'on', or '2' are not accepted; only 'true'/'false' (and '1'/'0') are valid. Fix the parameter value in the DSN, e.g. 'parseTime=true'.","solutions":["Use a valid boolean literal for the DSN parameter: 'true' or 'false' (case-sensitive as parsed by the driver).","Quote or escape the value if it contains characters that break DSN parsing."],"exampleFix":"dsn := \"user:pass@tcp(127.0.0.1:3306)/mydb?allowCleartextPasswords=true\"","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"03d76c7e07908e255ce62d126d07ede3f2365d86","analyzedAt":"2026-08-07T10:39:17.340Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}