Skip to content

Inserting large unsigned bigint in MySQL returns "Out of range value" error #3105

@aguspdana

Description

@aguspdana

Bug Description

Inserting unsigned integer larger than i64::MAX into a BIGINT UNSIGNED column returns "Out of range value" error.

Err(Database(MySqlDatabaseError { code: Some("22003"), number: 1264, message: "target: sigmo.-.primary: vttablet: rpc error: code = FailedPrecondition desc = Out of range value for column 'id' at row 1...

I'm using PlanetScale DB. Typing the query directly in the console worked.

Minimal Reproduction

CREATE TABLE hash_map (
    id BIGINT UNSIGNED,
    value TEXT
);

INSERT INTO hash_map (id, value)
VALUES (14959631574144683550, "Dog");

Info

  • SQLx version: 0.7.3
  • SQLx features enabled: "chrono", "json", "macros", "mysql", "tls-native-tls", "runtime-tokio"
  • Database server and version: PlanetScale (MySQL)
  • Operating system: M2 Mac
  • rustc --version: 1.74.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions