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

Support "double precision" type in mysql #2592

Merged
merged 1 commit into from
Mar 12, 2022
Merged

Conversation

nvoxland
Copy link
Contributor

@nvoxland nvoxland commented Mar 2, 2022

Description

Added handling for "double precision" which is a distinct type in mysql vs. just "double" https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html

Fixes #2337

@nvoxland nvoxland requested a review from suryaaki2 March 2, 2022 20:09
@XDelphiGrl
Copy link
Contributor

With this fix, Liquibase generates correct SQL for MySQL columns configured in Liquibase changelogs with a DOUBLE PRECISION datatype. Note that MySQL treats DOUBLE PRECISION as a synonym for DOUBLE. This means that although Liquibase generates syntactically correct SQL to create a DOUBLE PRECISION column, if you view the table on the database OR run Liquibase generate-changelog, the datatype of the column will be DOUBLE. This is expected MySQL behavior.


  • Verify update-sql generates valid SQL for a column with DOUBLE PRECISION datatype. PASS
--  Changeset gcl1126.xml::1647019572747-2::erz (generated)
CREATE TABLE testdb1.double_precision_test (precision_column DOUBLE PRECISION(5, 2) NULL);
  • Verify update with a DOUBLE PRECISION column is successful. PASS

Test Environment
Liquibase Core: mysql-double-precision/1698/883393, Pro: master/672/56f847
MySQL 5.6, 5.7, 8.0
Functional Tests
Test Harness PR

@nvoxland nvoxland merged commit 257731a into master Mar 12, 2022
@nvoxland nvoxland deleted the mysql-double-precision branch March 12, 2022 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Impossible to set DOUBLE PRECISION datatype
4 participants