Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate parameters can be defined #591

Closed
bgrainger opened this issue Nov 26, 2018 · 1 comment
Closed

Duplicate parameters can be defined #591

bgrainger opened this issue Nov 26, 2018 · 1 comment
Labels

Comments

@bgrainger
Copy link
Member

bgrainger commented Nov 26, 2018

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.

@bgrainger
Copy link
Member Author

bgrainger commented Dec 8, 2018

Fixed in 0.48.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant