Bug #71749 | MySQL Fed issue Unexpected error code S1C00 received from data source - Paramete | ||
---|---|---|---|
Submitted: | 17 Feb 2014 11:38 | Modified: | 27 Jan 2022 12:07 |
Reporter: | Antonello Supino | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | Connector / J | Severity: | S2 (Serious) |
Version: | mysql-connector-java-5.1.26-bin.jar | OS: | Linux |
Assigned to: | Alexander Soklakov | CPU Architecture: | Any |
Tags: | parameter meta data, prepared statement |
[17 Feb 2014 11:38]
Antonello Supino
[19 Feb 2014 10:20]
Filipe Silva
Hi Antonello, Thank you for this bug report.
[21 Feb 2014 19:09]
Filipe Silva
Hi Antonello, I will need more detail on this. Ideally a piece of code with a sample case showing the results you are getting from the Connector/J (with and without generateSimpleParameterMetadata=true) that you expected differently. I possible, please tell us what exactly you were expecting. Thanks,
[22 Feb 2014 17:41]
Mark Matthews
MySQL Server doesn't return working parameter types for prepared statements, so I'm not sure how this could be fixed in the driver, at least not until it's fixed in the server.
[10 Mar 2014 14:32]
Antonello Supino
Mark, thanks for investigating. Would you like me me to raise a new bug report for having this fixed on server side?
[10 Apr 2014 13:47]
Alexander Soklakov
I leave this report as verified until we decide if it's possible to update server functionality.
[6 May 2014 8:34]
Antonello Supino
Is there any update on this? IBM is going to close the associated PMR 93917,019,866 as aged. I appreciate this is a free of charge service and I am thankful that you are looking into this but I will take into consideration that resolution time may take months for future business decisions.
[30 Jun 2014 8:55]
Antonello Supino
Is there any update ? This issue has been opened for months and a solution is not available, IBM is going to close the associated PMR. Regards
[3 Aug 2015 13:13]
Antonello Supino
We keep hitting this issue and writing workarounds. I am strongly dissatisfied of the level of support we receive from Oracle and MySQL, even if we pay for a maintenance license in case of issue like this we do not get any kind of support whatsoever.
[27 Jan 2022 12:00]
Alexander Soklakov
Posted by developer: The required server with was implemented in MySQL 8.0.22 under WL#9384. There is no need to fix anything in Connector/J regarding this functionality. The following test demonstrates current behaviour against MySQL 8.0.28: @Test public void testBug71749() throws Exception { createTable("testBug71749", "(id char(10),time_end TIMESTAMP(6))"); Properties props = new Properties(); props.setProperty(PropertyKey.useSSL.getKeyName(), "false"); props.setProperty(PropertyKey.allowPublicKeyRetrieval.getKeyName(), "true"); boolean useSPS = false; boolean generateSimpleMetadata = false; do { props.setProperty(PropertyKey.useServerPrepStmts.getKeyName(), "" + useSPS); props.setProperty(PropertyKey.generateSimpleParameterMetadata.getKeyName(), "" + generateSimpleMetadata); System.out.println("\nuseServerPrepStmts=" + useSPS + ", generateSimpleParameterMetadata=" + generateSimpleMetadata); Connection con = getConnectionWithProps(props); PreparedStatement ps = con.prepareStatement("select id from testBug71749 where time_end < ?"); ParameterMetaData md = ps.getParameterMetaData(); try { System.out.println("parameter type = " + md.getParameterType(1)); } catch (Exception e) { System.out.println(e.getClass() + ": " + e.getMessage()); } } while ((generateSimpleMetadata = !generateSimpleMetadata) || (useSPS = !useSPS)); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Connected to 8.0.28 useServerPrepStmts=false, generateSimpleParameterMetadata=false class java.sql.SQLException: Parameter metadata not available for the given statement useServerPrepStmts=false, generateSimpleParameterMetadata=true parameter type = 12 useServerPrepStmts=true, generateSimpleParameterMetadata=false parameter type = 93 useServerPrepStmts=true, generateSimpleParameterMetadata=true parameter type = 93 Please note that only real server-side prepared statements (with useServerPrepStmts=true) give a proper results. With useServerPrepStmts=false prepared statements are emulated in Connector/J and sent as a plain query, so that there is no way to figure out real parameter types.
[27 Jan 2022 12:07]
Alexander Soklakov
Posted by developer: This bug is not reproducible with the latest Connector/J 8.0 and MySQL 8.0.22 and above. Connector/J 5.1 series came to EOL on Feb 9th, 2021, see https://www.mysql.com/support/eol-notice.html, so this bug will not be fixed there.