Skip to content

migrate up fails on negative int #213

@brondum

Description

@brondum

Describe the Bug
Getting a weird error when trying to migrate initial db scheme on ARM.
i dont see this error on amd64, and as far is i know the number is "large" enough that 32bit limit is hit?

Am i missing something?

Expected Behavior
Migration as when running on x86_64 platform

Migrate Version
v4.3.1

Loaded Source Drivers
file

Loaded Database Drivers
mysql

Go Version
go version go1.12 linux/arm

Stacktrace

panic: suint(-941147960) expects input >= 0

goroutine 26 [running]:
github.com/golang-migrate/migrate/v4.suint(...)
	/go/src/gitlab.com/projectname/vendor/github.com/golang-migrate/migrate/v4/util.go:42
github.com/golang-migrate/migrate/v4.(*Migrate).readUp(0x20f1a40, 0xffffffff, 0xffffffff, 0x20f1c40)
	/go/src/gitlab.com/projectname/vendor/github.com/golang-migrate/migrate/v4/migrate.go:580 +0x688
created by github.com/golang-migrate/migrate/v4.(*Migrate).Up
	/go/src/gitlab.com/projectname/vendor/github.com/golang-migrate/migrate/v4/migrate.go:281 +0xf0

Additional context
I am only using signed INTs in the db scheme.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions