Skip to content

Commit 059d798

Browse files
committed
Increased precision of time for Firebird and Oracle
1 parent 9f8453e commit 059d798

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

Orm/Xtensive.Orm.Firebird/Sql.Drivers.Firebird/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal static class Constants
1616
public const string DateTimeFormatString = @"''\'yyyy\.MM\.dd HH\:mm\:ss\.fff\'''";
1717
#if NET6_0_OR_GREATER //DO_DATEONLY
1818
public const string DateFormatString = @"''\'yyyy\.MM\.dd\'''";
19-
public const string TimeFormatString = @"''\'HH\:mm\:ss\.fff\'''";
19+
public const string TimeFormatString = @"''\'HH\:mm\:ss\.ffff\'''";
2020
#endif
2121
}
2222
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ internal class Compiler : SqlCompiler
4141
protected const string NumToYMIntervalFunctionName = "NUMTOYMINTERVAL";
4242

4343
protected const string ToDSIntervalFunctionName = "TO_DSINTERVAL";
44-
protected const string TimeFormat = "HH24:MI:SS.FF6";
44+
protected const string TimeFormat = "HH24:MI:SS.FF7";
4545

4646
private static readonly SqlExpression SundayNumber = SqlDml.Native(
4747
"TO_NUMBER(TO_CHAR(TIMESTAMP '2009-07-26 00:00:00.000', 'D'))");
48-
private static readonly SqlNative RefTimestamp = SqlDml.Native("timestamp '2009-01-01 00:00:00.000000'");
48+
private static readonly SqlNative RefTimestamp = SqlDml.Native("timestamp '2009-01-01 00:00:00.0000000'");
4949

5050
public override void Visit(SqlFunctionCall node)
5151
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public override DataTypeCollection GetDataTypesInfo()
232232
types.DateOnly = DataTypeInfo.Range(SqlType.Date, common | index,
233233
ValueRange.DateOnly, "DATE");
234234
types.TimeOnly = DataTypeInfo.Range(SqlType.Time, common | index,
235-
ValueRange.TimeOnly, "interval day(0) to second(6)");
235+
ValueRange.TimeOnly, "interval day(0) to second(7)");
236236
#endif
237237
types.DateTimeOffset = DataTypeInfo.Range(SqlType.DateTimeOffset, common | index,
238238
ValueRange.DateTimeOffset, "TIMESTAMP WITH TIME ZONE");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ internal class Translator : SqlTranslator
3535
public override string DateOnlyFormatString => @"'(DATE '\'yyyy\-MM\-dd\'\)";
3636

3737
/// <inheritdoc/>
38-
public override string TimeOnlyFormatString => @"'(INTERVAL '\'0 HH\:mm\:ss\.ffffff\'\ DAY(0) TO SECOND(6))";
38+
public override string TimeOnlyFormatString => @"'(INTERVAL '\'0 HH\:mm\:ss\.fffffff\'\ DAY(0) TO SECOND(7))";
3939
#endif
4040

4141
/// <inheritdoc/>
@@ -340,7 +340,7 @@ public override string Translate(SqlValueType type)
340340
return type.Type == SqlType.Interval
341341
? "INTERVAL DAY(6) TO SECOND(3)"
342342
: type.Type == SqlType.Time
343-
? "INTERVAL DAY(0) TO SECOND(6)"
343+
? "INTERVAL DAY(0) TO SECOND(7)"
344344
: base.Translate(type);
345345
#else
346346
// we need to explicitly specify maximum interval precision

Orm/Xtensive.Orm.Oracle/Sql.Drivers.Oracle/v11/Translator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public override string Translate(SqlValueType type)
2626
{
2727
// we need to explicitly specify maximum interval precision
2828
return type.Type == SqlType.Interval
29-
? "INTERVAL DAY(6) TO SECOND(6)"
29+
? "INTERVAL DAY(6) TO SECOND(7)"
3030
: base.Translate(type);
3131
}
3232

0 commit comments

Comments
 (0)