Blob Blame History Raw
From 33ef09b56f4a7f4f0f86c477ec855066fffa6a86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
Date: Mon, 1 Jul 2019 21:37:52 +0200
Subject: [PATCH] Fix int overflow due to use math.MaxInt64
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
---
 go/vt/throttler/throttler.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/go/vt/throttler/throttler.go b/go/vt/throttler/throttler.go
index 4db59307e..7de631e4b 100644
--- a/go/vt/throttler/throttler.go
+++ b/go/vt/throttler/throttler.go
@@ -50,7 +50,7 @@ const (
 
 	// MaxRateModuleDisabled can be set in NewThrottler() to disable throttling
 	// by a fixed rate.
-	MaxRateModuleDisabled = math.MaxInt64
+	MaxRateModuleDisabled = int64(math.MaxInt64)
 
 	// InvalidMaxRate is a constant which will fail in a NewThrottler() call.
 	// It should be used when returning maxRate in an error case.
@@ -58,7 +58,7 @@ const (
 
 	// ReplicationLagModuleDisabled can be set in NewThrottler() to disable
 	// throttling based on the MySQL replication lag.
-	ReplicationLagModuleDisabled = math.MaxInt64
+	ReplicationLagModuleDisabled = int64(math.MaxInt64)
 
 	// InvalidMaxReplicationLag is a constant which will fail in a NewThrottler()
 	// call. It should be used when returning maxReplicationlag in an error case.
-- 
2.21.0