liquibase / liquibase

Main Liquibase Source
https://www.liquibase.org
Apache License 2.0
4.73k stars 1.86k forks source link

Liquibase Output change executed twice #6342

Open jasonlyle88 opened 1 month ago

jasonlyle88 commented 1 month ago

Search first

Description

When using a change type of output, the string to be output gets output twice instead of once.

It appears that with the output type, since it isn't actually a database change it is handled slightly differently than other change types. The addSqlMdc function of change generates the change to be done, but this triggers actually writing the output to the screen.

The actual execution of the change then occurs, and output the information a second time.

The addSqlMdc should not actually be executing the output.

Steps To Reproduce

Create a changelog with an output change type

Expected/Desired Behavior

Output only shows up once

Liquibase Version

4.29.2

Database Vendor & Version

No response

Liquibase Integration

No response

Liquibase Extensions

No response

OS and/or Infrastructure Type/Provider

No response

Additional Context

No response

Are you willing to submit a PR?

lbadam commented 1 month ago

@jasonlyle88 thanks for filing this issue and for the PR. We will take a look at it 👍

jasonlyle88 commented 1 month ago

Thanks, happy to help!

wwillard7800 commented 1 month ago

@jasonlyle88 the fix for this is here, right?

https://github.com/liquibase/liquibase/pull/6343

jasonlyle88 commented 1 month ago

@jasonlyle88 the fix for this is here, right?

6343

Yup, thats the PR for this