postgresql-jdbc.git / summary / log / commit / refs

commit    770b6d3ebd8ac78dd24e4628740652aae2bb3efd
Author:   Peter Eisentraut <peter@eisentraut.org>
Commit:   GitHub <noreply@github.com>
Date:     Tue Oct 13 10:24:21 2020 +0000

    fix: send type void parameters as null value (#1922)
    
    The previous code sent parameters of type void (used for OUT
    parameters of functions) with a text value of "null".  While this
    doesn't affect anything, since the value is ignored anyway, it's
    somewhat confusing, especially if it shows up in debug traces and
    error messages, and it's also a bit wasteful to send 4 bytes for
    nothing.  So instead, send those parameters as a null value, which
    seems semantically saner.


pgjdbc/src/main/java/org/postgresql/core/v3/SimpleParameterList.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgjdbc/src/main/java/org/postgresql/core/v3/SimpleParameterList.java b/pgjdbc/src/main/java/org/postgresql/core/v3/SimpleParameterList.java index e9468c0f..552af797 100644 --- a/pgjdbc/src/main/java/org/postgresql/core/v3/SimpleParameterList.java +++ b/pgjdbc/src/main/java/org/postgresql/core/v3/SimpleParameterList.java @@ -283,7 +283,7 @@ class SimpleParameterList implements V3ParameterList { for (int i = 0; i < paramTypes.length; ++i) { if (direction(i) == OUT) { paramTypes[i] = Oid.VOID; - paramValues[i] = "null"; + paramValues[i] = NULL_OBJECT; } } } [parent: f525f530d379]