Bug #96442 | Incorrect DATE error when calling getMetaData on prepared statement | ||
---|---|---|---|
Submitted: | 7 Aug 2019 2:56 | Modified: | 7 Jan 2020 19:53 |
Reporter: | Kinika Tasie-Amadi | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S2 (Serious) |
Version: | 8.0.16, 8.0.17 | OS: | Any (Noted on Windows and MacOS) |
Assigned to: | CPU Architecture: | Any |
[7 Aug 2019 2:56]
Kinika Tasie-Amadi
[7 Aug 2019 10:03]
MySQL Verification Team
Hello Kinika Tasie-Amadi, Thank you for the report. regards, Umesh
[13 Sep 2019 12:08]
Alexander Soklakov
Hi Kinika, You are right, server behaviour has changed since 8.0.16. We need to fix the metadata request in ClientPreparedStatement. But it's worth to mention that calling this method on a ClientPreparedStatement is not effective. ServerPreparedStatement is really prepared on server side and the metadata is returned by server after prepare(). But ClientPreparedStatement only emulates the prepare() on a client side, no metadata is known until this statement is executed. So the ClientPreparedStatement.getMetaData() in fact calls the statement execution and returns the metadata obtained from result set. I.e. you call the statement twice if you do getMetaData() before execute().
[7 Jan 2020 19:53]
Daniel So
Posted by developer: Added the following entry to the Connector/J 8.0.19 changelog: "For some prepared statements, calling getMetaData() on them resulted in an Incorrect DATE error, even when no DATE values were involved. This was due to some recent changes on the MySQL 8.0 Server, to which this patch adjusts Connector/J."
[21 Apr 2020 21:24]
Daniel So
Posted by developer: Also added the changelog entry for Connector/J 5.1.49.