Skip to content

Commit ed5dd7f

Browse files
author
Shlomi Noach
committed
Collecting and presenting MySQL versions of applier and inspector
1 parent 8914bc2 commit ed5dd7f

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

go/base/context.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ type MigrationContext struct {
135135
OriginalBinlogFormat string
136136
OriginalBinlogRowImage string
137137
InspectorConnectionConfig *mysql.ConnectionConfig
138+
InspectorMySQLVersion string
138139
ApplierConnectionConfig *mysql.ConnectionConfig
140+
ApplierMySQLVersion string
139141
StartTime time.Time
140142
RowCopyStartTime time.Time
141143
RowCopyEndTime time.Time

go/logic/applier.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,15 @@ func (this *Applier) InitDBConnections() (err error) {
7070
if err := this.readTableColumns(); err != nil {
7171
return err
7272
}
73+
log.Infof("Applier initiated on %+v, version %+v", this.connectionConfig.ImpliedKey, this.migrationContext.ApplierMySQLVersion)
7374
return nil
7475
}
7576

7677
// validateConnection issues a simple can-connect to MySQL
7778
func (this *Applier) validateConnection(db *gosql.DB) error {
78-
query := `select @@global.port`
79+
query := `select @@global.port, @@global.version`
7980
var port int
80-
if err := db.QueryRow(query).Scan(&port); err != nil {
81+
if err := db.QueryRow(query).Scan(&port, &this.migrationContext.ApplierMySQLVersion); err != nil {
8182
return err
8283
}
8384
if port != this.connectionConfig.Key.Port {

go/logic/inspect.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func (this *Inspector) InitDBConnections() (err error) {
6060
if err := this.applyBinlogFormat(); err != nil {
6161
return err
6262
}
63+
log.Infof("Inspector initiated on %+v, version %+v", this.connectionConfig.ImpliedKey, this.migrationContext.InspectorMySQLVersion)
6364
return nil
6465
}
6566

@@ -168,9 +169,9 @@ func (this *Inspector) inspectOriginalAndGhostTables() (err error) {
168169

169170
// validateConnection issues a simple can-connect to MySQL
170171
func (this *Inspector) validateConnection() error {
171-
query := `select @@global.port`
172+
query := `select @@global.port, @@global.version`
172173
var port int
173-
if err := this.db.QueryRow(query).Scan(&port); err != nil {
174+
if err := this.db.QueryRow(query).Scan(&port, &this.migrationContext.InspectorMySQLVersion); err != nil {
174175
return err
175176
}
176177
if port != this.connectionConfig.Key.Port {

0 commit comments

Comments
 (0)