Skip to content

Commit 272c622

Browse files
authored
Merge branch 'master-date-and-time-support' into upstream/UpgradeSqlClient
2 parents 6a6ff05 + 192b829 commit 272c622

185 files changed

Lines changed: 1908 additions & 1141 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ChangeLog/6.0.11_Z_Final.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[main] Added an option to remove cached queries of removing storage node along with the node, default behavior remains the same
2+
[postgresql] Dedicated exception when the extracting schema doesn't exist or it belongs to another user
3+
[weaver] Fixed constructor processing with try...catch, catch section now has correct leave

ChangeLog/7.1.0-Beta-2-dev.txt

Lines changed: 0 additions & 31 deletions
This file was deleted.

ChangeLog/7.1.0-Beta-2.txt

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[main] NET6 support
2+
[main] Obsolete CatalogHelper class has been removed
3+
[main] Obsolete ReacreateTableHint has been removed
4+
[main] Obsolete Session.SelectStorageNode() method is removed
5+
[main] Obsolete methods from ArrayExtensions, EnumerableExtensions and QueryableExtensions have been removed
6+
[main] Obsolete DeleteDataHint.PostCopy property has been removed
7+
[main] Obsolete QueryEndpoint's members have been removed
8+
[main] Obsolete Query's members have been removed
9+
[main] Obsolete members of DelayedScalarQuery<T> have been removed
10+
[main] Obsolete FieldInfo.IsDynalicallyDefined property's been removed (FieldInfo.IsDynamicallyDefined is still there)
11+
[main] Changed translation of queries when DomainConfiguration.ShareStorageSchemaOverNodes set to true
12+
[main] StorageDriver.Compile(ISqlCompileUnit, NodeConfiguration) became obsolete
13+
[main] SqlNodeActualizer became obsolete
14+
[main] LockableExtensions.EnsureNotLocked() became obsolete, implementation moved to LockableBase directly
15+
[main] TypeInfoCollection.FindAncestor method became obsolete, use new TypeInfo.Ancestor property
16+
[main] TypeInfoCollection.FindDescendants methods became obsolete, use new TypeInfo.DirectDescendants/.AllDescendants properties
17+
[main] TypeInfoCollection.FindInterfaces methods became obsolete, use new TypeInfo.DirectInterfaces/.AllInterfaces properties
18+
[main] TypeInfoCollection.FindImplementors methods became obsolete, use new TypeInfo.DirectImplementors/.AllImplementors properties
19+
[main] TypeInfoCollection.FindRoot method became obsolete, use introduced TypeInfo.Root property
20+
[main] TypeInfo.GetImplementors(bool) became obsolete, use new TypeInfo.DirectImplementors/.AllImplementors properties
21+
[main] TypeInfo.GetInterfaces(bool) became obsolete, use new TypeInfo.DirectInterfaces/.AllInterfaces properties
22+
[main] TypeInfo.GetDescendants(bool) became obsolete, use new TypeInfo.DirectDescendants/.AllDescendants properties
23+
[main] TypeInfo.GetAncestors() became obsolete, use new TypeInfo.Ancestors property
24+
[main] TypeInfo.GetRoot() became obsolete, use introduced TypeInfo.Root property
25+
[main] IPropertyValidator.IsImmediate is read-only now
26+
[main] PropertyValidator.IsImmediate property has no setter, only init
27+
[main] PropertyValidator.ValidateOnlyIfModified property has no setter, only init
28+
[main] PropertyValidator.SkipOnTransactionCommit property has no setter, only init
29+
[main] RecordSetHeader.OrderTupleDescriptor became nullable to compensate TupleDescriptor's transition to read-only structure
30+
[main] IndexInfo.FilterByTypes changed result type to IReadOnlyList<TypeInfo>
31+
[main] IndexInfo.SelectColumns changed result type to IReadOnlyList<int>
32+
[main] IndexInfo.ValueColumnsMap changed result type to IReadOnlyList<Pair<int, List<int>>>
33+
[main] SqlCompilerConfiguration's DatabaseMapping and SchemaMapping moved to SqlPostCompilerConfiguration
34+
[main] Some EventArgs inheritors that were sealed classes transformed to read-only structures
35+
[main] DbCommandEventArgs became read-only structure
36+
[main] LogEventInfo became read-only structure
37+
[main] ILockable.Lock() now has default implementation that refers to ILockable.Lock(true)
38+
[main] TupleDescriptor became read-only structure
39+
[main] InterfaceMapping became read-only structure
40+
[main] ColumnIndexMap became read-only structure and properties changed retun type to IReadOnlyList<int>
41+
[main] TopologicalSorter.Sort() methods return IEnumerable<T>, use .SortToList() if results are needed as collection
42+
[main] TypeHelper.OrderByInheritance() returns IEnumerable<T> to avoid copying
43+
[main] TypeHelper.GetInterfaces() became obsolete, GetInterfacesUnordered() and GetInterfacesOrderedByInheritance() introduced
44+
[main] TypeDef.Validators and FieldDef.Validators properties return List<T>
45+
[main] SqlCustomFunctionCall and SqlFunctionCall share one base type
46+
[main] SqlFunctionCall.Arguments property is IReadOnlyList now and parameters can't be changed after instance creation
47+
[main] Xtensive.Sql.Dml.Extensions.IsNullReference() extension method is marked obsolete, use 'is null' operator instead
48+
[main] DirectSessionAccessor.GetChangedEntities() result type changed to improve enumeration
49+
[main] EntityChangeRegistry.GetItems(PersistenceState) changed result type to improve enumeration
50+
[main] EntitySetChangeRegistry.GetItems() changed result type to improve enumeration
51+
[main] IgnoreRule now has only one public constructor - parameterless
52+
[main] IgnoreRule supports indexes
53+
[main] Queries use parameters instead of constant values for type indentifiers within columns list
54+
[main] Added DomainConfiguration.PreferTypeIdsAsQueryParameters to choose between contants and parameters for TypeIds
55+
[main] ShareStorageSchemaOverNodes option now includes shared query cache when TypeIds as paremters are prefered
56+
[main] Introduced TypeInfo.Ancestor property
57+
[main] Introduced TypeInfo.DirectDescendants and.AllDescendants properties
58+
[main] Introduced TypeInfo.DirectInterfaces and.AllInterfaces properties
59+
[main] Introduced TypeInfo.DirectImplementors .AllImplementors properties
60+
[main] BitFaster.Caching package reference is updated to 1.0.7
61+
[main] No error caused by ambiguity due to new IQueryable extension methods of .Net 6
62+
[main] Improved internal logging speed
63+
[main] General performance and memory efficiency improvements
64+
[reprocessing] DomainBuildErrorEventArgs (not sealed) became read-only structure
65+
[reprocessing] ExecuteErrorEventArgs (not sealed) became read-only structure
66+
[tracking] TrackingCompletedEventArgs (sealed) became read-only structure
67+
[tracking] ITrackingItem ChangedValues property changed return type to IReadOnlyList<ChangedValue>
68+
[tracking] ChangedValue became read-only structure
69+
[Web] Removed Obsolete SessionManager and StartupConfigurationExtension

ChangeLog/7.1.0-RC-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[main] Updated BitFaster.Caching package reference to v2.0.0
2+
[sqlserver] Updated Microsoft.Data.SqlClient package reference to v5.0.0

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ internal static class Constants
1414

1515
// cannot use "FFF" cause it may lead to empty string for fractions part.
1616
public const string DateTimeFormatString = @"''\'yyyy\.MM\.dd HH\:mm\:ss\.fff\'''";
17-
#if NET6_0_OR_GREATER //DO_DATEONLY
17+
#if NET6_0_OR_GREATER
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.Firebird/Sql.Drivers.Firebird/v2_5/Compiler.cs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public override void Visit(SqlBinary node)
176176
case SqlNodeType.DateTimeMinusDateTime:
177177
DateTimeSubtractDateTime(node.Left, node.Right).AcceptVisitor(this);
178178
return;
179-
#if NET6_0_OR_GREATER //DO_DATEONLY
179+
#if NET6_0_OR_GREATER
180180
case SqlNodeType.TimePlusInterval:
181181
TimeAddInterval(node.Left, node.Right).AcceptVisitor(this);
182182
return;
@@ -233,7 +233,7 @@ public override void Visit(SqlFunctionCall node)
233233
arguments[1] - 1),
234234
arguments[2] - 1));
235235
return;
236-
#if NET6_0_OR_GREATER //DO_DATEONLY
236+
#if NET6_0_OR_GREATER
237237
case SqlFunctionType.DateAddYears:
238238
Visit(DateAddYear(arguments[0], arguments[1]));
239239
return;
@@ -308,8 +308,8 @@ protected static SqlExpression DateTimeSubtractDateTime(SqlExpression date1, Sql
308308
(CastToLong(DateDiffMillisecond(DateAddDay(date2, DateDiffDay(date2, date1)), date1)) *
309309
NanosecondsPerMillisecond);
310310
}
311+
#if NET6_0_OR_GREATER
311312

312-
#if NET6_0_OR_GREATER //DO_DATEONLY
313313
protected static SqlExpression TimeSubtractTime(SqlExpression time1, SqlExpression time2)
314314
{
315315
return SqlDml.Modulo(
@@ -368,8 +368,8 @@ protected static SqlUserFunctionCall BitXor(SqlExpression left, SqlExpression ri
368368

369369
protected static SqlUserFunctionCall BitNot(SqlExpression operand) =>
370370
SqlDml.FunctionCall("BIN_NOT", operand);
371+
#if NET6_0_OR_GREATER
371372

372-
#if NET6_0_OR_GREATER //DO_DATEONLY
373373
protected static SqlExpression TimeToDateTime(SqlExpression time) =>
374374
SqlDml.Cast(time, SqlType.DateTime);
375375

@@ -382,15 +382,11 @@ protected static SqlExpression DateToDateTime(SqlExpression date) =>
382382
protected static SqlExpression DateTimeToDate(SqlExpression dateTime) =>
383383
SqlDml.Cast(dateTime, SqlType.Date);
384384

385-
protected static SqlFunctionCall DateToString(SqlExpression date)
386-
{
387-
return SqlDml.Substring(date, 0, 10);;
388-
}
385+
protected static SqlFunctionCall DateToString(SqlExpression date) =>
386+
SqlDml.Substring(date, 0, 10);
389387

390-
protected static SqlConcat TimeToString(SqlExpression time)
391-
{
392-
return SqlDml.Concat(SqlDml.Substring(time, 0, 12), SqlDml.Literal("0000"));
393-
}
388+
protected static SqlConcat TimeToString(SqlExpression time) =>
389+
SqlDml.Concat(SqlDml.Substring(time, 0, 12), SqlDml.Literal("0000"));
394390
#endif
395391

396392
protected static SqlConcat DateTimeToStringIso(SqlExpression dateTime)
@@ -400,7 +396,7 @@ protected static SqlConcat DateTimeToStringIso(SqlExpression dateTime)
400396

401397
return SqlDml.Concat(date, SqlDml.Literal("T"), time);
402398
}
403-
399+
404400
#endregion
405401

406402
protected internal Compiler(SqlDriver driver)

Orm/Xtensive.Orm.Firebird/Sql.Drivers.Firebird/v2_5/ServerInfoProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ public override DataTypeCollection GetDataTypesInfo()
237237

238238
dtc.DateTime = DataTypeInfo.Range(SqlType.DateTime, commonFeatures,
239239
ValueRange.DateTime, "timestamp");
240-
241240
#if NET6_0_OR_GREATER
241+
242242
dtc.DateOnly = DataTypeInfo.Range(SqlType.Date, commonFeatures, ValueRange.DateOnly, "date");
243243
dtc.TimeOnly = DataTypeInfo.Range(SqlType.Time, commonFeatures, ValueRange.TimeOnly, "time");
244244
#endif

Orm/Xtensive.Orm.Firebird/Sql.Drivers.Firebird/v2_5/Translator.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ internal class Translator : SqlTranslator
2121
{
2222
public override string DateTimeFormatString => Constants.DateTimeFormatString;
2323

24-
#if NET6_0_OR_GREATER //DO_DATEONLY
24+
#if NET6_0_OR_GREATER
2525
public override string DateOnlyFormatString => Constants.DateFormatString;
26+
2627
public override string TimeOnlyFormatString => Constants.TimeFormatString;
2728
#endif
2829

@@ -122,7 +123,7 @@ public override void Translate(IOutput output, SqlNodeType type)
122123
case SqlNodeType.Modulo:
123124
_ = output.Append("MOD"); break;
124125
case SqlNodeType.DateTimeMinusDateTime:
125-
#if NET6_0_OR_GREATER //DO_DATEONLY
126+
#if NET6_0_OR_GREATER
126127
case SqlNodeType.TimeMinusTime:
127128
#endif
128129
_ = output.Append("-"); break;
@@ -223,8 +224,8 @@ public override void Translate(IOutput output, SqlDateTimePart dateTimePart)
223224
default: base.Translate(output, dateTimePart); break;
224225
}
225226
}
226-
227227
#if NET6_0_OR_GREATER //DO_DATEONLY
228+
228229
/// <inheritdoc/>
229230
public override void Translate(IOutput output, SqlDatePart datePart)
230231
{

Orm/Xtensive.Orm.MySql/Sql.Drivers.MySql/v5_0/Compiler.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public override void Visit(SqlBinary node)
9494
case SqlNodeType.DateTimeMinusInterval:
9595
DateTimeAddInterval(node.Left, -node.Right).AcceptVisitor(this);
9696
return;
97-
#if NET6_0_OR_GREATER //DO_DATEONLY
97+
#if NET6_0_OR_GREATER
9898
case SqlNodeType.TimePlusInterval:
9999
TimeAddInterval(node.Left, node.Right).AcceptVisitor(this);
100100
return;
@@ -187,7 +187,7 @@ public override void Visit(SqlFunctionCall node)
187187
arguments[1] - 1),
188188
arguments[2] - 1));
189189
return;
190-
#if NET6_0_OR_GREATER //DO_DATEONLY
190+
#if NET6_0_OR_GREATER
191191
case SqlFunctionType.DateAddYears:
192192
Visit(DateAddYear(arguments[0], arguments[1]));
193193
return;
@@ -252,13 +252,12 @@ public override void Visit(SqlFunctionCall node)
252252

253253
base.Visit(node);
254254
}
255+
#if NET6_0_OR_GREATER
255256

256-
#if NET6_0_OR_GREATER //DO_DATEONLY
257257
public override void Visit(SqlPlaceholder node)
258258
{
259-
if (node.Id is Orm.Providers.QueryParameterBinding qpb
260-
&& qpb.BindingType == Orm.Providers.QueryParameterBindingType.Regular
261-
&& qpb.TypeMapping.Type == typeof(TimeOnly)) {
259+
if (node.Id is Orm.Providers.ParameterBinding qpb
260+
&& qpb.TypeMapping?.Type == typeof(TimeOnly)) {
262261
_ = context.Output.Append("TIME(");
263262
base.Visit(node);
264263
_ = context.Output.Append(")");
@@ -293,7 +292,7 @@ public override void Visit(SqlExtract node)
293292
Visit(SqlDml.FunctionCall(node.DateTimePart.ToString(), node.Operand));
294293
return;
295294
}
296-
#if NET6_0_OR_GREATER //DO_DATEONLY
295+
#if NET6_0_OR_GREATER
297296
if (node.DatePart == SqlDatePart.DayOfWeek || node.DatePart == SqlDatePart.DayOfYear) {
298297
Visit(SqlDml.FunctionCall(node.DatePart.ToString(), node.Operand));
299298
return;
@@ -316,8 +315,8 @@ protected virtual SqlExpression DateTimeAddInterval(SqlExpression date, SqlExpre
316315
DateTimeAddDay(date, ((interval - (interval % NanosecondsPerDay)) + ((interval % NanosecondsPerDay) > (NanosecondsPerDay / 2) ? 0 : 1)) / NanosecondsPerDay),
317316
(interval / NanosecondsPerMillisecond * NanosecondsPerMicrosecond) % (MillisecondsPerDay * NanosecondsPerMicrosecond));
318317
}
318+
#if NET6_0_OR_GREATER
319319

320-
#if NET6_0_OR_GREATER //DO_DATEONLY
321320
protected virtual SqlExpression TimeSubtractTime(SqlExpression time1, SqlExpression time2) =>
322321
SqlDml.Modulo(
323322
NanosecondsPerDay + CastToDecimal(SqlDml.FunctionCall("TIME_TO_SEC", time1) - SqlDml.FunctionCall("TIME_TO_SEC", time2), 18, 0) * NanosecondsPerSecond,
@@ -364,8 +363,8 @@ protected static SqlUserFunctionCall DateTimeAddHour(SqlExpression datetime, Sql
364363

365364
protected static SqlUserFunctionCall DateTimeAddMicrosecond(SqlExpression datetime, SqlExpression microseconds) =>
366365
SqlDml.FunctionCall("TIMESTAMPADD", SqlDml.Native("MICROSECOND"), microseconds, datetime);
366+
#if NET6_0_OR_GREATER
367367

368-
#if NET6_0_OR_GREATER //DO_DATEONLY
369368
protected static SqlUserFunctionCall DateAddYear(SqlExpression date, SqlExpression years) =>
370369
SqlDml.FunctionCall("DATE_ADD", date, SqlDml.RawConcat(SqlDml.Native("INTERVAL "), SqlDml.RawConcat(years, SqlDml.Native("YEAR"))));
371370

Orm/Xtensive.Orm.MySql/Sql.Drivers.MySql/v5_0/Extractor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ private SqlValueType CreateValueType(IDataRecord row,
652652
// although they can be read as "scale" and "precision"
653653
return new SqlValueType(SqlType.Int64);
654654
}
655-
#if NET6_0_OR_GREATER //DO_DATEONLY
655+
#if NET6_0_OR_GREATER
656656
if (typeName.Equals("TIME", StringComparison.Ordinal) || typeName.StartsWith("TIME(")) {
657657
return new SqlValueType(SqlType.Time);
658658
}

0 commit comments

Comments
 (0)