-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Checksum calculation affected by environment locale #1806
Comments
I am not sure, maybe this is related to #1760 ? |
We are using the |
Ah I see. As far as I can see |
Yes, I would suspect that the SQL statements are probably affected as well. It seems that the LC_CTYPE affects the encoding used during the Maven build, even though UTF-8 has been specified in the pom.xml. Maybe I need to set other encoding options for Maven / Java as well, like -Dfile.encoding=UTF-8. |
Hi @mauritz72 Thanks for alerting us to this issue. We will add it to our list of issues to process. In meantime, it looks like there is a workaround to set LC_CTYPE=UTF8 on your environments. |
There is a few things on this issue to talk about:
We are going to investigate this points further. |
I got this msg that is incorrect: Current versions of liquibase default to Thanks! |
I created #3189 to remove the problem warning, so closing this issue. |
Environment
Liquibase Version:
4.3.3
Liquibase Integration & Version:
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /usr/local/Cellar/maven/3.8.1/libexec
Java version: 15.0.2, vendor: N/A, runtime: /usr/local/Cellar/openjdk/15.0.2/libexec/openjdk.jdk/Contents/Home
Default locale: nb_NO, platform encoding: UTF-8
OS name: "mac os x", version: "11.2.3", arch: "x86_64", family: "mac"
Database Vendor & Version:
MySQL JDBC connector 8.0.23, MySQL server version: 5.7.34
Operating System Type & Version:
Apple macOS Big Sur 11.2.3
Description
Checksum calculation behaves differently with different terminal locale settings, regardless of encoding settings applied in Maven project (UTF-8). This can cause liquibase commands that works in one environment to fail in another environment where the only difference is LC_CTYPE (or LANG) environment variable value.
Steps To Reproduce
Execute
mvn liquibase:updateSQL
on changeset source files that have UTF-8 characters in them (in our case, native Swedish and Norwegian character values inside custom SQL changesets), using different terminal LC_TYPE (or LANG) variable values, like this:Actual Behavior
In our case, the command that uses
LC_CTYPE=nb_NO.UTF-8
(as described above) fails producing the following error in the build output:One of the changsets that fails with checksum errors is the following one (it contains native norwegian and swedish characters
å
,æ
andä
):We are using the following encoding setting in our Maven pom.xml:
All our source files are stored using UTF-8 encoding.
Expected/Desired Behavior
The checksum calculation should not be affected by client terminal language / locale settings and respect / use the source file encoding settings configured in the Maven project (in our case UTF-8) to ensure stable builds across environments.
The text was updated successfully, but these errors were encountered: