Validating table name length
This commit is contained in:
parent
b848b78fcb
commit
06c909bd10
@ -142,6 +142,10 @@ func (this *Applier) ValidateOrDropExistingTables() error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if len(this.migrationContext.GetOldTableName()) > mysql.MaxTableNameLength {
|
||||
log.Fatalf("--timestamp-old-table defined, but resulting table name (%s) is too long (only %d characters allowed)", this.migrationContext.GetOldTableName(), mysql.MaxTableNameLength)
|
||||
}
|
||||
|
||||
if this.tableExists(this.migrationContext.GetOldTableName()) {
|
||||
return fmt.Errorf("Table %s already exists. Panicking. Use --initially-drop-old-table to force dropping it, though I really prefer that you drop it or rename it away", sql.EscapeName(this.migrationContext.GetOldTableName()))
|
||||
}
|
||||
|
@ -16,6 +16,8 @@ import (
|
||||
"github.com/outbrain/golib/sqlutils"
|
||||
)
|
||||
|
||||
const MaxTableNameLength = 64
|
||||
|
||||
type ReplicationLagResult struct {
|
||||
Key InstanceKey
|
||||
Lag time.Duration
|
||||
|
Loading…
Reference in New Issue
Block a user