diff --git a/go/logic/applier.go b/go/logic/applier.go index 3b934fe..9ecc34c 100644 --- a/go/logic/applier.go +++ b/go/logic/applier.go @@ -200,7 +200,7 @@ func (this *Applier) CreateChangelogTable() error { id bigint auto_increment, last_update timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, hint varchar(64) charset ascii not null, - value varchar(255) charset ascii not null, + value varchar(4096) charset ascii not null, primary key(id), unique key hint_uidx(hint) ) auto_increment=256 diff --git a/go/logic/inspect.go b/go/logic/inspect.go index e3130e4..b70f900 100644 --- a/go/logic/inspect.go +++ b/go/logic/inspect.go @@ -192,6 +192,9 @@ func (this *Inspector) inspectOriginalAndGhostTables() (err error) { // validateConnection issues a simple can-connect to MySQL 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` var port int if err := this.db.QueryRow(query).Scan(&port, &this.migrationContext.InspectorMySQLVersion); err != nil { diff --git a/go/mysql/utils.go b/go/mysql/utils.go index 4df7639..b670921 100644 --- a/go/mysql/utils.go +++ b/go/mysql/utils.go @@ -17,6 +17,7 @@ import ( ) const MaxTableNameLength = 64 +const MaxReplicationPasswordLength = 32 type ReplicationLagResult struct { Key InstanceKey diff --git a/localtests/fail-password-length/create.sql b/localtests/fail-password-length/create.sql new file mode 100644 index 0000000..08f8500 --- /dev/null +++ b/localtests/fail-password-length/create.sql @@ -0,0 +1,7 @@ +drop table if exists gh_ost_test; +create table gh_ost_test ( + id int auto_increment, + i int not null, + ts timestamp, + primary key(id) +) auto_increment=1; diff --git a/localtests/fail-password-length/expect_failure b/localtests/fail-password-length/expect_failure new file mode 100644 index 0000000..d55364f --- /dev/null +++ b/localtests/fail-password-length/expect_failure @@ -0,0 +1 @@ +MySQL replication length limited to 32 characters diff --git a/localtests/fail-password-length/extra_args b/localtests/fail-password-length/extra_args new file mode 100644 index 0000000..69da316 --- /dev/null +++ b/localtests/fail-password-length/extra_args @@ -0,0 +1 @@ +--password="0123456789abcdefghij0123456789abcdefghijxx"