Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ private static BigInteger GetUserHash(string user, string password, byte[] salt)

private static BigInteger BigIntegerFromByteArray(byte[] b)
{
return new BigInteger(b.Reverse().Concat(new byte[] { 0 }).ToArray());
return new BigInteger(b.AsEnumerable().Reverse().Concat(new byte[] { 0 }).ToArray());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an unrelated change that should be removed.

}

private static byte[] BigIntegerToByteArray(BigInteger n)
{
return n.ToByteArray().Reverse().SkipWhile((e, i) => i == 0 && e == 0).ToArray();
return n.ToByteArray().AsEnumerable().Reverse().SkipWhile((e, i) => i == 0 && e == 0).ToArray();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an unrelated change that should be removed.

}

private static byte[] ComputeSHA1Hash(params byte[][] ba)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ public NorthwindJoinQueryFbTest(NorthwindQueryFbFixture<NoopModelCustomizer> fix
: base(fixture)
{ }

[NotSupportedOnFirebirdTheory]
[Theory]
[MemberData(nameof(IsAsyncData))]
public override Task GroupJoin_as_final_operator(bool async)
{
return base.GroupJoin_as_final_operator(async);
}

[NotSupportedOnFirebirdTheory]
[Theory]
[MemberData(nameof(IsAsyncData))]
public override Task GroupJoin_SelectMany_subquery_with_filter_orderby(bool async)
{
return base.GroupJoin_SelectMany_subquery_with_filter_orderby(async);
}

[NotSupportedOnFirebirdTheory]
[Theory]
[MemberData(nameof(IsAsyncData))]
public override Task GroupJoin_SelectMany_subquery_with_filter_orderby_and_DefaultIfEmpty(bool async)
{
Expand Down Expand Up @@ -99,14 +99,14 @@ public override Task Take_in_collection_projection_with_FirstOrDefault_on_top_le
return base.Take_in_collection_projection_with_FirstOrDefault_on_top_level(async);
}

[NotSupportedOnFirebirdTheory]
[Theory]
[MemberData(nameof(IsAsyncData))]
public override Task Unflattened_GroupJoin_composed(bool async)
{
return base.Unflattened_GroupJoin_composed(async);
}

[NotSupportedOnFirebirdTheory]
[Theory]
[MemberData(nameof(IsAsyncData))]
public override Task Unflattened_GroupJoin_composed_2(bool async)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public override void Udf_with_argument_being_comparison_of_nullable_columns()
base.Udf_with_argument_being_comparison_of_nullable_columns();
}

[NotSupportedOnFirebirdFact]
[Fact]
public override void QF_Select_Correlated_Subquery_In_Anonymous_MultipleCollections()
{
base.QF_Select_Correlated_Subquery_In_Anonymous_MultipleCollections();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ protected override Expression VisitSqlConstant(SqlConstantExpression sqlConstant
base.VisitSqlConstant(sqlConstantExpression);
if (shouldExplicitStringLiteralTypes)
{
var isUnicode = FbTypeMappingSource.IsUnicode(sqlConstantExpression.TypeMapping);
var isUnicode = FbTypeMappingSource.IsUnicode(sqlConstantExpression.TypeMapping);
Sql.Append(" AS ");
Sql.Append(((IFbSqlGenerationHelper)Dependencies.SqlGenerationHelper).StringLiteralQueryType(sqlConstantExpression.Value as string, isUnicode));
Sql.Append(")");
Expand Down Expand Up @@ -280,6 +280,60 @@ protected override void GenerateOrderings(SelectExpression selectExpression)
}
}

// Adapted from Npgsql Entity Framework Core provider
// (https://github.com/npgsql/efcore.pg)
// Copyright (c) 2002-2021, Npgsql
protected override Expression VisitCrossApply(CrossApplyExpression crossApplyExpression)
{
Sql.Append("JOIN LATERAL ");

if (crossApplyExpression.Table is TableExpression table)
{
// Firebird doesn't support LATERAL JOIN over table, and it doesn't really make sense to do it - but EF Core
// will sometimes generate that.
Sql
.Append("(SELECT * FROM ")
.Append(Dependencies.SqlGenerationHelper.DelimitIdentifier(table.Name, table.Schema))
.Append(")")
.Append(AliasSeparator)
.Append(Dependencies.SqlGenerationHelper.DelimitIdentifier(table.Alias));
}
else
{
Visit(crossApplyExpression.Table);
}

Sql.Append(" ON TRUE");
return crossApplyExpression;
}

// Adapted from Npgsql Entity Framework Core provider
// (https://github.com/npgsql/efcore.pg)
// Copyright (c) 2002-2021, Npgsql
protected override Expression VisitOuterApply(OuterApplyExpression outerApplyExpression)
{
Sql.Append("LEFT JOIN LATERAL ");

if (outerApplyExpression.Table is TableExpression table)
{
// Firebird doesn't support LATERAL JOIN over table, and it doesn't really make sense to do it - but EF Core
// will sometimes generate that.
Sql
.Append("(SELECT * FROM ")
.Append(Dependencies.SqlGenerationHelper.DelimitIdentifier(table.Name, table.Schema))
.Append(")")
.Append(AliasSeparator)
.Append(Dependencies.SqlGenerationHelper.DelimitIdentifier(table.Alias));
}
else
{
Visit(outerApplyExpression.Table);
}

Sql.Append(" ON TRUE");
return outerApplyExpression;
}

protected override void GeneratePseudoFromClause()
{
Sql.Append(" FROM RDB$DATABASE");
Expand Down