Cf_sql_clob saving garbage character to MariaDB

Hi, I was running a sample code on Lucee that uses the cf_sql_clob to save data to Maria DB 10.9.4. The field is having utf16bin collation. The Lucee is having Clob support turned on. But the data is saved to DB as garbage (Chinese characters, +++ signs etc.).
This is working in older version of Lucee (5.3.9.22), Java (1.8.0_152), Apache Tomcat/8.5.24, Windows Server 2012 R2 (6.3) 64bit and Maria DB (10.2.12).

The issue exists in the following configuration

OS: Windows Server 2022 (10.0) 64bit
Java Version: 11.0.17
Tomcat Version: Apache Tomcat/9.0.68
Lucee Version: 5.3.10.97

@Prasanth_Kumar_S can you please share your sample test code? it will help to replicate the issue

Please see the SQL and code attached.

SQL

CREATE TABLE testnotes (
id INT(11) NOT NULL AUTO_INCREMENT,
notes MEDIUMTEXT NOT NULL COLLATE ā€˜utf16_binā€™,
PRIMARY KEY (id) USING BTREE
)
COLLATE=ā€˜latin1_swedish_ciā€™
ENGINE=InnoDB
;

testclob.cfm (2.2 KB)

I noticed the @Julian_Halliwellā€™s repo didnā€™t have CI with Github Actions setup, so I added one

one test is failing

which version of the extension?

check under lucee admin - extensions ā†’ applications

latest is 3.0.7

image

I added a clob test and it passes with 3.0.7

I donā€™t understandā€¦ may be I need some coffeeā€¦Are you sure the latin1_swedish_ci is also utf16bin? I thought you should be using something like utf16_general_ci then or not?

Update: Just saw your ā€œNULL COLLATE ā€˜utf16_binā€™ā€ā€¦ definately I need some coffee.

@Prasanth_Kumar_S checked this issue with lucee version 5.3.10.97. Yes, Cf_sql_clob saving Chinese characters in MariaDB. seems it works fine with lucee version 5.3.9.22-SNAPSHOT.

This is a regression. so can you please raise a ticket in JIRA: https://luceeserver.atlassian.net/

@Prasanth_Kumar_S Bug filed: [LDEV-4325] - Lucee

Thank you @cfmitrah

1 Like