Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

EmulatedLengthSubstringFunction.cs: Strengthen syntax with extra para…

…meters around the start parameter placed inside the generated length parameter.
  • Loading branch information...
commit 5f79ad18d51b573127c6c40213f18ed60f7f2c1f 1 parent ab70924
Oskar Berggren oskarb authored
2  src/NHibernate/Dialect/Function/EmulatedLengthSubstringFunction.cs
View
@@ -35,7 +35,7 @@ public override SqlString Render(IList args, ISessionFactoryImplementor factory)
if (args.Count == 2)
{
// Have the DB calculate the length argument itself.
- var lengthArg = new SqlString("len(", args[0], ") + 1 - ", args[1]);
+ var lengthArg = new SqlString("len(", args[0], ") + 1 - (", args[1], ")");
args = new[] { args[0], args[1], lengthArg };
// Future possibility: Some databases, e.g. MSSQL, allows the length
Please sign in to comment.
Something went wrong with that request. Please try again.