You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the issue ResultSetMetaData#isNullable returns ResultSetMetaData.columnNoNulls for columns that contain null values filled from a left join.
We had previously filed this bug when we first discovered the issue however that did not lead anywhere. We are able to provide an easier repro this time, see To Reproduce below.
Driver Version?
42.2.14
Java Version?
8.0.275.open
OS Version?
Windows 10
PostgreSQL Version?
12.5
To Reproduce
Create table schedules that contains a NOT NULL integer-type column schedule_id:
CREATE TABLE schedules (
schedule_id integer NOT NULL
);
Info on the actual data of schedule_id:
All values of column schedule_id stored in the table schedules are positive integers.
Execute query:
SELECT
*
FROM (
SELECT
-1 s_id
) s
LEFT JOIN schedules
ON s_id = schedule_id
Expected behavior
Calling ResultSetMetaData#isNullable on the object returned from PreparedStatement#getMetadata or Statement#executeQuery#getMetaData for this query suggests that the column schedule_id is nullable given that the column can be filled with null values from the left join.
Actual behavior ResultSetMetaData#isNullable returns ResultSetMetaData.columnNoNulls in the above case.
The text was updated successfully, but these errors were encountered:
jie-d
changed the title
Incorrect column metadata returned by ResultSetMetaData#isNullable for columns that contain null values filled from a left join
Incorrect column metadata returned by ResultSetMetaData#isNullable for columns that contain null values filled from a left join
Mar 2, 2021
Describe the issue
ResultSetMetaData#isNullable
returnsResultSetMetaData.columnNoNulls
for columns that contain null values filled from a left join.We had previously filed this bug when we first discovered the issue however that did not lead anywhere. We are able to provide an easier repro this time, see To Reproduce below.
Driver Version?
42.2.14
Java Version?
8.0.275.open
OS Version?
Windows 10
PostgreSQL Version?
12.5
To Reproduce
Create table schedules that contains a NOT NULL integer-type column schedule_id:
Info on the actual data of schedule_id:
All values of column schedule_id stored in the table schedules are positive integers.
Execute query:
Result of the query:
Expected behavior
Calling
ResultSetMetaData#isNullable
on the object returned fromPreparedStatement#getMetadata
orStatement#executeQuery#getMetaData
for this query suggests that the column schedule_id is nullable given that the column can be filled with null values from the left join.Actual behavior
ResultSetMetaData#isNullable
returnsResultSetMetaData.columnNoNulls
in the above case.The text was updated successfully, but these errors were encountered: