You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering this error when attempting to insert or update a latin1 column with a text parameter that is utf8 encoded and which contains unsupported characters.
Error 3988: Conversion from collation utf8mb4_general_ci into latin1_swedish_ci impossible for parameter
If I run the same query from the mysql command line, or using the PHP PDO client, there is no error and the unsupported characters are replaced with ?s. I'd prefer to get that behaviour instead of the error.
This is specific to MySQL 8.
Example code
db, err:=sql.Open(dbDriver, dbUser+":"+dbPass+"@tcp("+dbHost+")/"+dbName+"?parseTime=true")
_, err=db.Exec("UPDATE notes SET text=? WHERE id=72", "cżcż")
iferr!=nil {
log.Fatal(err)
}