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

Precision INT,BigInt in mysql #1398

Closed
ajsobrinomin opened this issue Sep 11, 2020 · 4 comments
Closed

Precision INT,BigInt in mysql #1398

ajsobrinomin opened this issue Sep 11, 2020 · 4 comments
Labels
DBMySQL hacktoberfest a month-long celebration of open-source software and Developers contribute by completing PRs ImpactLow IntegrationAny Severity3 sprint2022-31 TypeBug

Comments

@ajsobrinomin
Copy link

ajsobrinomin commented Sep 11, 2020

Environment: WIndows

Liquibase Version: 4.0.0

Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.>

Liquibase Extension(s) & Version:

Database Vendor & Version: mysql 8.0

Operating System Type & Version:

Description

I have a problem, I write different precision for bigint or int in mysql, then I execute my changeset and always liquibase execute the same preccision 20 for bigint and 11 for int.

Steps To Reproduce

List the steps to reproduce the behavior.

  • Please be precise and ensure private information is redacted
  • Include things like
    • Files used - sql scripts, changelog file(s), property file(s), config files, POM Files
    • Exact commands used - CLI, maven, gradle, spring boot, servlet, etc.

Actual Behavior

A clear and concise description of what happens in the software before this pull request.

  • Include console output if relevant
  • Include log files if available.

Expected/Desired Behavior

A clear and concise description of what happens in the software after this pull request.

Screenshots (if appropriate)

If applicable, add screenshots to help explain your problem.

Additional Context

Add any other context about the problem here.

@molivasdat
Copy link
Contributor

Hi @ajsobrinomin
Thanks for submitting your issue. Can you add a sample changeset that is failing to the description section? and the expected behavior?

@ajsobrinomin
Copy link
Author

Of Course, I attach in this comment a example of changeset.

For example in that example the primary of table have a bigint but Liquibase always take the same precision for BIGINT that is 18, the problem is the same with other number type in mysql for examlple smallint has six like precision.
Also I would like to participate in the project like developer that if you want.

@ro-rah ro-rah added the hacktoberfest a month-long celebration of open-source software and Developers contribute by completing PRs label Sep 28, 2020
@molivasdat
Copy link
Contributor

Hi @ajsobrinomin . BIGINT(18) is just a hint for zerofill. It does nothing with regards to precision.
See

https://stackoverflow.com/questions/3135804/types-in-mysql-bigint20-vs-int20
and
https://dev.mysql.com/doc/refman/8.0/en/integer-types.html

@ecarneiro01
Copy link

Hi @ajsobrinomin, I think the question you had is cleared in the previous comment.

Anyways, integer display width is deprecated and will be removed in future MySQL releases, the same goes for zerofill. In case you need to store numbers in a certain format you can store them in a CHAR column or use the LPAD function to zero-pad numbers.

I'm closing this ticket but feel free to reach out to us if you have any issues.

@ecarneiro01 ecarneiro01 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DBMySQL hacktoberfest a month-long celebration of open-source software and Developers contribute by completing PRs ImpactLow IntegrationAny Severity3 sprint2022-31 TypeBug
Projects
Archived in project
Development

No branches or pull requests

5 participants