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

MSSQL cacheSize is ignored for createSequence #5467

Open
1 of 2 tasks
Mas2112 opened this issue Jan 15, 2024 · 1 comment
Open
1 of 2 tasks

MSSQL cacheSize is ignored for createSequence #5467

Mas2112 opened this issue Jan 15, 2024 · 1 comment

Comments

@Mas2112
Copy link

Mas2112 commented Jan 15, 2024

Search first

  • I searched and no similar issues were found

Description

Example Changelog:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
  <changeSet author="test" id="my-seq">
    <createSequence schemaName="dbo" sequenceName="S_MY_SEQ" startValue="1" incrementBy="1" cacheSize="1000" />
  </changeSet>
</databaseChangeLog>

Example SQL Output:

-- Lock Database
UPDATE LIQUIBASE.runtime.DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = 'test', LOCKGRANTED = GETDATE() WHERE ID = 1 AND LOCKED = 0
GO

-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: root.xml
-- Ran at: 1/15/24, 9:42 AM
-- Against: xxxx
-- Liquibase version: 4.25.1
-- *********************************************************************

USE TEST;
GO

-- Changeset base/test.xml::my-seq::test
CREATE SEQUENCE S_MY_SEQ START WITH 1 INCREMENT BY 1;
GO

INSERT INTO LIQUIBASE.runtime.DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('my-seq', 'test', 'base/test.xml', GETDATE(), 124, '9:2f3284951a52e92fa13ec0254f1e7770', 'createSequence sequenceName=S_MY_SEQ', '', 'EXECUTED', NULL, NULL, '4.25.1', '5308156365')
GO

-- Changeset base/main.xml::tag-base::test
INSERT INTO LIQUIBASE.runtime.DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID, TAG) VALUES ('tag-base', 'test', 'base/main.xml', GETDATE(), 125, '9:4e4f708e1c27a78dcfe4f8fc0bcf54c9', 'tagDatabase', '', 'EXECUTED', NULL, NULL, '4.25.1', '5308156365', 'base')
GO

-- Release Database Lock
UPDATE LIQUIBASE.runtime.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1
GO

Steps To Reproduce

Try to create a sequence using createSequence and set the cacheSize.

Expected/Desired Behavior

The cacheSize parameter is ignored.

Liquibase Version

4.25.1

Database Vendor & Version

Microsoft SQL Server

Liquibase Integration

CLI

Liquibase Extensions

No response

OS and/or Infrastructure Type/Provider

Windows 11

Additional Context

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR (Thank you!)
@tati-qalified
Copy link
Contributor

Hi @Mas2112, thank you for reporting this issue. I found that the same thing was reported a few years ago for MariaDB (#2147) and fixed (#2270).

It's most likely caused by the same thing. Would you be willing to submit a PR to fix it? If so, our team will provide guidance through the process.

Thank you,
Tatiana

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants