|
From: <dar...@us...> - 2009-06-10 04:45:38
|
Revision: 4440
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4440&view=rev
Author: darioquintana
Date: 2009-06-10 04:45:36 +0000 (Wed, 10 Jun 2009)
Log Message:
-----------
- fix for NH-1826
- bug fixed.
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs
trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/LiteralProcessor.cs
Modified: trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2009-06-10 03:08:30 UTC (rev 4439)
+++ trunk/nhibernate/src/NHibernate/Dialect/PostgreSQLDialect.cs 2009-06-10 04:45:36 UTC (rev 4440)
@@ -62,7 +62,7 @@
RegisterFunction("current_timestamp", new NoArgSQLFunction("now", NHibernateUtil.DateTime, true));
RegisterFunction("str", new SQLFunctionTemplate(NHibernateUtil.String, "cast(?1 as varchar)"));
RegisterFunction("locate", new PositionSubstringFunction());
-
+ RegisterFunction("iif", new SQLFunctionTemplate(null, "case when ?1 then ?2 else ?3 end"));
DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.NpgsqlDriver";
}
Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/LiteralProcessor.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/LiteralProcessor.cs 2009-06-10 03:08:30 UTC (rev 4439)
+++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/LiteralProcessor.cs 2009-06-10 04:45:36 UTC (rev 4440)
@@ -117,7 +117,8 @@
{
// TODO: something much better - look at the type of the other expression!
// TODO: Have comparisonExpression and/or arithmeticExpression rules complete the resolution of boolean nodes.
- String replacement = _walker.TokenReplacements[constant.Text];
+ string replacement;
+ _walker.TokenReplacements.TryGetValue(constant.Text, out replacement);
if ( replacement != null )
{
constant.Text = replacement;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|