This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch AOO50X in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 1bb4a3d6f29c4d4807a3e9737a11cdfaf0a6844b Author: Damjan Jovanovic <[email protected]> AuthorDate: Tue Sep 22 20:04:26 2026 +0200 Returns empty values instead of null from JavaSQLResultSet.getBytes() and JavaSQLResultSet.getDate(), when the database field is NULL. This is what the C++ JDBC driver was also doing, and OpenOffice gives major warnings and even crashes when Java components returns null to UNO. Patch by: me (cherry picked from commit 6fe7ee93872ca084a7b1106f4f2f407612e67fe5) --- .../src/main/java/com/sun/star/comp/sdbc/JavaSQLResultSet.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main/connectivity/java/sdbc_jdbc/src/main/java/com/sun/star/comp/sdbc/JavaSQLResultSet.java b/main/connectivity/java/sdbc_jdbc/src/main/java/com/sun/star/comp/sdbc/JavaSQLResultSet.java index d1cbf83883..f03c57391e 100644 --- a/main/connectivity/java/sdbc_jdbc/src/main/java/com/sun/star/comp/sdbc/JavaSQLResultSet.java +++ b/main/connectivity/java/sdbc_jdbc/src/main/java/com/sun/star/comp/sdbc/JavaSQLResultSet.java @@ -304,7 +304,12 @@ public class JavaSQLResultSet extends PropertySet @Override public byte[] getBytes(int columnIndex) throws SQLException { try { - return jdbcResultSet.getBytes(columnIndex); + byte[] bytes = jdbcResultSet.getBytes(columnIndex); + if (bytes != null) { + return bytes; + } else { + return new byte[0]; + } } catch (java.sql.SQLException exception) { throw Tools.toUnoException(this, exception); } @@ -317,7 +322,7 @@ public class JavaSQLResultSet extends PropertySet if (jdbcDate != null) { return DBTypeConversion.toDate(jdbcDate.toString()); } else { - return null; + return new Date(); } } catch (java.sql.SQLException exception) { throw Tools.toUnoException(this, exception);
