tracker issue : CF-4202819

select a category, or use search below
(searches all categories and all time range)
Title:

MariaDB JDBC : cfquery latin chars

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/ThirdParty

Reporter/Name(from Bugbase): David REYNAUD / ()

Created: 06/11/2018

Components: Database, JDBC

Versions: 2016

Failure Type: Non Functioning

Found In Build/Fixed In Build: 2016.0.06.308055 /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Linux

Vote Count: 0

MariaDB (Debian9 MariaDB package)
MariaDB Connector/J (official MariaDB JDBC type 4 driver) 
ColdFusion 2016 (installed on Debian 9)
Failed to retrieve a database's column value when the column contains latins (eg. 'é') characters.

Steps to Reproduce:

Download the latest MariaDB Cpnnector/J : mariadb-java-client-2.2.5.jar
Put the downloaded .jar to theColdFusion's lib directory
Restart ColdFusion

MariaDB : Create a new database schema :
    CREATE DATABASE `mydb` /*!40100 COLLATE 'utf8mb4_general_ci' */;

MariaDB : Create a new table 'mytable' with a column 'myname' :
    CREATE TABLE `mytable` (
	`myname` VARCHAR(50) NULL
    ) COLLATE='utf8mb4_general_ci';

MariaDB : Add a new row to the table (with latins characters) :
    INSERT INTO  mytable (myname) VALUES ('été');

ColdFusion : add a ColdFusion's datasource (type : other) :
    CF Data Source Name : testdb
    JDBC URL : jdbc:mariadb://127.0.0.1:3306/testdb
    Driver Class : org.mariadb.jdbc.Driver
   
Create a test.cfm page containg the code below :
    <cfquery name="qList" datasource="testdb">
    SELECT * FROM mytable
    </cfquery>

The code fail beacuse the database column contains latins characters. If i remove/replace the column value 'été' to 'ete' then the query works fine.

Also, il a change the ColdFusion datasource to use the official Oracle MySQL JDBC Connector (instead of the MariaDB Connecotoi/J) the query run successfully.

We have tried many settings on the MariaDB server and on the JDBC URL options without any success.

We always have a the following ColdFusion's error : String index out of range: 5
Java Stack Trace :
java.lang.StringIndexOutOfBoundsException: String index out of range: 5
	at java.lang.String.substring(String.java:1963)
	at org.mariadb.jdbc.internal.com.read.resultset.rowprotocol.TextRowProtocol.getInternalString(TextRowProtocol.java:224)
	at org.mariadb.jdbc.internal.com.read.resultset.SelectResultSet.getString(SelectResultSet.java:941)
	at coldfusion.sql.QueryTable.populate(QueryTable.java:376)
	at coldfusion.sql.QueryTable.populate(QueryTable.java:286)
	...

Actual Result:
Failed

Expected Result:
Works

Any Workarounds:
No

Attachments:

Comments:

Hi David, I am able to repro this issue with the MariaDB jdbc driver. However, this is an issue with the MariaDB jdbc driver. Please log a bug with MariaDB. Exception stacktrace: {code:java} Java Stack Trace : java.lang.StringIndexOutOfBoundsException: String index out of range: 5 at java.lang.String.substring(String.java:1963) at org.mariadb.jdbc.internal.com.read.resultset.rowprotocol.TextRowProtocol.getInternalString(TextRowProtocol.java:224) at org.mariadb.jdbc.internal.com.read.resultset.SelectResultSet.getString(SelectResultSet.java:941) at coldfusion.sql.QueryTable.populate(QueryTable.java:376) at coldfusion.sql.QueryTable.populate(QueryTable.java:286) {code} -Nimit
Comment by Nimit S.
29507 | July 05, 2018 11:12:07 AM GMT