@@ -51,18 +51,15 @@ func (this *Inspector) InitDBConnections() (err error) {
51
51
if this .db , _ , err = mysql .GetDB (this .migrationContext .Uuid , inspectorUri ); err != nil {
52
52
return err
53
53
}
54
- if err := this .validateConnection (); err != nil {
55
- return err
56
- }
57
- if this .migrationContext .InspectorServerInfo , err = mysql .GetServerInfo (this .db ); err != nil {
58
- return err
59
- }
60
54
61
55
informationSchemaUri := this .connectionConfig .GetDBUri ("information_schema" )
62
56
if this .informationSchemaDb , _ , err = mysql .GetDB (this .migrationContext .Uuid , informationSchemaUri ); err != nil {
63
57
return err
64
58
}
65
59
60
+ if err := this .validateConnection (); err != nil {
61
+ return err
62
+ }
66
63
if ! this .migrationContext .AliyunRDS && ! this .migrationContext .GoogleCloudPlatform && ! this .migrationContext .AzureMySQL {
67
64
if impliedKey , err := mysql .GetInstanceKey (this .db ); err != nil {
68
65
return err
@@ -217,11 +214,15 @@ func (this *Inspector) inspectOriginalAndGhostTables() (err error) {
217
214
}
218
215
219
216
// validateConnection issues a simple can-connect to MySQL
220
- func (this * Inspector ) validateConnection () error {
217
+ func (this * Inspector ) validateConnection () ( err error ) {
221
218
if len (this .connectionConfig .Password ) > mysql .MaxReplicationPasswordLength {
222
219
return fmt .Errorf ("MySQL replication length limited to 32 characters. See https://dev.mysql.com/doc/refman/5.7/en/assigning-passwords.html" )
223
220
}
224
221
222
+ if this .migrationContext .InspectorServerInfo , err = mysql .GetServerInfo (this .db ); err != nil {
223
+ return err
224
+ }
225
+
225
226
return base .ValidateConnection (this .ServerInfo (), this .connectionConfig , this .migrationContext , this .name )
226
227
}
227
228
0 commit comments