Do not escape the backslash in values stored in the objects. #2021
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If the output format needs them escaped, escape them then.
Fixes #1598
Dev Handoff Notes (Internal Use)
Links
Testing
Dev Verification
Test Requirements (Liquibase Internal QA)
This bug is specific to diff-changelog and generate-changelog when --diff-types is passed to the command. When --diff-types includes ‘data,' Liquibase is incorrectly adding an escaping backslash to any containing a backslash. The bug can be replicated with the CLI and Maven interface using Liquibase 4.5.0.
Setup
CREATE USER LB2103 IDENTIFIED BY password
DEFAULT TABLESPACE "USERS"
TEMPORARY TABLESPACE "TEMP"
ACCOUNT UNLOCK ;
GRANT UNLIMITED TABLESPACE TO LB2103;
GRANT DBA TO LB2103;
COMMIT;
Manual Tests: CLI
Verify generate-changelog produces INSERT changesets without adding an escaping backslash.
liquibase generate-changelog --changelog-file gcl-lb2103.xml --diff-types table,data
liquibase generate-changelog --changelog-file gcl-lb2103.yaml --diff-types table,data
liquibase generate-changelog --changelog-file gcl-lb2103.oracle.sql --diff-types table,data
liquibase generate-changelog --changelog-file gcl-lb2103.json --diff-types table,data
Verify successful update using the generated-changelog.
liquibase drop-all --schemas LB2103
in between the update command for each changelog type.liquibase update --changelog-file <gcl-lb2103>
Verify Liquibase inserted the expected data values by querying the database directly.
SELECT * FROM LB2103.MY_TABLE;
A_TXT
column has values2
and\b08.*
Verify diff-changelog produces INSERT changesets without adding an escaping backslash.
liquibase diff-changelog --changelog-file dcl-lb2103.xml --diff-types table,data
dropTable
when you run diff-changelog, swap the url and referenceUrl values in your liquibase.properties file.Automated Tests
liquibase generate-changelog --changelog-file <changelog> --diff-types table,data
2
\b08.*
Github Users
┆Issue is synchronized with this Jira Bug by Unito