Skip to content

Commit a31aa84

Browse files
alex-kulakovSergeiPavlovshuruev
authored
Resolve conflicts to current DO master (#126)
* Add support of DateOnly/TimeOnly types Fix formatting Fix tests * Some refactoring * Update Orm/Xtensive.Orm.SqlServer/Sql.Drivers.SqlServer/v09/ServerInfoProvider.cs Co-authored-by: Oleg Shuruev <shuruev@gmail.com> * Code style * use is null * node.Arguments * Update Orm/Xtensive.Orm.SqlServer/Sql.Drivers.SqlServer/v10/ServerInfoProvider.cs Co-authored-by: Oleg Shuruev <shuruev@gmail.com> * Move TimeOnly and DateOnly compilers to separate files * Replace DO_DATEONLY with NET6_0_OR_GREATER temporary keep previous compilation variable as comment * No env var DO_DATEONLY support * Add implicit conversion of DateOnly/TimeOnly to SqlExpression * SqlDml level changes - new SqlDml Methods for Time and Date - rename DateOnlyXxx and TimeOnlyXxx to DateXxx and TimeXxx to be related to with SQL - new SqlFunctionTypes & SqlNodeTypes * Add Sql-level tests for DateOnly and TimeOnly * SqlType: Fix compilation error for NET5 * Define DataTypeInfo for DateOnly/TimeOnlySupport for various providers * Add base test class for tests of schema extraction * Replace old MSSQLExtractor-based test with one class based on ExtractorTestBase * Firebird: Fixed FK actions extraction * ExtractorTest for Firebird * MSSQLExtractorTest: Use line by line script * ExtractorTest for MySQL * ExtractorTest for Sqlite * PgSql: extrator tests * Oracle: Extractor test * Fix typo in class name * PgSql: Full-text Index extraction text * MySQL extraction imrovements - add extraction of date and time equivalents - extract both ON UPDATE and ON DELETE actions of Foreign Keys - ordinal comparer applied on string comparisons * Oracle schema extraction imrpovements - add support for time and date equivalent types - ordinal string comparison * Sqlite : add time and date as data types * Sqlite schema extractor improvements - both foreign key actions are extracted - ordinal string comparison applied * DataTypeCollection: Adding provider specific types fix - no double IsLocked check - custom types and they native name alternatives are added to collections properly * Fixed wrong name of type members' compiler * Raw tests for DateOnly/TimeOnly fields/values within Linq * Register DateOnly/Time only member compilers * Add DateOnly/TimeOnly as supported types for Min/Max ops * TimeOnlyCompilers updated - correct namespace for compilers type - correct names for compiler methods - removed datetime operators which were accidentally added - "Add" method compiler, not implemented yet - "Ticks" property compiler, not implemented yet * DateOnlyCompilers updated - correct namespace for compilers type - correct names for compiler methods - DayOfWeek compiler implementation * DateTime/DateOnly/TimeOnly ctor usage within LINQ tests * TimeOnly ctors compilers list updated * SqlDml: Add DateConstruct/TimeConstruct methods * SqlServer: add support for DateConstruct/TimeConstruct additionally, improved datetime/date/time construction for versions since v11 by using built-in functions * Firebird: DateConstruct/TimeConstruct support * MySQL: Add DateConstruct/TimeConstruct functions support - updated Nuget package of client library to one that has native reading/binding of DateOnly and TimeOnly values - when placeholder is of TimeOnly type then it is wrapped by sql function TIME(), MySQL has some issues with values passed via parameter, even if DbType of DbParameter is set correctly. - 5.6 and above uses built-in fuction MAKETIME instead of general approach, should be faster * Oracle: Add DateConstruct/TimeConstruct functions support Additionally, changed type mapping of Interval type from 'interval day to second' to 'inteval day(2) to second(6)' which are equivalents but the last one shows precisions explicitly * PgSQL: Add support for DateConstruct/TimeConstruct functions * Sqlite: Support for DateConstruct/TimeConstruct Also, reading/writing of DateOnly/TimeOnly values done correctly * SqlExtract changes - Dedicated SqlXxxParts for time and date - SqlExtract node stores the widest enum - SqlDateTimeOffsetPart, other enums share the same values of parts so it is fast-convertible from storable enum and to it, to track actual types of argument (date, time, datetime, datetimeoffset, interval) there is a marker, added some calculated properties which could improve code on translation - SqlDml has overloads with SqlTimePart/SqlDatePart, which is more reliable and error-proof than using SqlDateTimePart, SqlDateTimePart can't even be validated to prevent bad sql * TimeOnly and DateOnly compilers use their own SqlDml.Extract() * Support for DateOnly/TimeOnly parts extraction Ticks part is not supported yet. MySQL: - time for mysql 5.5 and below does not support fractions of second, precision declaration works from 5.6. - changes extraction of milliseconds (seems to be working, on tests but some issues might appear) * Reminder of certain particularity of using SqlFunctionType * Several tests fixed, one kept ignored just in case Net6 version works though * Compilers use dedicated SqlDml methods for Date and Time * Date/Time operations support AddXxx() methods, operators, .ToString() support - for SQLite: fixed reading of DateOnly/TimeOnly values from DbDataReader - for MySQL: return default reading from DbDataReader - other minor changes(formatting, copyright, etc.) * DateOnly/TimeOnly-related tests for Linq improved * Mysql: Fix time extraction * Make server side timezone available for tests * Test for data conversion on Schema upgrade * ExpressionProcessor: additional cast to date/time in case of SQLite * TimeOny/DateOnly parameters formatting for human readable string * Functions to convert betwee Date/Time/DateTime/DateTimeOffset * SqlActionTranslator uses new data conversion functions * Conversions of date/time/datetime/datetimeoffset values * Fix DateTypeCollection.Add copy of fix in master * Removed unused code * Ignore Sqlite in certain tests * Sqlite: time resolution increased * Remove TimeOnly/DateOnly reading from test The test is not suppose to be about DateOnly/TimeOnly Such tests will be created where other types are checked * Upgrade to SqlClient 5.1.0 with DateOnly/TimeOnly support * TestHelper: DateTime precision workarouds for Oracle/Mysql * Update StorageProviderVersion with new items * Test for DateTime and TimeOnly values with microseconds * Tests for default values and type compatibility * Field default values of DateOnly/TimeOnly support * Oracle: Fix wrong interval usage * Increased precision of time for Firebird and Oracle * Mysql: Fix wrong type of value range for DateOnly * Mysql: Change time parameters usage in queries * Fixed some sql tests for PostgreSQL * PgSQL: Make_timestamp with integer hour and minute * DateTime/TimeOnly values adjusting for test purposes changed * Some tricky operations with datetime fractions changed Only tests affected * Remove DO_DATEONLY mark and other minor changes * TimeOnlyCompilers: No compiler for TimeOnly.Ticks * Improve changlog * Override Bind/Read in SqlServer's TypeMapper only * Fix formatting * Improve changlog * Put Read methods to correct place within class * Improve changelog * Bump version to 7.1.0 RC * Revert "Bump version to 7.1.0 RC" This reverts commit c7ea23c. * Keep Microsoft.Data.SqlClient v5.0.0 for net5 v5.1.0 requires System.Configuration.ConfigurationManager of version 6.0.1 and newer * Bump version to 7.1.0 RC * Change version to next developing * Create changelog for developing version * Add tests for TimeOnly(ticks) ctor * SqlDml : add TimeConstruct method with ticks as parameter and use it in TimeOnlyCompilers * MSSQL: TimeConstruct with ticks * SQLite: Support for TimeOnly(ticks) ctor * PgSQL: Support for new TimeOnly(ticks) * SqlDml: Literals for DateOnly and TimeOnly * Move IsTimeSpanTicks to SqlHelper * Oracle: Support for TimeOnly(ticks) ctor * MySQL: Support for TimeOnly(ticks) ctor * Firebird: support for TimeOnly(ticks) * SqlDml.TimeToNanoseconds added * Off-topic: Replace ArgumentValidator checks with built-in * Test for the issue * Add support for DefaultExpressions in expression visitors * Improve changelog * No session activation in ToTransactional extension It is in use only in EntitySetBase to get entities. After this activations are completely up to user in his code. * Update test to not expect any of activations from EntitySet * TimeOnly.Ticks support * Firebird: TimeOnly construction with hours overflow check * Oracle: TimeOnly construction with hours overflow check + Interval type has correct natilve type association (was already in use, see v11.Translator) * PostgreSql: TimeOnly construction with hours overflow check * PostgreSql: TimeOnly construction with hours overflow check * TimeOnlys.ConstructorTest: Add hours overflow test * Mysql: No support for TimeConstruct operation There is no way to control hours overflow, Even MAKETIME function returns NULL or max value if value is incorrect, this opens way to possibly corrupted query results which is bad * SQLite: No support for TimeConstruct There is no way to control hours overflow, STRFTIME returns NULL if value is incorrect, this opens way to possibly corrupted query results which is bad. * TimeOnlys.ConstructTest: Mysql and Sqlite are ignored * SqlTests: added test for SqlDml.TimeConstruct(ticks) + ignored SQLite and MySQL in test for second variant of TimeConstruct * Improve changelog * Remove double check * Copyright of files updated * Improve changelog * Bump version to 7.1.0 Final * Updated version to 7.2.0-Beta-1 in development * Created changelog --------- Co-authored-by: Sergei Pavlov <spavlov@servicetitan.com> Co-authored-by: Oleg Shuruev <shuruev@gmail.com>
1 parent bd1a93f commit a31aa84

166 files changed

Lines changed: 9083 additions & 2372 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/7.1.0-RC-dev.txt

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

ChangeLog/7.1.0-RC.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[main] Add support for new .NET 6 DateOnly and TimeOnly types
2+
[main] Updated BitFaster.Caching package reference to v2.0.0
3+
[main] Fixed ColumnInfoCollection leakage on building indexes
4+
[sqlserver] Updated Microsoft.Data.SqlClient package references to v5.0.0 and v6.0.1

ChangeLog/7.1.0-Z_Final.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[main] Added support for DefaultExpression within Linq queries
2+
[main] Support for TimeOnly ctors (time parts and ticks) in Linq, except for SQLite and MySQL providers
3+
[main] No Session.Activate() in ToTransactional extension, it affects EntitySet<T> enumeration.

ChangeLog/7.2.0-Beta-1-dev.txt

Whitespace-only changes.

Extensions/TestCommon/TestCommon.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1313
</ItemGroup>
1414
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
15-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
15+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.1" />
1616
</ItemGroup>
1717
<ItemGroup>
1818
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />

Extensions/Xtensive.Orm.BulkOperations/Internals/ExpressionVisitor.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// Copyright (C) 2019-2020 Xtensive LLC.
1+
// Copyright (C) 2019-2023 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44

55
using System;
66
using System.Collections.Generic;
77
using System.Collections.ObjectModel;
88
using System.Linq.Expressions;
9+
using Xtensive.Core;
910
using Xtensive.Linq;
1011

1112
namespace Xtensive.Orm.BulkOperations
@@ -95,6 +96,8 @@ protected virtual Expression Visit(Expression exp)
9596
return VisitConditional((ConditionalExpression) exp);
9697
case ExpressionType.Constant:
9798
return VisitConstant((ConstantExpression) exp);
99+
case ExpressionType.Default:
100+
return VisitDefault((DefaultExpression) exp);
98101
case ExpressionType.Parameter:
99102
return VisitParameter((ParameterExpression) exp);
100103
case ExpressionType.MemberAccess:
@@ -180,6 +183,11 @@ private Expression VisitConstant(ConstantExpression c)
180183
return c;
181184
}
182185

186+
private Expression VisitDefault(DefaultExpression d)
187+
{
188+
return d.ToConstantExpression();
189+
}
190+
183191
private ElementInit VisitElementInitializer(ElementInit initializer)
184192
{
185193
IEnumerable<Expression> arguments = VisitExpressionList(initializer.Arguments);

Extensions/Xtensive.Orm.Reprocessing/Xtensive.Orm.Reprocessing.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1717
</ItemGroup>
1818
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
19-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
19+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.1" />
2020
</ItemGroup>
2121
<ItemGroup>
2222
<None Include="Readme.txt" />

Extensions/Xtensive.Orm.Security/Xtensive.Orm.Security.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1818
</ItemGroup>
1919
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
20-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
20+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.1" />
2121
</ItemGroup>
2222
<ItemGroup>
2323
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />

Extensions/Xtensive.Orm.Tracking/Xtensive.Orm.Tracking.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1717
</ItemGroup>
1818
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
19-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
19+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.1" />
2020
</ItemGroup>
2121
<ItemGroup>
2222
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />

Extensions/Xtensive.Orm.Web/Xtensive.Orm.Web.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
2020
</ItemGroup>
2121
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
22-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
22+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.1" />
2323
</ItemGroup>
2424
<ItemGroup>
2525
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />

0 commit comments

Comments
 (0)