Skip to content

Commit 3fc3446

Browse files
author
Shlomi Noach
authored
Merge pull request #489 from github/checking-thresholds
Validating password length
2 parents 1ada323 + bdae67f commit 3fc3446

File tree

6 files changed

+14
-1
lines changed

6 files changed

+14
-1
lines changed

go/logic/applier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func (this *Applier) CreateChangelogTable() error {
200200
id bigint auto_increment,
201201
last_update timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
202202
hint varchar(64) charset ascii not null,
203-
value varchar(255) charset ascii not null,
203+
value varchar(4096) charset ascii not null,
204204
primary key(id),
205205
unique key hint_uidx(hint)
206206
) auto_increment=256

go/logic/inspect.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ func (this *Inspector) inspectOriginalAndGhostTables() (err error) {
192192

193193
// validateConnection issues a simple can-connect to MySQL
194194
func (this *Inspector) validateConnection() error {
195+
if len(this.connectionConfig.Password) > mysql.MaxReplicationPasswordLength {
196+
return fmt.Errorf("MySQL replication length limited to 32 characters. See https://dev.mysql.com/doc/refman/5.7/en/assigning-passwords.html")
197+
}
195198
query := `select @@global.port, @@global.version`
196199
var port int
197200
if err := this.db.QueryRow(query).Scan(&port, &this.migrationContext.InspectorMySQLVersion); err != nil {

go/mysql/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
)
1818

1919
const MaxTableNameLength = 64
20+
const MaxReplicationPasswordLength = 32
2021

2122
type ReplicationLagResult struct {
2223
Key InstanceKey
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
drop table if exists gh_ost_test;
2+
create table gh_ost_test (
3+
id int auto_increment,
4+
i int not null,
5+
ts timestamp,
6+
primary key(id)
7+
) auto_increment=1;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MySQL replication length limited to 32 characters
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--password="0123456789abcdefghij0123456789abcdefghijxx"

0 commit comments

Comments
 (0)