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

LB v4.2.0 - Variables are NOT substituted when using nested properties deeper than level 1 in another property definition with YAML #1574

Closed
szandany opened this issue Dec 7, 2020 · 1 comment

Comments

@szandany
Copy link
Contributor

szandany commented Dec 7, 2020

Liquibase Version:
Liquibase 4.2.0, 4.1.1

Liquibase Integration & Version: CLI

Description

When using nested properties that are deeper than level 1 in a YAML changelog, the variables will NOT get substituted.

Steps To Reproduce

  1. Use Liquibase 4.2.0
  2. Use nested properties that are deeper than level 1 with a YAML changelog. For example:
databaseChangeLog:
- property:
    name: var1
    value: 'IDPSIM'
    global: false

- property:
    name: var2
    value: 'urn:nl-eid-gdi:1.0:AD:00000004000000149000:entities:9999'
    global: false

- property:
    name: idpid1
    value:
      "(SELECT ID FROM ORCH_IDPS \
      WHERE IDP_ENTITY_ID = '${var2}' \
      AND IDP_TYPE = '${var1}')"
    global: false

- property:
    name: dvsidpid1
    value:
      "(SELECT ID FROM ORCH_DVS_IDPS \
      WHERE IDP_ID = ${idpid1})"
    global: false

- changeSet:
    id: SteveZ
    author: 123
    changes:
    - insert:
        columns:
          - column:
              name: DVS_IDP_ID
              valueComputed: ${dvsidpid1}
        tableName: ORCH_DVS_IDP_ITEMS
  1. Run: liquibase updateSQL

Actual Behavior

The variables var1, and var2 are NOT substituted.
Output:

-- Changeset prop_test.yaml::SteveZ::123
INSERT INTO PUBLIC.ORCH_DVS_IDP_ITEMS (DVS_IDP_ID) VALUES ((SELECT ID FROM ORCH_DVS_IDPS WHERE IDP_ID = (SELECT ID FROM ORCH_IDPS WHERE IDP_ENTITY_ID = '${var2}' AND IDP_TYPE = '${var1}')));

Expected/Desired Behavior

When running the updateSQL with the same YAML changelog, the variables are substituted.

-- Changeset prop_test.yaml::SteveZ::123
INSERT INTO PUBLIC.ORCH_DVS_IDP_ITEMS (DVS_IDP_ID) VALUES ((SELECT ID FROM ORCH_DVS_IDPS WHERE IDP_ID = (SELECT ID FROM ORCH_IDPS WHERE IDP_ENTITY_ID = 'urn:nl-eid-gdi:1.0:AD:00000004000000149000:entities:9999' AND IDP_TYPE = 'IDPSIM')));

Additional Context

The issue doesn't seem to happen with XML changelogs.

@sync-by-unito sync-by-unito bot changed the title LB v4.2.0 - Variables are NOT substituted when using nested properties deeper than level 1 in another property definition with YAML LB v4.2.0 - Variables are NOT substituted when using nested properties deeper than level 1 in another property definition with YAML Dec 7, 2020
@nvoxland
Copy link
Contributor

This was fixed in 4.4.1

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