Skip to content

Commit 830d66e

Browse files
committed
Add []byte(nil) insert check
1 parent b95ecaa commit 830d66e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

driver_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,15 @@ func TestNULL(t *testing.T) {
517517
if b == nil {
518518
dbt.Error("Nil []byte wich should be non-nil")
519519
}
520+
// Insert nil
521+
b = nil
522+
success := false
523+
if err = dbt.db.QueryRow("SELECT ? IS NULL", b).Scan(&success); err != nil {
524+
dbt.Fatal(err)
525+
}
526+
if !success {
527+
dbt.Error("Inserting []byte(nil) as NULL failed")
528+
}
520529
// Check input==output (==nil)
521530
b = nil
522531
if err = dbt.db.QueryRow("SELECT ?", nil).Scan(&b); err != nil {

0 commit comments

Comments
 (0)