Skip to content

Prepared statement when single parameter is null #219

Open
@schveiguy

Description

@schveiguy

Not sure if this is a bug, but this threw me for a loop:

conn.exec("INSERT INTO sometable (nullableCol) VALUES (?)", null);

This results in an error saying the number of parameters mismatch. But why? Because null matches a Variant[] before it matches the varargs version!

I think the way to fix this is to handle the Variant[] case specifically in the varargs template, but only if the single parameter is not typeof(null).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions