From fe318293e765dbf6c407991301531c1ec2e0c0f9 Mon Sep 17 00:00:00 2001 From: Armaan Tobaccowalla Date: Wed, 26 Feb 2020 15:43:14 -0500 Subject: [PATCH] Error check --- mysql/resource_user_password.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql/resource_user_password.go b/mysql/resource_user_password.go index 0efad56d..2ae82e65 100644 --- a/mysql/resource_user_password.go +++ b/mysql/resource_user_password.go @@ -70,6 +70,9 @@ func SetUserPassword(d *schema.ResourceData, meta interface{}) error { /* ALTER USER syntax introduced in MySQL 5.7.6 deprecates SET PASSWORD (GH-8230) */ serverVersion, err := serverVersion(db) + if err != nil { + return fmt.Errorf("Could not determine server version: %s", err) + } ver, _ := version.NewVersion("5.7.6") var stmtSQL string if serverVersion.LessThan(ver) {