Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema inspect fails with value out of range #2488

Closed
rpopp-fni-stl-com opened this issue Jan 30, 2024 · 0 comments · Fixed by #2504
Closed

schema inspect fails with value out of range #2488

rpopp-fni-stl-com opened this issue Jan 30, 2024 · 0 comments · Fixed by #2504

Comments

@rpopp-fni-stl-com
Copy link

Hello, per the request in discord, I have the following situation where I try to use schema inspect against a mysql instance, and it returns a value out of range error:

Error: template: inspect:1:4: executing "inspect" at <$.MarshalHCL>: error calling MarshalHCL: specutil: failed converting schema to spec: strconv.ParseInt: parsing "18446744073709551615": value out of range

If I set the format to sql when using inspect, I see the value it complains about is used in a table with its field type set to bigint. Dumping that specific table to a sql file:

CREATE TABLE testbed.`SEQUENCES` (`SEQ_NAME` varchar(50) NOT NULL, `INCREMENT_BY` int unsigned NOT NULL DEFAULT 1, `MIN_VAL` bigint unsigned NOT NULL DEFAULT 1, `MAX_VAL` bigint unsigned NOT NULL DEFAULT 18446744073709551615, `CUR_VAL` bigint unsigned NULL DEFAULT 1, `CYCLE` bool NOT NULL DEFAULT 0, PRIMARY KEY (`SEQ_NAME`)) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;

To replicate the issue, I used a quick variation on the getting started directions:
docker exec atlas-demo mysql -ppass -e "$(cat sequence_test.sql)"

And then to test against that:
atlas schema inspect -u "mysql://root:[email protected]:3306/testbed"

Returns the following:
Error: template: inspect:1:4: executing "inspect" at <$.MarshalHCL>: error calling MarshalHCL: specutil: failed converting schema to spec: strconv.ParseInt: parsing "18446744073709551615": value out of range

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 a pull request may close this issue.

1 participant