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
When attempting to insert null values into a database using the Helidon JDBC client, specifying Types.VARCHAR as the SQL type for null parameters leads to SQL type mismatch errors for columns that are not of type VARCHAR. This issue arises in scenarios where the application logic requires inserting null into columns with types such as NUMERIC, DATE, or other non-VARCHAR types. The current behavior assumes null values are always meant for VARCHAR columns, which is not universally applicable and causes exceptions in a variety of common use cases.
The expected behavior is for the JDBC client to not make assumptions about the column type for null parameters, allowing the underlying JDBC driver and database to interpret the null based on the context of the column it is being inserted into. This behavior would prevent type mismatch errors and make the library more robust and flexible for various database operations.
This problem is consistently reproducible whenever null values are inserted into non-VARCHAR columns.
Steps to reproduce
Create a database table named test_null_handling with three columns: id INT PRIMARY KEY, text_col VARCHAR(255), num_col NUMERIC.
Attempt to insert a record into the table with null values for text_col and num_col using Helidon DB Client's named parameters feature.
Environment Details
Problem Description
When attempting to insert
null
values into a database using the Helidon JDBC client, specifyingTypes.VARCHAR
as the SQL type fornull
parameters leads to SQL type mismatch errors for columns that are not of typeVARCHAR
. This issue arises in scenarios where the application logic requires insertingnull
into columns with types such asNUMERIC
,DATE
, or other non-VARCHAR
types. The current behavior assumesnull
values are always meant forVARCHAR
columns, which is not universally applicable and causes exceptions in a variety of common use cases.The expected behavior is for the JDBC client to not make assumptions about the column type for
null
parameters, allowing the underlying JDBC driver and database to interpret thenull
based on the context of the column it is being inserted into. This behavior would prevent type mismatch errors and make the library more robust and flexible for various database operations.This problem is consistently reproducible whenever
null
values are inserted into non-VARCHAR
columns.Steps to reproduce
test_null_handling
with three columns:id
INT PRIMARY KEY,text_col
VARCHAR(255),num_col
NUMERIC.null
values fortext_col
andnum_col
using Helidon DB Client's named parameters feature.Sample Test Code
The text was updated successfully, but these errors were encountered: