@@ -401,7 +401,6 @@ func setSystemVar(ctx *sql.Context, sysVar *expression.SystemVar, right sql.Expr
401401
402402 // Setting `character_set_connection` and `collation_connection` will set the corresponding variable
403403 // Setting `character_set_server` and `collation_server` will set the corresponding variable
404- // Handle MariaDB binlog numeric conversions for sql_mode and collation IDs
405404 switch strings .ToLower (sysVar .Name ) {
406405 case "sql_mode" :
407406 val , err = sql .ConvertSqlModeBitmask (val )
@@ -425,7 +424,6 @@ func setSystemVar(ctx *sql.Context, sysVar *expression.SystemVar, right sql.Expr
425424 collationName := charset .DefaultCollation ().Name ()
426425 return sysVar .Scope .SetValue (ctx , "collation_connection" , collationName )
427426 case "collation_connection" :
428- // Convert numeric collation ID to name (from MariaDB binlogs)
429427 val , err = sql .ConvertCollationID (val )
430428 if err != nil {
431429 return err
@@ -464,7 +462,6 @@ func setSystemVar(ctx *sql.Context, sysVar *expression.SystemVar, right sql.Expr
464462 collationName := charset .DefaultCollation ().Name ()
465463 return sysVar .Scope .SetValue (ctx , "collation_server" , collationName )
466464 case "collation_server" :
467- // Convert numeric collation ID to name (from MariaDB binlogs)
468465 val , err = sql .ConvertCollationID (val )
469466 if err != nil {
470467 return err
@@ -488,7 +485,6 @@ func setSystemVar(ctx *sql.Context, sysVar *expression.SystemVar, right sql.Expr
488485 charsetName := collation .CharacterSet ().Name ()
489486 return sysVar .Scope .SetValue (ctx , "character_set_server" , charsetName )
490487 case "collation_database" :
491- // Convert numeric collation ID to name (from MariaDB binlogs)
492488 val , err = sql .ConvertCollationID (val )
493489 if err != nil {
494490 return err
@@ -501,9 +497,8 @@ func setSystemVar(ctx *sql.Context, sysVar *expression.SystemVar, right sql.Expr
501497 val = fmt .Sprintf ("%v" , val )
502498 }
503499 return sysVar .Scope .SetValue (ctx , sysVar .Name , val )
504- default :
505- return sysVar .Scope .SetValue (ctx , sysVar .Name , val )
506500 }
501+ return nil
507502}
508503
509504func validateSystemVariableValue (sysVarName string , val interface {}) error {
0 commit comments