Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
When using an updatable resultset (using ResultSet.CONCUR_UPDATABLE), If query concern only one table AND having same field repeat multiple time, getting a value using resultset.getXXX() from one of those repeated field will result in a NPE.
example :
stmt.execute("CREATE TABLE TT ( t1 varchar(50) NOT NULL, t2 varchar(50), PRIMARY KEY (t1))"); |
stmt.execute("insert into tt values ('a', 'b'), ('c', 'd')"); |
PreparedStatement preparedStatement = sharedConnection.prepareStatement("SELECT t1, t2, t1 as t3 FROM TT", ResultSet.FETCH_FORWARD, ResultSet.CONCUR_UPDATABLE); |
ResultSet rs = preparedStatement.executeQuery();
|
while (rs.next()) { |
rs.getObject(3); //will thow an NPE |
}
|
|
resulting error is :
java.lang.NullPointerException
|
at org.mariadb.jdbc.internal.com.read.resultset.SelectResultSet.getInternalObject(SelectResultSet.java:2099) |
at org.mariadb.jdbc.internal.com.read.resultset.SelectResultSet.getObject(SelectResultSet.java:1936) |