Skip to content

Commit d024f67

Browse files
committed
Small changes
renames and summaries, also fixed wrong logic of property and its use
1 parent c81bed2 commit d024f67

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Orm/Xtensive.Orm.PostgreSql/Orm.Providers.PostgreSql/DomainHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public class DomainHandler : Providers.DomainHandler
2121
/// <summary>
2222
/// <see langword="true"/> if storage can trim insignificant zeros in numeric values
2323
/// </summary>
24-
protected bool HasNativeTrimOfInsignificantDecimalPoints =>
25-
Handlers.ProviderInfo.StorageVersion.Major < 13;
24+
protected bool HasNativeTrimOfInsignificantZerosInDecimals =>
25+
Handlers.ProviderInfo.StorageVersion.Major >= 13;
2626

2727
/// <inheritdoc/>
2828
protected override ICompiler CreateCompiler(CompilerConfiguration configuration) =>
@@ -31,7 +31,7 @@ protected override ICompiler CreateCompiler(CompilerConfiguration configuration)
3131
/// <inheritdoc/>
3232
protected override IPreCompiler CreatePreCompiler(CompilerConfiguration configuration)
3333
{
34-
if (HasNativeTrimOfInsignificantDecimalPoints) {
34+
if (!HasNativeTrimOfInsignificantZerosInDecimals) {
3535
var decimalAggregateCorrector = new AggregateOverDecimalColumnCorrector(Handlers.Domain.Model);
3636
return new CompositePreCompiler(decimalAggregateCorrector, base.CreatePreCompiler(configuration));
3737
}

Orm/Xtensive.Orm.PostgreSql/Orm.Providers.PostgreSql/PostgresqlSqlDml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Xtensive.Orm.Providers.PostgreSql
1818
public class PostgresqlSqlDml
1919
{
2020
/// <summary>
21-
/// Creates expression for native "trim_scale" function call. The function is supported starting from PostgreSQL 13
21+
/// Creates an expression for native "trim_scale" function call. The function is supported starting from PostgreSQL 13
2222
/// </summary>
2323
public static SqlExpression DecimalTrimScale(SqlExpression operand)
2424
{

Orm/Xtensive.Orm.PostgreSql/Orm.Providers.PostgreSql/SqlCompiler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal class SqlCompiler : Providers.SqlCompiler
2121
{
2222
private const int MaxDotnetDecimalPrecision = 28;
2323

24-
private readonly bool canRemoveInsignificantZerosInDecimal;
24+
private readonly bool canRemoveInsignificantZerosInDecimals;
2525

2626
protected override SqlProvider VisitFreeText(FreeTextProvider provider)
2727
{
@@ -63,7 +63,7 @@ protected override SqlExpression ProcessAggregate(SqlProvider source, List<SqlEx
6363
var aggregateType = aggregateColumn.AggregateType;
6464
var originCalculateColumn = source.Origin.Header.Columns[aggregateColumn.SourceIndex];
6565
if (AggregateRequiresDecimalAdjustments(aggregateColumn)) {
66-
if (canRemoveInsignificantZerosInDecimal) {
66+
if (canRemoveInsignificantZerosInDecimals) {
6767
return (IsCalculatedColumn(originCalculateColumn))
6868
? PostgresqlSqlDml.DecimalTrimScale(SqlDml.Cast(result, Driver.MapValueType(aggregateColumn.Type)))
6969
: PostgresqlSqlDml.DecimalTrimScale(result);
@@ -145,7 +145,7 @@ AggregateType.Min or
145145
public SqlCompiler(HandlerAccessor handlers, CompilerConfiguration configuration)
146146
: base(handlers, configuration)
147147
{
148-
canRemoveInsignificantZerosInDecimal = handlers.ProviderInfo.StorageVersion.Major >= 13;
148+
canRemoveInsignificantZerosInDecimals = handlers.ProviderInfo.StorageVersion.Major >= 13;
149149
}
150150
}
151151
}

0 commit comments

Comments
 (0)