Skip to content

Commit 9f8453e

Browse files
committed
Oracle: Fix wrong interval usage
1 parent fd88cce commit 9f8453e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • Orm/Xtensive.Orm.Oracle/Sql.Drivers.Oracle/v09

Orm/Xtensive.Orm.Oracle/Sql.Drivers.Oracle/v09/Compiler.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ internal class Compiler : SqlCompiler
3838

3939
protected const string ToCharFunctionName = "TO_CHAR";
4040
protected const string NumToDSIntervalFunctionName = "NUMTODSINTERVAL";
41+
protected const string NumToYMIntervalFunctionName = "NUMTOYMINTERVAL";
42+
4143
protected const string ToDSIntervalFunctionName = "TO_DSINTERVAL";
4244
protected const string TimeFormat = "HH24:MI:SS.FF6";
4345

@@ -357,7 +359,7 @@ public override void Visit(SqlBinary node)
357359
}
358360

359361
private static SqlExpression DateTimeAddYMInterval(SqlExpression dateTime, SqlExpression units, in string component) =>
360-
dateTime + SqlDml.FunctionCall(NumToDSIntervalFunctionName, units, AnsiString(component));
362+
dateTime + SqlDml.FunctionCall(NumToYMIntervalFunctionName, units, AnsiString(component));
361363

362364
private static SqlExpression DateTimeAddDSInterval(SqlExpression dateTime, SqlExpression units, in string component) =>
363365
dateTime + SqlDml.FunctionCall(NumToDSIntervalFunctionName, units, AnsiString(component));

0 commit comments

Comments
 (0)