Liquibase behaves different with utf8 from 3.4 to 3.5? - utf-8

we have utf8 sql files and using liquibase. I was setting up liquibase from ground up and had issues with utf8 encoded sql files for mysql.
I set everything from env variable to mysql connection string to guarante to use utf8 encoding but nothing worked. Tipps i tried: Setting env like file.encoding, setting utf8 into the connection string for mysql connection, setting the encoding for the database, client and server.
What worked was switching from Liquibase 3.5.1 to 3.4.2.
Did something change the behaviour or does Liquibase 3.5.1 has a new/different behaviour on how to handle utf8 files properly?
Example Error message when i use 3.5.1 instead of 3.4.2 (nothing else is different):
"Unexpected error running Liquibase: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO " ...

#sigi I may have encountered the same issue starting version 3.5.0 (3.5.1)
Token errors suggest that it must have to with the Lexical analysis added in version 3.5
https://liquibase.jira.com/projects/CORE/issues/CORE-2843
Fixed in version 3.5.2
SimpleSqlGrammer.jj
S_CHAR_LITERAL didn't support the escaped single quote within a string literal \'
quick workaround would be to replace escaped single quote \' with two quotes '' which is also working well in MySQL string literals

Related

Jekyll: incompatible character encodings: UTF-8 and Windows-874 (Encoding::CompatibilityError)

how can I fix this issue. this error occur when I try to run local server with Jekyll. I expect that this error came from my file name. (when the file name had changed from Thai character to English character, none of the error occur).
So, Are there any way to fix this error without changing the file name?
see the error
see the error

Laradock: docker-compose.yml is invalid format (PORT[/PROTOCOL]) on Windows

I try to follow the Laradock getting started tutorial on windows: http://laradock.io/getting-started/
I have the following tools:
Docker version: 20.10.5, build 55c4c88
git version: 2.30.2.windows.1
Windows 10 20H2(19042.867)
I get stuck on the step when trying to start the: docker-compose up -d nginx mysql
Then I get these error:
ERROR: The Compose file '.\docker-compose.yml' is invalid because:
services.proxy.expose is invalid: should be of the format 'PORT[/PROTOCOL]'
services.proxy2.expose is invalid: should be of the format 'PORT[/PROTOCOL]'
services.proxy.ports contains an invalid type, it should be a number, or an object
services.proxy2.ports contains an invalid type, it should be a number, or an object
...
services.sqs.ports contains an invalid type, it should be a number, or an object
services.sqs.ports contains an invalid type, it should be a number, or an object
services.traefik.ports value [':', ':', ':'] has non-unique elements
Only change I done to the repo is to add the env file and this line:
# Point to the path of your applications code on your host
APP_CODE_PATH_HOST=../project-z/
I also created the folder project-z
I saw this text quote but didn´t understand it:
Depending on the host’s operating system you may need to change the
value given to COMPOSE_FILE. When you are running Laradock on Mac OS
the correct file separator to use is :. When running Laradock from a
Windows environment multiple files must be separated with ;.
But think it might be related to my issue and I need to update something to make it work on Windows.
Any idea what could be wrong? Since it almost out of the box I assume it´s something with my Windows environment
I found the solution directly after posted this question.
It was very easy I forgot to add the "." before env when created the file.
I found the solution here: https://github.com/laradock/laradock/issues/1437

gdal incorrectly quoted string literal Oracle OCI

I updated to gdal version 2.
Now i get to error if i want get data from my Oracle Database.
ogrinfo -ro OCI:database/passwd -sql "SELECT COUNT(*) FROM tablename"
The Error i get is: Incorrectly quoted string literal.
with the old gdal version 1.xx it works correctly
I think the problem is the oci.dll at the gdalplugins. Has anybody some idea
After waiting a little bit i get the error
ORA-12154: TNS:could not resolve the connect identifier
It doesn't know why, because with the old gdal version it had worked
SQL quoting is strict in 2.x that 1.x, see:
https://trac.osgeo.org/gdal/browser/trunk/gdal/MIGRATION_GUIDE.TXT#L123

Convert from WE8MSWIN1252 to UTF-8 in MariaDB Engine Connect

I'm connecting to an Oracle DB with WE8MSWIN1252 encoding from a webserver that displays content in UTF-8 using MariaDB Connect Engine.
The code used for connecting the tables is like this:
CREATE TABLE mytable ENGINE=CONNECT TABLE_TYPE=ODBC TABNAME='oracle_table_name' CONNECTION='DSN=orcl;UID=someuser;PWD=passwd';
I know I have to pass somewhere the expected charset, but not sure about the syntax using this engine.
I'm able to correctly display the characters connecting directly from php using this code:
oci_connect('someuser', 'passwd', 'host', 'AL32UTF8');
The odbc.ini file looks like this:
[orcl]
Driver = Oracle 12c ODBC driver
Servername = host
I have tried putting Charset = UTF-8 in this file but it didn't work.
After many tries and a lot of investigation I understood that it was a matter of the environment setup.
I finally solved it writing the next line in /etc/init.d/mysql:
NLS_LANG=SPANISH_COLOMBIA.WE8MSWIN1252 ; export NLS_LANG
And to connect from isql the next line was needed in /root/.bash_profile:
NLS_LANG=SPANISH_COLOMBIA.AL32UTF8 ; export NLS_LANG
I was on CentOS 6, so I suppose in other environments this could not work.

Hibernate seems not to resolve alias correctly

since some days I'm facing the following problem:
I am using Hibernate to do the following Restriction on a criteria:
...
criteria.add(Restrictions.sqlRestriction("1=1 CONNECT BY PRIOR {ProcessEntityworkflowProject}.ID = {ProcessEntityworkflowProject}.PARENT_ID"))
Where "ProcessEntityworkflowProject" is the alias which should be resolved by hibernate.
This alias is set in code properly. I also debugged the code and inspected criteria:
There I could see that a subcriteria in subcriterialist of criteria has this correct alias bound to the association path.
But in SQL logs I see that it is not resolved:
... and this_.EXTERNAL_KEY is not null and 1=1 CONNECT BY PRIOR {ProcessEntityworkflowProject}.ID = {ProcessEntityworkflowProject}.PARENT_ID and processent4_.TYPE_ID=? ...
... or is this output correct and it is resolved later internally?
And in tomcat.log I see that there is a NPE:
java.lang.NullPointerException
at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:876)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:831)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:850)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3384)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1533)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:295)
I already found out that this NPE is cause because Oracle JDBC driver can not parse the brackets "{" "}". So I guess that the alias was not resolved properly.
Does anyone of you have an idea what could be wrong or how I could investigate deeper?
Some additional info:
I am using Hibernate 3.2.0 (CR1 afaik), tomcat 5.5, ojdbc14.jar.
Running on RHEL 6.4 and Oracle 11g
Many thx in advance if some of you have an idea ;)
Cheers
Sascha

Resources