Skip to content

Duplicate parameters can be defined #591

@bgrainger

Description

@bgrainger
using (var cmd = new MySqlCommand("SELECT @foo;", connection))
{
	cmd.Parameters.AddWithValue("foo", 1);
	cmd.Parameters.AddWithValue("@foo", 2);
	cmd.ExecuteScalar();
}

Expected: MySqlException: Parameter '@foo' has already been defined.

Actual: no exception; ExecuteScalar returns 2.

(This happens with any combination of foo and @foo as the parameter names.)

May be fixed as part of #589.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions