Skip to content

Commit 7602f5f

Browse files
committed
Fix DateTime.Kind and update NullableExpressionDetector to support static properties
1 parent 4c3fe84 commit 7602f5f

24 files changed

+86
-39
lines changed

src/NHibernate.Test/Linq/PreEvaluationTests.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ protected override void Configure(Configuration configuration)
3131
configuration.SetProperty(Environment.LinqToHqlFallbackOnPreEvaluation, FallbackOnPreEvaluation.ToString());
3232
}
3333

34+
[Test]
35+
public void CanQueryByDateTimeNowUsingNotEqual()
36+
{
37+
var isSupported = IsFunctionSupported("current_timestamp");
38+
RunTest(
39+
isSupported,
40+
spy =>
41+
{
42+
var x = db.Orders.Count(o => o.OrderDate.Value != DateTime.Now);
43+
44+
Assert.That(x, Is.GreaterThan(0));
45+
AssertFunctionInSql("current_timestamp", spy);
46+
});
47+
}
48+
3449
[Test]
3550
public void CanQueryByDateTimeNow()
3651
{
@@ -60,6 +75,7 @@ public void CanSelectDateTimeNow()
6075
.OrderBy(o => o.id).Take(1).ToList();
6176

6277
Assert.That(x, Has.Count.GreaterThan(0));
78+
Assert.That(x[0].d.Kind, Is.EqualTo(DateTimeKind.Local));
6379
AssertFunctionInSql("current_timestamp", spy);
6480
});
6581
}
@@ -93,6 +109,7 @@ public void CanSelectDateTimeUtcNow()
93109
.OrderBy(o => o.id).Take(1).ToList();
94110

95111
Assert.That(x, Has.Count.GreaterThan(0));
112+
Assert.That(x[0].d.Kind, Is.EqualTo(DateTimeKind.Utc));
96113
AssertFunctionInSql("current_utctimestamp", spy);
97114
});
98115
}
@@ -126,6 +143,7 @@ public void CanSelectDateTimeToday()
126143
.OrderBy(o => o.id).Take(1).ToList();
127144

128145
Assert.That(x, Has.Count.GreaterThan(0));
146+
Assert.That(x[0].d.Kind, Is.EqualTo(DateTimeKind.Local));
129147
AssertFunctionInSql("current_date", spy);
130148
});
131149
}
@@ -166,6 +184,7 @@ public void CanSelectDateTimeOffsetNow()
166184
.OrderBy(o => o.id).Take(1).ToList();
167185

168186
Assert.That(x, Has.Count.GreaterThan(0));
187+
Assert.That(x[0].d.Offset, Is.EqualTo(DateTimeOffset.Now.Offset));
169188
AssertFunctionInSql("current_timestamp_offset", spy);
170189
});
171190
}
@@ -206,6 +225,7 @@ public void CanSelectDateTimeOffsetUtcNow()
206225
.OrderBy(o => o.id).Take(1).ToList();
207226

208227
Assert.That(x, Has.Count.GreaterThan(0));
228+
Assert.That(x[0].d.Offset, Is.EqualTo(TimeSpan.Zero));
209229
AssertFunctionInSql("current_utctimestamp_offset", spy);
210230
});
211231
}

src/NHibernate/Dialect/DB2Dialect.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ public DB2Dialect()
8888
RegisterFunction("tan", new StandardSQLFunction("tan", NHibernateUtil.Double));
8989
RegisterFunction("variance", new StandardSQLFunction("variance", NHibernateUtil.Double));
9090

91-
RegisterFunction("current_timestamp", new NoArgSQLFunction("current_timestamp", NHibernateUtil.DateTime, false));
92-
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.Date, false));
91+
RegisterFunction("current_timestamp", new NoArgSQLFunction("current_timestamp", NHibernateUtil.LocalDateTime, false));
92+
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.LocalDate, false));
9393
RegisterFunction("julian_day", new StandardSQLFunction("julian_day", NHibernateUtil.Int32));
9494
RegisterFunction("microsecond", new StandardSQLFunction("microsecond", NHibernateUtil.Int32));
9595
RegisterFunction("midnight_seconds", new StandardSQLFunction("midnight_seconds", NHibernateUtil.Int32));
@@ -141,8 +141,6 @@ public DB2Dialect()
141141
RegisterFunction("bxor", new Function.BitwiseFunctionOperation("bitxor"));
142142
RegisterFunction("bnot", new Function.BitwiseFunctionOperation("bitnot"));
143143

144-
RegisterFunction("current_timestamp", new NoArgSQLFunction("current_timestamp", NHibernateUtil.DateTime, false));
145-
146144
DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.DB2Driver";
147145
}
148146

src/NHibernate/Dialect/Dialect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected Dialect()
105105
// the syntax of current_timestamp is extracted from H3.2 tests
106106
// - test\hql\ASTParserLoadingTest.java
107107
// - test\org\hibernate\test\hql\HQLTest.java
108-
RegisterFunction("current_timestamp", new NoArgSQLFunction("current_timestamp", NHibernateUtil.DateTime, true));
108+
RegisterFunction("current_timestamp", new NoArgSQLFunction("current_timestamp", NHibernateUtil.LocalDateTime, true));
109109
RegisterFunction("sysdate", new NoArgSQLFunction("sysdate", NHibernateUtil.DateTime, false));
110110

111111
//map second/minute/hour/day/month/year to ANSI extract(), override on subclasses

src/NHibernate/Dialect/FirebirdDialect.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public override SqlString Render(IList args, ISessionFactoryImplementor factory)
154154
[Serializable]
155155
private class CurrentTimeStamp : NoArgSQLFunction
156156
{
157-
public CurrentTimeStamp() : base("current_timestamp", NHibernateUtil.DateTime, true)
157+
public CurrentTimeStamp() : base("current_timestamp", NHibernateUtil.LocalDateTime, true)
158158
{
159159
}
160160

@@ -413,7 +413,7 @@ protected virtual void RegisterFunctions()
413413
private void OverrideStandardHQLFunctions()
414414
{
415415
RegisterFunction("current_timestamp", new CurrentTimeStamp());
416-
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.Date, false));
416+
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.LocalDate, false));
417417
RegisterFunction("length", new StandardSafeSQLFunction("char_length", NHibernateUtil.Int64, 1));
418418
RegisterFunction("nullif", new StandardSafeSQLFunction("nullif", 2));
419419
RegisterFunction("lower", new StandardSafeSQLFunction("lower", NHibernateUtil.String, 1));

src/NHibernate/Dialect/HanaDialectBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,20 +441,20 @@ protected virtual void RegisterHANAFunctions()
441441
RegisterFunction("cosh", new StandardSQLFunction("cosh", NHibernateUtil.Double));
442442
RegisterFunction("cot", new StandardSQLFunction("cot", NHibernateUtil.Double));
443443
RegisterFunction("current_connection", new NoArgSQLFunction("current_connection", NHibernateUtil.Int32));
444-
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.DateTime, false));
444+
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.LocalDate, false));
445445
RegisterFunction("current_identity_value", new NoArgSQLFunction("current_identity_value", NHibernateUtil.Int64));
446446
RegisterFunction("current_mvcc_snapshot_timestamp", new NoArgSQLFunction("current_mvcc_snapshot_timestamp", NHibernateUtil.Int32));
447447
RegisterFunction("current_object_schema", new NoArgSQLFunction("current_object_schema", NHibernateUtil.String));
448448
RegisterFunction("current_schema", new NoArgSQLFunction("current_schema", NHibernateUtil.String, false));
449449
RegisterFunction("current_time", new NoArgSQLFunction("current_time", NHibernateUtil.DateTime, false));
450-
RegisterFunction("current_timestamp", new NoArgSQLFunction("current_timestamp", NHibernateUtil.DateTime, false));
450+
RegisterFunction("current_timestamp", new NoArgSQLFunction("current_timestamp", NHibernateUtil.LocalDateTime, false));
451451
RegisterFunction("current_transaction_isolation_level", new NoArgSQLFunction("current_transaction_isolation_level", NHibernateUtil.String, false));
452452
RegisterFunction("current_update_statement_sequence", new NoArgSQLFunction("current_update_statement_sequence", NHibernateUtil.Int64));
453453
RegisterFunction("current_update_transaction", new NoArgSQLFunction("current_update_transaction", NHibernateUtil.Int64));
454454
RegisterFunction("current_user", new NoArgSQLFunction("current_user", NHibernateUtil.String, false));
455455
RegisterFunction("current_utcdate", new NoArgSQLFunction("current_utcdate", NHibernateUtil.DateTime, false));
456456
RegisterFunction("current_utctime", new NoArgSQLFunction("current_utctime", NHibernateUtil.DateTime, false));
457-
RegisterFunction("current_utctimestamp", new NoArgSQLFunction("current_utctimestamp", NHibernateUtil.DateTime, false));
457+
RegisterFunction("current_utctimestamp", new NoArgSQLFunction("current_utctimestamp", NHibernateUtil.UtcDateTime, false));
458458
RegisterFunction("dayname", new StandardSQLFunction("dayname", NHibernateUtil.String));
459459
RegisterFunction("dayofmonth", new StandardSQLFunction("dayofmonth", NHibernateUtil.Int32));
460460
RegisterFunction("dayofyear", new StandardSQLFunction("dayofyear", NHibernateUtil.Int32));

src/NHibernate/Dialect/InformixDialect.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public InformixDialect()
7878
// RegisterFunction("cast", new CastFunction());
7979
// RegisterFunction("concat", new VarArgsSQLFunction(NHibernateUtil.String, "(", "||", ")"));
8080

81-
RegisterFunction("current_timestamp", new NoArgSQLFunction("current", NHibernateUtil.DateTime, false));
82-
RegisterFunction("current_date", new NoArgSQLFunction("today", NHibernateUtil.DateTime, false));
81+
RegisterFunction("current_timestamp", new NoArgSQLFunction("current", NHibernateUtil.LocalDateTime, false));
82+
RegisterFunction("current_date", new NoArgSQLFunction("today", NHibernateUtil.LocalDate, false));
8383
RegisterFunction("sysdate", new NoArgSQLFunction("today", NHibernateUtil.DateTime, false));
8484
RegisterFunction("current", new NoArgSQLFunction("current", NHibernateUtil.DateTime, false));
8585
RegisterFunction("today", new NoArgSQLFunction("today", NHibernateUtil.DateTime, false));

src/NHibernate/Dialect/MsSql2000Dialect.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,9 @@ protected virtual void RegisterFunctions()
328328
RegisterFunction("right", new SQLFunctionTemplate(NHibernateUtil.String, "right(?1, ?2)"));
329329
RegisterFunction("locate", new StandardSQLFunction("charindex", NHibernateUtil.Int32));
330330

331-
RegisterFunction("current_timestamp", new NoArgSQLFunction("getdate", NHibernateUtil.DateTime, true));
332-
RegisterFunction("current_date", new SQLFunctionTemplate(NHibernateUtil.Date, "dateadd(dd, 0, datediff(dd, 0, getdate()))"));
333-
RegisterFunction("current_utctimestamp", new NoArgSQLFunction("getutcdate", NHibernateUtil.DateTime, true));
331+
RegisterFunction("current_timestamp", new NoArgSQLFunction("getdate", NHibernateUtil.LocalDateTime, true));
332+
RegisterFunction("current_date", new SQLFunctionTemplate(NHibernateUtil.LocalDate, "dateadd(dd, 0, datediff(dd, 0, getdate()))"));
333+
RegisterFunction("current_utctimestamp", new NoArgSQLFunction("getutcdate", NHibernateUtil.UtcDateTime, true));
334334
RegisterFunction("second", new SQLFunctionTemplate(NHibernateUtil.Int32, "datepart(second, ?1)"));
335335
RegisterFunction("minute", new SQLFunctionTemplate(NHibernateUtil.Int32, "datepart(minute, ?1)"));
336336
RegisterFunction("hour", new SQLFunctionTemplate(NHibernateUtil.Int32, "datepart(hour, ?1)"));

src/NHibernate/Dialect/MsSql2008Dialect.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ protected override void RegisterFunctions()
5151
{
5252
RegisterFunction(
5353
"current_timestamp",
54-
new NoArgSQLFunction("sysdatetime", NHibernateUtil.DateTime, true));
54+
new NoArgSQLFunction("sysdatetime", NHibernateUtil.LocalDateTime, true));
5555
RegisterFunction(
5656
"current_utctimestamp",
57-
new NoArgSQLFunction("sysutcdatetime", NHibernateUtil.DateTime, true));
57+
new NoArgSQLFunction("sysutcdatetime", NHibernateUtil.UtcDateTime, true));
5858
}
5959

60-
RegisterFunction("current_date", new SQLFunctionTemplate(NHibernateUtil.Date, "cast(getdate() as date)"));
60+
RegisterFunction("current_date", new SQLFunctionTemplate(NHibernateUtil.LocalDate, "cast(getdate() as date)"));
6161
RegisterFunction(
6262
"current_timestamp_offset",
6363
new NoArgSQLFunction("sysdatetimeoffset", NHibernateUtil.DateTimeOffset, true));

src/NHibernate/Dialect/MsSqlCeDialect.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ protected virtual void RegisterFunctions()
172172
RegisterFunction("str", new SQLFunctionTemplate(NHibernateUtil.String, "cast(?1 as nvarchar)"));
173173
RegisterFunction("strguid", new SQLFunctionTemplate(NHibernateUtil.String, "cast(?1 as nvarchar)"));
174174

175-
RegisterFunction("current_timestamp", new NoArgSQLFunction("getdate", NHibernateUtil.DateTime, true));
176-
RegisterFunction("current_date", new SQLFunctionTemplate(NHibernateUtil.Date, "dateadd(dd, 0, datediff(dd, 0, getdate()))"));
175+
RegisterFunction("current_timestamp", new NoArgSQLFunction("getdate", NHibernateUtil.LocalDateTime, true));
176+
RegisterFunction("current_date", new SQLFunctionTemplate(NHibernateUtil.LocalDate, "dateadd(dd, 0, datediff(dd, 0, getdate()))"));
177177
RegisterFunction("date", new SQLFunctionTemplate(NHibernateUtil.DateTime, "dateadd(dd, 0, datediff(dd, 0, ?1))"));
178178
RegisterFunction("second", new SQLFunctionTemplate(NHibernateUtil.Int32, "datepart(second, ?1)"));
179179
RegisterFunction("minute", new SQLFunctionTemplate(NHibernateUtil.Int32, "datepart(minute, ?1)"));

src/NHibernate/Dialect/MySQL55Dialect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ protected override void RegisterFunctions()
1515
{
1616
base.RegisterFunctions();
1717

18-
RegisterFunction("current_utctimestamp", new NoArgSQLFunction("UTC_TIMESTAMP", NHibernateUtil.DateTime, true));
18+
RegisterFunction("current_utctimestamp", new NoArgSQLFunction("UTC_TIMESTAMP", NHibernateUtil.UtcDateTime, true));
1919
}
2020
}
2121
}

src/NHibernate/Dialect/MySQLDialect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ protected virtual void RegisterFunctions()
295295
RegisterFunction("hex", new StandardSQLFunction("hex", NHibernateUtil.String));
296296
RegisterFunction("soundex", new StandardSQLFunction("soundex", NHibernateUtil.String));
297297

298-
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.Date, false));
298+
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.LocalDate, false));
299299
RegisterFunction("current_time", new NoArgSQLFunction("current_time", NHibernateUtil.Time, false));
300300

301301
RegisterFunction("second", new StandardSQLFunction("second", NHibernateUtil.Int32));

src/NHibernate/Dialect/Oracle8iDialect.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ protected virtual void RegisterFunctions()
252252

253253
// In Oracle, date includes a time, just with fractional seconds dropped. For actually only having
254254
// the date, it must be truncated. Otherwise comparisons may yield unexpected results.
255-
RegisterFunction("current_date", new SQLFunctionTemplate(NHibernateUtil.Date, "trunc(current_date)"));
255+
RegisterFunction("current_date", new SQLFunctionTemplate(NHibernateUtil.LocalDate, "trunc(current_date)"));
256256
RegisterFunction("current_time", new NoArgSQLFunction("current_timestamp", NHibernateUtil.Time, false));
257257
RegisterFunction("current_timestamp", new CurrentTimeStamp());
258258

@@ -570,7 +570,7 @@ public override bool SupportsExistsInSelect
570570
[Serializable]
571571
private class CurrentTimeStamp : NoArgSQLFunction
572572
{
573-
public CurrentTimeStamp() : base("current_timestamp", NHibernateUtil.DateTime, true) {}
573+
public CurrentTimeStamp() : base("current_timestamp", NHibernateUtil.LocalDateTime, true) {}
574574

575575
public override SqlString Render(IList args, ISessionFactoryImplementor factory)
576576
{

src/NHibernate/Dialect/Oracle9iDialect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected override void RegisterFunctions()
4848

4949
RegisterFunction(
5050
"current_utctimestamp",
51-
new SQLFunctionTemplate(NHibernateUtil.DateTime, "SYS_EXTRACT_UTC(current_timestamp)"));
51+
new SQLFunctionTemplate(NHibernateUtil.UtcDateTime, "SYS_EXTRACT_UTC(current_timestamp)"));
5252
}
5353

5454
public override long TimestampResolutionInTicks => 1;

src/NHibernate/Dialect/PostgreSQL81Dialect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected override void RegisterDateTimeTypeMappings()
4545
// timezone seems not available prior to version 8.0
4646
RegisterFunction(
4747
"current_utctimestamp",
48-
new SQLFunctionTemplate(NHibernateUtil.DateTime, "timezone('UTC', current_timestamp)"));
48+
new SQLFunctionTemplate(NHibernateUtil.UtcDateTime, "timezone('UTC', current_timestamp)"));
4949
}
5050

5151
public override string ForUpdateNowaitString

src/NHibernate/Dialect/PostgreSQLDialect.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public PostgreSQLDialect()
6060
RegisterColumnType(DbType.String, 1073741823, "text");
6161

6262
// Override standard HQL function
63-
RegisterFunction("current_timestamp", new NoArgSQLFunction("now", NHibernateUtil.DateTime, true));
63+
RegisterFunction("current_timestamp", new NoArgSQLFunction("now", NHibernateUtil.LocalDateTime, true));
6464
RegisterFunction("str", new SQLFunctionTemplate(NHibernateUtil.String, "cast(?1 as varchar)"));
6565
RegisterFunction("locate", new PositionSubstringFunction());
6666
RegisterFunction("iif", new SQLFunctionTemplate(null, "case when ?1 then ?2 else ?3 end"));
@@ -94,7 +94,7 @@ public PostgreSQLDialect()
9494

9595
// Register the date function, since when used in LINQ select clauses, NH must know the data type.
9696
RegisterFunction("date", new SQLFunctionTemplate(NHibernateUtil.Date, "cast(?1 as date)"));
97-
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.Date, false));
97+
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.LocalDate, false));
9898

9999
RegisterFunction("strguid", new SQLFunctionTemplate(NHibernateUtil.String, "?1::TEXT"));
100100

src/NHibernate/Dialect/SQLiteDialect.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ protected virtual void RegisterFunctions()
7676
RegisterFunction("month", new SQLFunctionTemplate(NHibernateUtil.Int32, "cast(strftime('%m', ?1) as int)"));
7777
RegisterFunction("year", new SQLFunctionTemplate(NHibernateUtil.Int32, "cast(strftime('%Y', ?1) as int)"));
7878
// Uses local time like MSSQL and PostgreSQL.
79-
RegisterFunction("current_timestamp", new SQLFunctionTemplate(NHibernateUtil.DateTime, "datetime(current_timestamp, 'localtime')"));
80-
RegisterFunction("current_utctimestamp", new SQLFunctionTemplate(NHibernateUtil.DateTime, "datetime(current_timestamp)"));
79+
RegisterFunction("current_timestamp", new SQLFunctionTemplate(NHibernateUtil.LocalDateTime, "datetime(current_timestamp, 'localtime')"));
80+
RegisterFunction("current_utctimestamp", new SQLFunctionTemplate(NHibernateUtil.UtcDateTime, "datetime(current_timestamp)"));
8181
// The System.Data.SQLite driver stores both Date and DateTime as 'YYYY-MM-DD HH:MM:SS'
8282
// The SQLite date() function returns YYYY-MM-DD, which unfortunately SQLite does not consider
8383
// as equal to 'YYYY-MM-DD 00:00:00'. Because of this, it is best to return the
@@ -86,7 +86,7 @@ protected virtual void RegisterFunctions()
8686
// SQLite has current_date, but as current_timestamp, it is in UTC. So converting the timestamp to
8787
// localtime then to date then, like the above date function, go back to datetime format for comparisons
8888
// sake.
89-
RegisterFunction("current_date", new SQLFunctionTemplate(NHibernateUtil.Date, "datetime(date(current_timestamp, 'localtime'))"));
89+
RegisterFunction("current_date", new SQLFunctionTemplate(NHibernateUtil.LocalDate, "datetime(date(current_timestamp, 'localtime'))"));
9090

9191
RegisterFunction("substring", new StandardSQLFunction("substr", NHibernateUtil.String));
9292
RegisterFunction("left", new SQLFunctionTemplate(NHibernateUtil.String, "substr(?1,1,?2)"));

src/NHibernate/Dialect/SybaseASA9Dialect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public SybaseASA9Dialect()
7272
//RegisterColumnType(DbType.Xml, "TEXT");
7373

7474
// Override standard HQL function
75-
RegisterFunction("current_timestamp", new StandardSQLFunction("current_timestamp"));
75+
RegisterFunction("current_timestamp", new StandardSQLFunction("current_timestamp", NHibernateUtil.LocalDateTime));
7676
RegisterFunction("length", new StandardSafeSQLFunction("length", NHibernateUtil.String, 1));
7777
RegisterFunction("nullif", new StandardSafeSQLFunction("nullif", 2));
7878
RegisterFunction("lower", new StandardSafeSQLFunction("lower", NHibernateUtil.String, 1));

src/NHibernate/Dialect/SybaseASE15Dialect.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ public SybaseASE15Dialect()
7171
RegisterFunction("concat", new VarArgsSQLFunction(NHibernateUtil.String, "(","+",")"));
7272
RegisterFunction("cos", new StandardSQLFunction("cos", NHibernateUtil.Double));
7373
RegisterFunction("cot", new StandardSQLFunction("cot", NHibernateUtil.Double));
74-
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.Date));
74+
RegisterFunction("current_date", new NoArgSQLFunction("current_date", NHibernateUtil.LocalDate));
7575
RegisterFunction("current_time", new NoArgSQLFunction("current_time", NHibernateUtil.Time));
76-
RegisterFunction("current_timestamp", new NoArgSQLFunction("getdate", NHibernateUtil.DateTime));
77-
RegisterFunction("current_utctimestamp", new NoArgSQLFunction("getutcdate", NHibernateUtil.DateTime));
76+
RegisterFunction("current_timestamp", new NoArgSQLFunction("getdate", NHibernateUtil.LocalDateTime));
77+
RegisterFunction("current_utctimestamp", new NoArgSQLFunction("getutcdate", NHibernateUtil.UtcDateTime));
7878
RegisterFunction("datename", new StandardSQLFunction("datename", NHibernateUtil.String));
7979
RegisterFunction("day", new StandardSQLFunction("day", NHibernateUtil.Int32));
8080
RegisterFunction("degrees", new StandardSQLFunction("degrees", NHibernateUtil.Double));

0 commit comments

Comments
 (0)