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

Correctly handle cacheSize in mariadb #2270

Merged
merged 4 commits into from Jan 10, 2022
Merged

Conversation

nvoxland
Copy link
Contributor

@nvoxland nvoxland commented Dec 13, 2021

Description

Adds support for createSequence and alterSequence cacheSize in mariadb

Fixes #2147


Dev Handoff Notes (Internal Use)

Links

Testing

  • Steps to Reproduce: cacheSize of createSequence is ignored #2147
  • Guidance:
    • Impact: Only changes SQL generated by createSequence and alterSequence in mariadb when cacheSize is set
    • You can see the generated sql with "update-sql"

Dev Verification

Ran createSequence and alterSequence tags against mariadb to ensure they set cacheSize.

Used these changesets:

<changeSet id="1" author="XXX">
        <createSequence sequenceName="SEQ_SET"
                        startValue="10000000"
                        incrementBy="1"
                        cacheSize="5" />
    </changeSet>

    <changeSet id="2" author="XXX">
        <alterSequence sequenceName="SEQ_SET"
                       cacheSize="10" />
    </changeSet>

Test Requirements (Liquibase Internal QA)

Manual Tests

Verify that update-sql generates sql code for cache argument with createSequence tag.

  • run liquibase update-sql --changelog-file lb2191-changelog.xml --labels create
  • generated sql contains cache argument
    CREATE SEQUENCE SEQ_SET INCREMENT BY 1 START WITH 10000000 CACHE 5;

Verify that update is successful with cache argument for createSequence tag.

  • run liquibase update --changelog-file lb2191-changelog.xml --labels create
  • SEQ_SET sequence is present in database
  • SEQ_SET has cache parameter set to 5

Verify that update-sql generates sql code for cache argument with alterSequence tag.

  • run liquibase update-sql --changelog-file lb2191-changelog.xml --labels alter
  • generated sql contains cache argument
    ALTER SEQUENCE SEQ_SET CACHE 10;

Verify that update is successful with cache argument for alterSequence tag.

  • run liquibase update --changelog-file lb2191-changelog.xml --labels alter
  • SEQ_SET has cache parameter set to 10

Verify that update-sql generates correct sql code for cacheSize=0 argument with createSequence tag.

  • run liquibase update-sql --changelog-file lb2191-changelog.xml --labels create-nocache
  • generated sql contains cache argument
    CREATE SEQUENCE SEQ_NO INCREMENT BY 1 START WITH 10000000 CACHE 0;

Verify that update is successful with cacheSize=0 argument for createSequence tag.

  • run liquibase update --changelog-file lb2191-changelog.xml --labels create-nocache
  • SEQ_NO sequence is present in database
  • SEQ_NO has cache parameter set to 0

Verify that update-sql generates correct sql code for cacheSize=0 argument with alterSequence tag.

  • run liquibase update-sql --changelog-file lb2191-changelog.xml --labels alter-nocache
  • generated sql contains cache argument
    ALTER SEQUENCE SEQ_SET NOCACHE;

Verify that update is successful with cacheSize=0 argument for alterSequence tag.

  • run liquibase update --changelog-file lb2191-changelog.xml --labels alter-nocache
  • SEQ_SET has cache parameter set to 0

Verify that update-sql generates correct sql code without cache argument for createSequence tag.

  • run liquibase update-sql --changelog-file lb2191-changelog.xml --labels create
  • generated sql contains cache argument
    CREATE SEQUENCE SEQ_DEF INCREMENT BY 1 START WITH 10000000;

Verify that update is successful without cache argument for createSequence tag.

  • run liquibase update --changelog-file lb2191-changelog.xml --labels create
  • SEQ_DEF sequence is present in database
  • SEQ_DEF has cache parameter set to 1000

Automated Tests

No new functional tests required for this fix.

┆Issue is synchronized with this Jira Bug by Unito

@nvoxland nvoxland added this to To Do in Conditioning++ via automation Dec 13, 2021
@nvoxland nvoxland moved this from To Do to Code Review in Conditioning++ Dec 13, 2021
@nvoxland nvoxland moved this from Code Review to Ready for Handoff (In JIRA) in Conditioning++ Dec 20, 2021
@nvoxland nvoxland merged commit cf04d4b into master Jan 10, 2022
Conditioning++ automation moved this from Ready for Handoff (In JIRA) to Done Jan 10, 2022
@nvoxland nvoxland deleted the fix-mariadb-cache-size branch January 10, 2022 23:03
@nvoxland nvoxland removed this from Done in Conditioning++ Jan 21, 2022
@nvoxland nvoxland added this to the v4.7.1 milestone Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cacheSize of createSequence is ignored
4 participants