You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
Reply to this email directly or view it on GitHubhttps://github.com//issues/193#issuecomment-38554567
.
I agree with you. But I think this problem didn't appear before because if you add a space between the '<' and the parameter name, this problem doesn't appear.
@glenebob , while you are working in a permanent fix, I did a small change in current code which fix this issue but I think it breaks support added in #135 . As soon as you get your fix committed to master, I'll reapply to 2.1.x
This is far from ideal solution, but it will allow people who is having problems with 2.1.1 to work with NHibernate.
Just created a new release which contains a fix for this as I said before. Glen, when you have a permanent fix for this issue and #135, please, let me know so I can merge back to 2.1.x branch and upload a new release. Unless we end up releasing 2.2.x first.
@alexrootes , please, give it a try and let me know if everything is working ok for you. Thanks in advance for your report.
I just committed simplified and expanded tests for this into master, and
what I believe is the "right" fix for it.
Let's have a couple more sets of eyes look at it before we call it done and
merge it to 2.1.
Alex, can you verify that this fix works for you?
-Glen
On Thu, Mar 27, 2014 at 7:22 PM, Francisco Figueiredo Jr. < [email protected]> wrote:
Just created a new release which contains a fix for this as I said before.
Glen, when you have a permanent fix for this issue and #135#135,
please, let me know so I can merge back to 2.1.x branch and upload a new
release. Unless we end up releasing 2.2.x first.
Reply to this email directly or view it on GitHubhttps://github.com//issues/193#issuecomment-38883158
.
Activity
[-]Npgsql 2.1 'Less Than' prepare failing[/-][+]'Less Than' prepare failing[/+]alexrootes commentedon Mar 25, 2014
This seems like a pretty serious regression, possibly caused by PR #135 .
I have reverted NpgsqlCommand.Rewrite.cs to a version before this time and the above test passes as it should.
@glenebob does this sound like a possibility?
glenebob commentedon Mar 25, 2014
This sounds nasty :( And the mind boggles at how this could have made it
through a beta cycle :(
But, I'm betting it's a simple fix to the query rewriter. I will try to
take a look and fix it in the next couple days.
-Glen
On Tue, Mar 25, 2014 at 4:43 AM, Alex Rootes [email protected]:
franciscojunior commentedon Mar 25, 2014
I agree with you. But I think this problem didn't appear before because if you add a space between the '<' and the parameter name, this problem doesn't appear.
franciscojunior commentedon Mar 28, 2014
@glenebob , while you are working in a permanent fix, I did a small change in current code which fix this issue but I think it breaks support added in #135 . As soon as you get your fix committed to master, I'll reapply to 2.1.x
This is far from ideal solution, but it will allow people who is having problems with 2.1.1 to work with NHibernate.
Fix #193.
franciscojunior commentedon Mar 28, 2014
Just created a new release which contains a fix for this as I said before. Glen, when you have a permanent fix for this issue and #135, please, let me know so I can merge back to 2.1.x branch and upload a new release. Unless we end up releasing 2.2.x first.
@alexrootes , please, give it a try and let me know if everything is working ok for you. Thanks in advance for your report.
Issue #193, 'Less Than' prepare failing
Merge simplified/expanded tests from issue #193 from master.
glenebob commentedon Mar 29, 2014
Hi all,
I just committed simplified and expanded tests for this into master, and
what I believe is the "right" fix for it.
Let's have a couple more sets of eyes look at it before we call it done and
merge it to 2.1.
Alex, can you verify that this fix works for you?
-Glen
On Thu, Mar 27, 2014 at 7:22 PM, Francisco Figueiredo Jr. <
[email protected]> wrote:
alexrootes commentedon Mar 30, 2014
Thanks for this Glen,
I have retested with the latest master and I can confirm this issue appears to be resolved for me.
Alex.
glenebob commentedon Mar 30, 2014
@alexrootes,
Excellent! Thank you for testing it for us.
-Glen
Issue #193, 'Less Than' prepare failing
glenebob commentedon Apr 5, 2014
Fixed in master and 2.1.