Skip to content

Inserting into UINT32 column can cause error with leading 0 #498

@Hydrocharged

Description

@Hydrocharged

Repro:

CREATE TABLE test (pk BIGINT PRIMARY KEY, v1 INT UNSIGNED);
INSERT INTO test VALUES (1, "04394");

Running the above query returns the following error in the integrator https://github.com/dolthub/dolt:

INSERT INTO test VALUES (1, "04939"): unable to cast "04939" to uint64: strconv.ParseUint: parsing "04939": invalid syntax

This is due to our usage of the cast package in https://github.com/dolthub/go-mysql-server/blob/967d6031acbb42745a71f34ae65f590bc81746f7/sql/numbertype.go
We should just remove the cast package altogether and rewrite the functionality.

Metadata

Metadata

Assignees

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