Defining a MySql datasource in Application.cfc with custom connection parameters fails

Description

Defining a MySql datasource in Application.cfc as follows...

this.datasource = { type: "mysql" ,host: "localhost" ,port: 3306 ,database: "testdb" ,username: "dbuser" ,password: "secret" ,custom: { useUnicode:true } };

...fails with the following exception message:

Unknown database 'testdbuseunicodetrue'

If I add a question mark to the database name, it works correctly:

database: "testdb?"

It would seem the question mark isn't being added when constructing the connection string.

Environment

None

Activity

Show:

Pothys - MitrahSoft 3 May 2017 at 15:05

I've added test case for this ticket & confirmed the issue happened. If we define mysql datasource in application.cfc using above code it throw error like "Unknown database 'testdbuseunicodetrue'". If we end the database name with "?", it's working fine. I've checked with sqlserver, postgres all were working fine.

Pull Request: https://github.com/lucee/Lucee/pull/224

Fixed

Details

Assignee

Reporter

Priority

Labels

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 1 May 2017 at 17:00
Updated 12 May 2021 at 14:01
Resolved 22 May 2017 at 17:47

Flag notifications