File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed
main/user-impl/java/com/mysql/cj/jdbc
test/java/testsuite/regression Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 33
44Version 8.0.28
55
6+ - Fix for Bug#85223 (25656020), MYSQLSQLXML SETSTRING CRASH.
7+
68 - Fix for Bug#84365 (33425867), INSERT..VALUE with VALUES function lead to a StringIndexOutOfBoundsException.
79
810 - Fix for Bug#105211 (33468860), class java.time.LocalDate cannot be cast to class java.sql.Date.
Original file line number Diff line number Diff line change @@ -404,7 +404,7 @@ protected String readerToString(Reader reader) throws SQLException {
404404
405405 protected synchronized Reader serializeAsCharacterStream () throws SQLException {
406406 checkClosed ();
407- if (this .workingWithResult ) {
407+ if (this .workingWithResult || this . owningResultSet == null ) {
408408 // figure out what kind of result
409409 if (this .stringRep != null ) {
410410 return new StringReader (this .stringRep );
Original file line number Diff line number Diff line change @@ -11873,4 +11873,29 @@ public void testBug84365() throws Exception {
1187311873 assertFalse(this.rs.next());
1187411874 }
1187511875 }
11876+
11877+ /**
11878+ * Test fix for Bug#85223 (25656020), MYSQLSQLXML SETSTRING CRASH.
11879+ *
11880+ * @throws Exception
11881+ */
11882+ @Test
11883+ public void testBug85223() throws Exception {
11884+ Properties props = new Properties();
11885+ props.setProperty(PropertyKey.sslMode.getKeyName(), SslMode.DISABLED.name());
11886+ props.setProperty(PropertyKey.allowPublicKeyRetrieval.getKeyName(), "true");
11887+
11888+ String elementString = "<Person ID=\"1\"><PersonType>M</PersonType><FirstName>FName</FirstName><LastName>LName</LastName></Person>";
11889+ Connection con = getConnectionWithProps(props);
11890+ PreparedStatement pst = con.prepareStatement("SELECT ExtractValue(?,?) as val1");
11891+ SQLXML xml = con.createSQLXML();
11892+ xml.setString(elementString);
11893+ pst.setSQLXML(1, xml);
11894+ pst.setString(2, "/Person/LastName");
11895+ pst.execute();
11896+ this.rs = pst.getResultSet();
11897+ this.rs.next();
11898+ String value = this.rs.getString(1);
11899+ assertEquals("LName", value);
11900+ }
1187611901}
You can’t perform that action at this time.
0 commit comments