Skip to content

unsigned int recognized as type of int<-2147483648, 2147483647> #737

@danrot

Description

@danrot

I have the following table structure (output from a SHOW CREATE TABLE statement in MySQL and omitted fields that do not matter for the issue):

CREATE TABLE `t_documents` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`),
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC

When I query that table in my code, then phpstan-dba will result in the following type:

array{id: int<-2147483648, 2147483647>}

Which I think is wrong, since the minimum value should be 0, because the id column is defined as unsigned.

I wanted to update the tests in a way that show that issue, but it took me too long... I am still willing to contribute a test and maybe even the fix, but I wanted to make sure I am not making any stupid mistakes 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions