Skip to content

Commit 034552d

Browse files
Fix missing cast when comparing a guid and string column in SAP SQL Anywhere
1 parent 656a88b commit 034552d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/NHibernate/Dialect/SapSQLAnywhere17Dialect.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ protected override void RegisterStringFunctions()
6666
// SQL Anywhere locate arguments are inverted compared to other databases. As fixing this is likely
6767
// a breaking change for users of older versions, changing it only in the new dialect.
6868
RegisterFunction("locate", new SQLFunctionTemplateWithRequiredParameters(NHibernateUtil.Int32, "locate(?2, ?1, ?3)", new object[] { null, null, "1" }));
69+
70+
RegisterFunction("strguid", new SQLFunctionTemplate(NHibernateUtil.String, "cast(?1 as char(36))"));
6971
}
7072

7173
protected override void RegisterMathFunctions()

0 commit comments

Comments
 (0)