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