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

Firebird: fix createIndex missing space around "computed" #1500

Merged
merged 3 commits into from
Sep 21, 2022

Conversation

Markus-Patt
Copy link
Contributor

@Markus-Patt Markus-Patt commented Oct 22, 2020

This change fixes the case in invalid sql is generated, when an index with an computed value is created.


name: CreateIndexGeneratorFirebird generates invalid SQL on computed field

about: #1490
title: ''
labels: Status:Discovery
assignees: ''


Environment

Liquibase Version:
4.1.1

Database Vendor & Version:
Firebird 2.5
Firebird 3.0

Pull Request Type

  • Bug fix (non-breaking change which fixes an issue.)
  • Enhancement/New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

A clear and concise description of the issue being addressed.

  • Adding an index on a "computed by" value generates invalid sql

Steps To Reproduce

    <changeSet id="1" author="1">
        <createTable tableName="foo">
            <column name="id" type="INT">
                <constraints nullable="false" primaryKey="true" primaryKeyName="PK_foo" />
            </column>
            <column name="bar" type="INT" />
        </createTable>
    </changeSet>

    <changeSet id="2" author="2">
        <createIndex tableName="foo" indexName="idx_bar">
            <column name="bar + 1" computed="true" />
        </createIndex>
    </changeSet>

This creates the following sql:

CREATE INDEX idx_baz ON fooCOMPUTED BY (baz + 1)

which misses a space between the table name an the the keyword "computed"

Fast Track PR Acceptance Checklist:

Need Help?

Come chat with us on our discord channel

This change fixes the case in invalid sql is generated, when an index with an computed value is created.
@molivasdat
Copy link
Contributor

Thanks @Markus-Patt for finding the issue and creating a fix for it.

@molivasdat molivasdat added DBFirebird ImpactLow IntegrationAny RiskMedium Changes that require more testing or that affect many different code paths. Severity3 TypeBug labels Oct 23, 2020
@Markus-Patt
Copy link
Contributor Author

Shame on me, I missed a test.
Fixed now.

@kataggart kataggart added this to To Do in Conditioning++ via automation Aug 4, 2022
@kataggart kataggart removed ImpactLow RiskMedium Changes that require more testing or that affect many different code paths. labels Aug 10, 2022
@liquibase liquibase deleted a comment from codecov bot Aug 30, 2022
@nvoxland nvoxland self-requested a review as a code owner August 30, 2022 17:34
@nvoxland nvoxland added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Aug 30, 2022
@github-actions
Copy link

github-actions bot commented Aug 30, 2022

Unit Test Results

  4 632 files  +12    4 632 suites  +12   47m 38s ⏱️ + 10m 11s
  4 618 tests +  1    4 399 ✔️ +  1     219 💤 ±0  0 ±0 
54 588 runs  +12  49 564 ✔️ +12  5 024 💤 ±0  0 ±0 

Results for commit 874eb54. ± Comparison against base commit e742a88.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@nvoxland nvoxland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review and test results:

Things to be aware of:

  • Changes make sense to me
  • Only impacts firebird

Things to worry about:

  • Nothing

Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix addresses a bug in the generation of SQL for Firebird computed indexes.

  • New unit test added.
  • No additional testing required.

APPROVED

@nvoxland nvoxland changed the title fix CreateIndexGeneratorFirebird missing space in SQL (#1490) Firebird: fix createIndex missing space around "computed" Sep 21, 2022
@nvoxland nvoxland merged commit 031928b into liquibase:master Sep 21, 2022
@nvoxland nvoxland added this to the 1NEXT milestone Sep 21, 2022
@tabbyf00
Copy link

Thanks for your PR submission! We just finished reviewing and merging it into the 4.17.0 release on October 10, 2022. When you get a chance, could you please Star the Liquibase project? The star button is in the upper right corner of the screen.

@Markus-Patt Markus-Patt deleted the fix_1490 branch October 31, 2022 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

CreateIndexGeneratorFirebird generates invalid SQL on computed field
7 participants