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

4.6.0 handles "escaped string" from .csv different than 4.5.0 #3251

Open
norbertfenk-striva opened this issue Sep 7, 2022 · 0 comments
Open

Comments

@norbertfenk-striva
Copy link

Environment

Liquibase Version: 4.6.0

Liquibase Integration & Version: CLI

Liquibase Extension(s) & Version:

Database Vendor & Version: mariadb:10.7.1

Operating System Type & Version: linux

Infrastructure Type/Provider: docker

Description

During liquibase upgrade from v4.5.0 to v4.6.0, I noticed the string escaping has changed in case of data loaded from .csv file.
For me, this issue would break production changelogs. During my investigation, I have not found any workaround for this problem.

I checked more recent versions too and the behavior permanently changed. (form 4.6.0 to 4.15.0)

Steps To Reproduce

I attached a .zip file with the corresponding redacted changelogs and a docker-compose file that starts the mariadb and phpmyadmin. The .zip file contains a lib folder, a liquibase.jar file and the liquibase binary of versions 4.5.0 and 4.6.0. I downloaded them from liquibase github releases. For easier usage I copied mariadb-java-client-2.7.0.jar from 4.6.0 to 4.5.0.

The docker/logs folder is mounted to the container. From here, you can reach the general.log of the mariadb.

Here are some useful commands:

  1. start and stop docker containers:
docker-compose -f docker/mariadb.yml up -d
docker-compose -f docker/mariadb.yml down
  1. run the changes:
# NOTE: please do not forget to drop the database content between runs

4.5.0-files/liquibase \
update \
--username=admin \
--password=admin \
--url=jdbc:mariadb://localhost:3306/admin \
--changelog-file=master.xml \
--driver=org.mariadb.jdbc.Driver \
--log-level=FINE

4.6.0-files/liquibase \
update \
--username=admin \
--password=admin \
--url=jdbc:mariadb://localhost:3306/admin \
--changelog-file=master.xml \
--driver=org.mariadb.jdbc.Driver \
--log-level=FINE

Actual Behavior

The relevant part of the general.log file

4.5.0

INSERT INTO `admin`.escape_bug(id, string_regex) VALUES(16, 'https?:\\/\\/')

4.6.0

INSERT INTO `admin`.escape_bug(id, string_regex) VALUES(16, 'https?:\\\\\\/\\\\\\/')

Expected/Desired Behavior

From my perspective v4.5.0 is the proper one because I would later update this regex:

INSERT INTO `admin`.escape_bug(id, string_regex) VALUES(16, 'https?:\\/\\/')

Screenshots (if appropriate)

4.5.0
4 5 0-result

4.6.0
4 6 0-result

Additional Context

bug-package.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Open Issues
Development

No branches or pull requests

2 participants