Validating password length
This commit is contained in:
parent
ed0fc1c7b9
commit
e2171e0162
@ -200,7 +200,7 @@ func (this *Applier) CreateChangelogTable() error {
|
|||||||
id bigint auto_increment,
|
id bigint auto_increment,
|
||||||
last_update timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
last_update timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
hint varchar(64) charset ascii not null,
|
hint varchar(64) charset ascii not null,
|
||||||
value varchar(255) charset ascii not null,
|
value varchar(4096) charset ascii not null,
|
||||||
primary key(id),
|
primary key(id),
|
||||||
unique key hint_uidx(hint)
|
unique key hint_uidx(hint)
|
||||||
) auto_increment=256
|
) auto_increment=256
|
||||||
|
@ -169,6 +169,9 @@ func (this *Inspector) inspectOriginalAndGhostTables() (err error) {
|
|||||||
|
|
||||||
// validateConnection issues a simple can-connect to MySQL
|
// validateConnection issues a simple can-connect to MySQL
|
||||||
func (this *Inspector) validateConnection() error {
|
func (this *Inspector) validateConnection() error {
|
||||||
|
if len(this.connectionConfig.Password) > mysql.MaxReplicationPasswordLength {
|
||||||
|
return fmt.Errorf("MySQL replication length limited to 32 characters. See https://dev.mysql.com/doc/refman/5.7/en/assigning-passwords.html")
|
||||||
|
}
|
||||||
query := `select @@global.port, @@global.version`
|
query := `select @@global.port, @@global.version`
|
||||||
var port int
|
var port int
|
||||||
if err := this.db.QueryRow(query).Scan(&port, &this.migrationContext.InspectorMySQLVersion); err != nil {
|
if err := this.db.QueryRow(query).Scan(&port, &this.migrationContext.InspectorMySQLVersion); err != nil {
|
||||||
|
@ -17,6 +17,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const MaxTableNameLength = 64
|
const MaxTableNameLength = 64
|
||||||
|
const MaxReplicationPasswordLength = 32
|
||||||
|
|
||||||
type ReplicationLagResult struct {
|
type ReplicationLagResult struct {
|
||||||
Key InstanceKey
|
Key InstanceKey
|
||||||
|
Loading…
Reference in New Issue
Block a user