|
From: <pa...@us...> - 2011-03-06 16:29:36
|
Revision: 5436
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5436&view=rev
Author: patearl
Date: 2011-03-06 16:29:29 +0000 (Sun, 06 Mar 2011)
Log Message:
-----------
SQLite: Change current_timestamp to return local time like other DBs.
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs
Modified: trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs 2011-03-06 07:17:04 UTC (rev 5435)
+++ trunk/nhibernate/src/NHibernate/Dialect/SQLiteDialect.cs 2011-03-06 16:29:29 UTC (rev 5436)
@@ -53,7 +53,10 @@
RegisterFunction("day", new SQLFunctionTemplate(NHibernateUtil.String, "strftime('%d', ?1)"));
RegisterFunction("month", new SQLFunctionTemplate(NHibernateUtil.String, "strftime('%m', ?1)"));
RegisterFunction("year", new SQLFunctionTemplate(NHibernateUtil.String, "strftime('%Y', ?1)"));
- RegisterFunction("current_timestamp", new NoArgSQLFunction("current_timestamp", NHibernateUtil.DateTime, false));
+
+ // Uses local time like MSSQL and PostgreSQL.
+ RegisterFunction("current_timestamp", new SQLFunctionTemplate(NHibernateUtil.DateTime, "datetime(current_timestamp, 'localtime')"));
+
RegisterFunction("substring", new StandardSQLFunction("substr", NHibernateUtil.String));
RegisterFunction("trim", new AnsiTrimEmulationFunction());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|