From: Mathias Gibbens <gibmat@debian.org>
Description: Fix test failure on 32bit architectures
Forwarded: https://github.com/ovn-org/libovsdb/issues/374
diff --git a/ovsdb/schema.go b/ovsdb/schema.go
index cf80aa5..4ce1c4a 100644
--- a/ovsdb/schema.go
+++ b/ovsdb/schema.go
@@ -173,7 +173,7 @@ type BaseType struct {
 	minReal    *float64
 	maxReal    *float64
 	minInteger *int
-	maxInteger *int
+	maxInteger *int64
 	minLength  *int
 	maxLength  *int
 	refTable   *string
@@ -224,14 +224,14 @@ func (b *BaseType) MinInteger() (int, error) {
 
 // MaxInteger returns the minimum integer value
 // RFC7047 specifies the minimum to be 2^63-1
-func (b *BaseType) MaxInteger() (int, error) {
+func (b *BaseType) MaxInteger() (int64, error) {
 	if b.Type != TypeInteger {
 		return 0, fmt.Errorf("%s is not an integer", b.Type)
 	}
 	if b.maxInteger != nil {
 		return *b.maxInteger, nil
 	}
-	return int(math.Pow(2, 63)) - 1, nil
+	return int64(math.Pow(2, 63)) - 1, nil
 }
 
 // MinLength returns the minimum string length
@@ -302,7 +302,7 @@ func (b *BaseType) UnmarshalJSON(data []byte) error {
 		MinReal    *float64    `json:"minReal,omitempty"`
 		MaxReal    *float64    `json:"maxReal,omitempty"`
 		MinInteger *int        `json:"minInteger,omitempty"`
-		MaxInteger *int        `json:"maxInteger,omitempty"`
+		MaxInteger *int64      `json:"maxInteger,omitempty"`
 		MinLength  *int        `json:"minLength,omitempty"`
 		MaxLength  *int        `json:"maxLength,omitempty"`
 		RefTable   *string     `json:"refTable,omitempty"`
@@ -346,7 +346,7 @@ func (b BaseType) MarshalJSON() ([]byte, error) {
 		MinReal    *float64 `json:"minReal,omitempty"`
 		MaxReal    *float64 `json:"maxReal,omitempty"`
 		MinInteger *int     `json:"minInteger,omitempty"`
-		MaxInteger *int     `json:"maxInteger,omitempty"`
+		MaxInteger *int64   `json:"maxInteger,omitempty"`
 		MinLength  *int     `json:"minLength,omitempty"`
 		MaxLength  *int     `json:"maxLength,omitempty"`
 		RefTable   *string  `json:"refTable,omitempty"`
diff --git a/ovsdb/schema_test.go b/ovsdb/schema_test.go
index fae2549..f2d1228 100644
--- a/ovsdb/schema_test.go
+++ b/ovsdb/schema_test.go
@@ -409,7 +409,7 @@ func TestTable(t *testing.T) {
 func TestBaseTypeMarshalUnmarshalJSON(t *testing.T) {
 	datapath := "Datapath"
 	zero := 0
-	max := 4294967295
+	max := int64(4294967295)
 	strong := "strong"
 	tests := []struct {
 		name         string
@@ -677,7 +677,7 @@ func TestColumnSchemaMarshalUnmarshalJSON(t *testing.T) {
 func TestBaseTypeSimpleAtomic(t *testing.T) {
 	b := BaseType{Type: TypeString}
 	assert.True(t, b.simpleAtomic())
-	max := 1024
+	max := int64(1024)
 	b1 := BaseType{Type: TypeInteger, maxInteger: &max}
 	assert.False(t, b1.simpleAtomic())
 }
@@ -803,11 +803,11 @@ func TestBaseTypeMinInteger(t *testing.T) {
 }
 
 func TestBaseTypeMaxInteger(t *testing.T) {
-	value := 1024
+	value := int64(1024)
 	tests := []struct {
 		name    string
 		bt      *BaseType
-		want    int
+		want    int64
 		wantErr bool
 	}{
 		{
@@ -819,7 +819,7 @@ func TestBaseTypeMaxInteger(t *testing.T) {
 		{
 			"nil",
 			&BaseType{Type: TypeInteger},
-			int(math.Pow(2, 63)) - 1,
+			int64(math.Pow(2, 63)) - 1,
 			false,
 		},
 		{
