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

NH-4053 - ISQLQuery - SetParameter doesn't work with more than 10 parameters #1359

Open
nhibernate-bot opened this issue Oct 13, 2017 · 3 comments

Comments

@nhibernate-bot
Copy link
Collaborator

Mateusz Dudek created an issue — 18th July 2017, 8:47:57:

When constructing a sql query using Session.CreateSQLQuery with 10 or more named parameters, SetParameter works incorrectly. For instance formatting the following query:

UPDATE SomeTable Set FirstColumn=:first, SecondColumn=:second <...> EleventhColumn=:eleven, TwelfthColumn=:twelve

Will result in:

UPDATE SomeTable Set FirstColumn='First', SecondColumn='Second' [...] EleventhColumn='Second'0, TwelfthColumn='Second'1

Which means that when NHbiernate indexes these parameters behind the scenes, after encountering two-digit number like 10, it only parses the first digit and leaves the rest unchanged.

@gliljas
Copy link
Member

gliljas commented Oct 27, 2017

I'm unable to reproduce this. In what scenario would NH replace parameters with literals?

@markdchurchill
Copy link

Is this a postgres specific issue with :param1 = 'Foo' being substituted into :param15 resulting in 'Foo'5? Postgres uses this colon prefix style, and it's particularly messy.

@fredericDelaporte
Copy link
Member

If you can reproduce this trouble, could you PR a test case? (See contributing.) If it is PostgreSQL specific, its TeamCity build will show it.

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

No branches or pull requests

5 participants