forked from go-mysql-org/go-mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replication,cmd: improve flavor handling (go-mysql-org#946)
For `go-mysqlbinlog` and `go-canal`: return an error for invalid flavors. For `go-mysqlbinlog`: log a non-critical error if the server version has "MariaDB" in it but the flavor isn't set to "mariadb". Co-authored-by: lance6716 <[email protected]>
- Loading branch information
Showing
5 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package mysql | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
func ValidateFlavor(flavor string) error { | ||
switch strings.ToLower(flavor) { | ||
case MySQLFlavor: | ||
return nil | ||
case MariaDBFlavor: | ||
return nil | ||
default: | ||
return fmt.Errorf("%s is not a valid flavor", flavor) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters