Compare commits
1 Commits
master
...
safe-socke
Author | SHA1 | Date | |
---|---|---|---|
|
912b002311 |
@ -48,8 +48,9 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
HTTPStatusOK = 200
|
||||
MaxEventsBatchSize = 1000
|
||||
HTTPStatusOK = 200
|
||||
MaxEventsBatchSize = 1000
|
||||
MaxSocketFileNameLength = 104
|
||||
)
|
||||
|
||||
var (
|
||||
@ -242,6 +243,10 @@ func NewMigrationContext() *MigrationContext {
|
||||
}
|
||||
}
|
||||
|
||||
func (this *MigrationContext) GetServeSocketFile() string {
|
||||
return this.ServeSocketFile
|
||||
}
|
||||
|
||||
func getSafeTableName(baseName string, suffix string) string {
|
||||
name := fmt.Sprintf("_%s_%s", baseName, suffix)
|
||||
if len(name) <= mysql.MaxTableNameLength {
|
||||
|
@ -56,3 +56,12 @@ func TestGetTableNames(t *testing.T) {
|
||||
test.S(t).ExpectEquals(context.GetChangelogTableName(), "_tmp_ghc")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetServeSocketFile(t *testing.T) {
|
||||
{
|
||||
context := NewMigrationContext()
|
||||
socketFile := "/tmp/gh-ost.sock"
|
||||
context.ServeSocketFile = socketFile
|
||||
test.S(t).ExpectEquals(context.GetServeSocketFile(), "/tmp/gh-ost.sock")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user