2
0

Fix: Prepared statements now support NULL arguments

This commit is contained in:
Jack Christensen
2014-04-02 15:52:33 -04:00
parent d4c2a2f18b
commit 9e5a3ef0d2
2 changed files with 32 additions and 4 deletions
+24
View File
@@ -5,6 +5,30 @@ import (
"time"
)
func TestNilTranscode(t *testing.T) {
conn := getSharedConnection(t)
var inputNil interface{}
inputNil = nil
result := mustSelectValue(t, conn, "select $1::integer", inputNil)
if result != nil {
t.Errorf("Did not transcode nil successfully for normal query: %v", result)
}
mustPrepare(t, conn, "testTranscode", "select $1::integer")
defer func() {
if err := conn.Deallocate("testTranscode"); err != nil {
t.Fatalf("Unable to deallocate prepared statement: %v", err)
}
}()
result = mustSelectValue(t, conn, "testTranscode", inputNil)
if result != nil {
t.Errorf("Did not transcode nil successfully for prepared query: %v", result)
}
}
func TestDateTranscode(t *testing.T) {
conn := getSharedConnection(t)