Skip to content

INT(11) database type is read into int64 and so is other smaller Integer types #549

@samipshah

Description

@samipshah

Issue description

I have a db with INT(11) type which is of size 32 bits. To represent a row I keep a struct in golang with type int32. Now when I read back the size , Scan returns int64 and I see in binaryRow read function it casts data to int64 type. And hence I am unable to read it into appropriate int32 type. I would have to downcast in the code. However I would expect for integers Scan returns appropriate size.

Configuration

Driver version (or git SHA): V 1.3

Go version: run go version in your console 1.8

Server version: Mysql Ver 5.5.40-36.1

Server OS: debian-linux-gnu on x86_64 (Percona Server (GPL), Release 36.1, Revision 707)

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