March 19, 2021
Alert about MySQL Connector/J 8.0.23
Comments
(17)
March 19, 2021
Alert about MySQL Connector/J 8.0.23
Stargate Connections - Media Services Department
Newbie 1 posts
Followers: 1 people
(17)

We encountered a problem while setting up a new ColdFusion 2021 server, and felt it warranted an alert to other users who want to use MySQL through the community version of the MySQL Connector/J.

The currently available connector version 8.0.23 implements a change that breaks date values returned in queries in ColdFusion. Instead of returning the typical date or datetime string one expects, the connector now returns a LocalDateTime Java object. This is incompatible with any of the standard ColdFusion date-related functions, and causes errors.

To resolve the issue, we had to replace Connector/J 8.0.23 with Connector/J 8.0.22 instead, and everything is fine.

To download the connector: https://dev.mysql.com/downloads/connector/j/

To read about the issue:
https://dev.mysql.com/doc/relnotes/connector-j/8.0/en/news-8-0-23.html#connector-j-8-0-23-feature

17 Comments
Sep 27, 2023
Sep 27, 2023

For those finding this in late 2023, there is good news to share, and indeed a few things to note (which are communicated in many comments of the tracker ticket offered above, but I am simplifying them here):

  • First, be aware that there have been various attempts at resolution to this issue, with more to come (as of my writing, Sep 27, 2023)
  • For those on CF2021 and CF2018, there is a new hotfix jar for you to obtain, and a new single jvm arg to use to revert this behavior (and treat the mysql date objects as strings)
  • For those on CF2023, you do NOT need any hotfix jar but you DO (for now) still need to add the JVM arg to revert this behavior
  • Most important: there is a planned coming update (for CF2021 and 2023) which will instead REVERT the default behavior of how CF processes the date objects returned from mySQL (with that connectorj driver more recent than 8.0.23). Once that comes out, we won’t need EITHER the hotfix jar OR the jvm arg to revert the behavior

Again, all this is communicated in the comments at the bottom of the tracker ticket. These are not my ideas or solutions but Adobe’s. I’m just serving as a messenger.

The new JVM arg (to be used, for now, with CF2023 or when using the newer hotfix jars for CF2021 or 2018) is:
-Dcoldfusion.jdbc.mysql.datetime.str=true
The newer hotfix jars for CF2021 are these: for CF2021 and for CF2018.

To be clear, there WERE indeed different hotfix jars and even different jvm args for CF2021 and 2018, offered over the past 3 years that this problem has existed.  These above are the latest.

And one more time: an update is planned (said to the the next one) which WILL finally put all this behind us, no longer needing EITHER the hotfix jar OR the JVM arg, as CF will correctly handle the returned date objects and convert them to the expected strings for us…and all this mess will (hopefully) be over.

Like
(1)
(4)
Feb 5, 2023
Feb 5, 2023

This is still broker as of mysql-connector-j-8.0.32.jar

Is there a CF fix for this, since does not look like mysql will be going back on this? Do we keep on using the 8.0.22 library then?

Like
()
(3)
Jul 22, 2021
Jul 22, 2021

I have some news on this. First, there is indeed already a bug report filed for this (CF-4211276). FWIW, it was filed on Mar 9, a week before this post.

Second, I also just added a comment there, clarifying both how this issue is clarified in the docs on the change in that 8.0.23 driver, and how it really would be up to Adobe to fix it (as it requires just a very simple change in a single java call they do for us)

Folks seeing this post should register a vote on the bug. There was only 1, when I added the second just now.

Like
(1)
(1)
Add Comment