relaxed config scanner mode
- does not fail on MySQL 'prompt' config
This commit is contained in:
parent
88eb2d6ee1
commit
00369d7e5d
@ -18,6 +18,7 @@ import (
|
||||
"github.com/github/gh-ost/go/sql"
|
||||
|
||||
"gopkg.in/gcfg.v1"
|
||||
gcfgscanner "gopkg.in/gcfg.v1/scanner"
|
||||
)
|
||||
|
||||
// RowsEstimateMethod is the type of row number estimation
|
||||
@ -507,6 +508,7 @@ func (this *MigrationContext) ReadConfigFile() error {
|
||||
return nil
|
||||
}
|
||||
gcfg.RelaxedParserMode = true
|
||||
gcfgscanner.RelaxedScannerMode = true
|
||||
if err := gcfg.ReadFileInto(&this.config, this.ConfigFile); err != nil {
|
||||
return err
|
||||
}
|
||||
|
6
vendor/gopkg.in/gcfg.v1/scanner/scanner.go
generated
vendored
6
vendor/gopkg.in/gcfg.v1/scanner/scanner.go
generated
vendored
@ -16,12 +16,12 @@ import (
|
||||
"path/filepath"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
import (
|
||||
"gopkg.in/gcfg.v1/token"
|
||||
)
|
||||
|
||||
var RelaxedScannerMode = false
|
||||
|
||||
// An ErrorHandler may be provided to Scanner.Init. If a syntax error is
|
||||
// encountered and a handler was installed, the handler is called with a
|
||||
// position and an error message. The position points to the beginning of
|
||||
@ -231,7 +231,7 @@ loop:
|
||||
hasCR = true
|
||||
s.next()
|
||||
}
|
||||
if s.ch != '\n' {
|
||||
if s.ch != '\n' && !RelaxedScannerMode {
|
||||
s.error(offs, "unquoted '\\' must be followed by new line")
|
||||
break loop
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user