Skip to content

fix: allow leading zeros in CAST(string AS INT64)#667

Merged
adsharma merged 1 commit into
mainfrom
csv_fixes
Jul 8, 2026
Merged

fix: allow leading zeros in CAST(string AS INT64)#667
adsharma merged 1 commit into
mainfrom
csv_fixes

Conversation

@adsharma

@adsharma adsharma commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

The tryIntegerCast function had an explicit check rejecting any non-negative integer string starting with '0' (beyond just 0). This caused CAST('000012' AS INT64) to fail with a conversion exception, even though leading zeros are valid in integer representations.

Removed the leading-zero restriction. The integerCastLoop digit parser handles leading zeros naturally.

The tryIntegerCast function had an explicit check rejecting any
non-negative integer string starting with '0' (beyond just 0).
This caused CAST('000012' AS INT64) to fail with a conversion
exception, even though leading zeros are valid in integer
representations.

Removed the leading-zero restriction. The integerCastLoop digit
parser handles leading zeros naturally.
@adsharma adsharma merged commit c272f1f into main Jul 8, 2026
4 checks passed
@adsharma adsharma deleted the csv_fixes branch July 8, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant