Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

'Less Than' prepare failing #193

Copy link
Copy link
@alexrootes

Description

@alexrootes
Issue body actions

Hi All, following the upgrade to 2.1 queries with less than operators are failing in NH.

Here is a test to replicate (put this in CommandTests.cs)

    [Test]
    public void LessThanInQueryStringWithPrepare()
    {
        var command = new NpgsqlCommand("select count(*) from data where field_serial <:param1", Conn);
        command.Parameters.AddWithValue(":param1", 1);
        command.Prepare();
        command.ExecuteScalar();
    }

ERROR: 42601: syntax error at or near ":"

This is because 'param1' is not replaced before being sent to the server.

This test is a direct copy of 'GreaterThanInQueryStringWithPrepare' which is the same file, which passes successfully!

Alex.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.