Skip to content

Commit d0fa095

Browse files
authored
Merge branch 'master' into NETProvider-b1
2 parents 1b5afa3 + b141e0a commit d0fa095

195 files changed

Lines changed: 10724 additions & 3115 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.

‎.github/workflows/ci.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ env:
88

99
jobs:
1010
ci:
11-
runs-on: windows-2022
11+
runs-on: windows-2025
1212
strategy:
1313
fail-fast: false
1414
matrix:
@@ -17,12 +17,12 @@ jobs:
1717
timeout-minutes: 120
1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v5
2121

22-
- name: .NET 8.0
23-
uses: actions/setup-dotnet@v4
22+
- name: .NET 10.0
23+
uses: actions/setup-dotnet@v5
2424
with:
25-
dotnet-version: 8.0.x
25+
dotnet-version: 10.0.x
2626

2727
- name: Build
2828
run: |
@@ -51,7 +51,7 @@ jobs:
5151
shell: powershell
5252

5353
- name: Publish Artifacts
54-
uses: actions/upload-artifact@v4
54+
uses: actions/upload-artifact@v7
5555
with:
5656
name: 'ci_${{ matrix.TEST_SUITE }}_${{ matrix.FIREBIRD_SELECTION }}_${{ env.CONFIGURATION }}'
5757
path: '.\\out\\'

‎CONTRIBUTING.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
Thanks for considering contributing. Here are some items to consider before starting (in no particular order).
44

5-
* Check [tracker](https://github.com/FirebirdSQL/NETProvider/issues) if you want to start on something.
6-
* Before you start working on something announce your intention on the mailing list (or in comment in tracker).
5+
* Check [issues](https://github.com/FirebirdSQL/NETProvider/issues) if you want to start on something.
6+
* Before you start working on something announce your intention on the mailing list (or comment on the issue).
77
* Issue only complete PRs (no WIPs).
88
* Make sure your PR doesn't contain unneccessary changes (whitespaces, new lines, ...).
9-
* Consider squashing your commits.
109
* Follow existing code formatting/styling (even for new files).
10+
* Disclose AI usage.
1111
* Make sure you swept all corners (i.e. all build configurations are fine, works with all Firebird version, etc.).
1212
* Make sure your changes merge without conflicts.
1313
* Consider backward compatibility.
1414
* Don't be afraid to ask (i.e. backward compatibility).
1515
* Be prepared to do some changes after your PR is reviewed.
1616
* Consider whether your change is benefit for majority of users (opposite to only a small group).
17-
* All contributions are licensed under [_Initial Developer's Public License_](license.txt).
17+
* All contributions are licensed under [_Initial Developer's Public License_](license.txt).

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* [Downloads](https://github.com/FirebirdSQL/NETProvider/releases)
2727
* [Issue tracker](https://github.com/FirebirdSQL/NETProvider/issues)
2828
* [Development mailing list](https://groups.google.com/forum/#!forum/firebird-net-provider)
29+
* [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/FirebirdSQL/NETProvider)
2930

3031
## Builds
3132

‎build.ps1‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,16 @@ function Clean() {
2020
}
2121

2222
function Build() {
23-
function b($target, $check=$True) {
24-
dotnet msbuild /t:$target /p:Configuration=$Configuration /p:ContinuousIntegrationBuild=true "$baseDir\src\NETProvider.sln" /v:m /m
25-
if ($check) {
26-
Check-ExitCode
27-
}
28-
}
29-
b 'Clean'
30-
# this sometimes fails on CI
31-
b 'Restore' $False
32-
b 'Restore'
33-
b 'Build'
23+
dotnet clean "$baseDir\src\NETProvider.slnx" -c $Configuration -v m
24+
dotnet build "$baseDir\src\NETProvider.slnx" -c $Configuration -p:ContinuousIntegrationBuild=true -v m
3425
}
3526

3627
function Versions() {
3728
function v($file) {
3829
return (Get-Item $file).VersionInfo.ProductVersion -replace '(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+)?.*','$1.$2.$3$4'
3930
}
40-
$script:versionProvider = v $baseDir\src\FirebirdSql.Data.FirebirdClient\bin\$Configuration\net8.0\FirebirdSql.Data.FirebirdClient.dll
41-
$script:versionEFCore = v $baseDir\src\FirebirdSql.EntityFrameworkCore.Firebird\bin\$Configuration\net8.0\FirebirdSql.EntityFrameworkCore.Firebird.dll
31+
$script:versionProvider = v $baseDir\src\FirebirdSql.Data.FirebirdClient\bin\$Configuration\net10.0\FirebirdSql.Data.FirebirdClient.dll
32+
$script:versionEFCore = v $baseDir\src\FirebirdSql.EntityFrameworkCore.Firebird\bin\$Configuration\net10.0\FirebirdSql.EntityFrameworkCore.Firebird.dll
4233
$script:versionEF6 = v $baseDir\src\EntityFramework.Firebird\bin\$Configuration\net48\EntityFramework.Firebird.dll
4334
}
4435

‎src/Directory.Build.props‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<PackageLicenseFile>license.txt</PackageLicenseFile>
2121
</PropertyGroup>
2222
<PropertyGroup>
23-
<CopyrightEndYear>2024</CopyrightEndYear>
23+
<CopyrightEndYear>2026</CopyrightEndYear>
2424
</PropertyGroup>
2525

2626
<!-- SourceLink -->

‎src/EntityFramework.Firebird.Tests/EntityFramework.Firebird.Tests.csproj‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
55
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
66
<SkipSourceLink>true</SkipSourceLink>
@@ -11,15 +11,20 @@
1111
<OutputType>Exe</OutputType>
1212
<StartupObject>FirebirdSql.Data.TestsBase.Program</StartupObject>
1313
</PropertyGroup>
14-
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
14+
<ItemGroup>
15+
<Using Include="NUnit.Framework.Legacy.ClassicAssert" Alias="Assert" />
16+
<Using Include="NUnit.Framework.Legacy.CollectionAssert" Alias="CollectionAssert" />
17+
<Using Include="NUnit.Framework.Legacy.StringAssert" Alias="StringAssert" />
18+
</ItemGroup>
19+
<ItemGroup Condition="'$(TargetFramework)'=='net10.0'">
1520
<!-- left in repo as an example/documentation for .NET Framework -->
1621
<None Remove="app.config" />
1722
</ItemGroup>
1823
<ItemGroup>
19-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
20-
<PackageReference Include="NUnit" Version="3.13.3" />
21-
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
22-
<PackageReference Include="NUnitLite" Version="3.13.3" />
24+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
25+
<PackageReference Include="NUnit" Version="4.2.2" />
26+
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
27+
<PackageReference Include="NUnitLite" Version="4.2.2" />
2328
</ItemGroup>
2429
<ItemGroup>
2530
<ProjectReference Include="..\EntityFramework.Firebird\EntityFramework.Firebird.csproj" />

‎src/EntityFramework.Firebird/EntityFramework.Firebird.csproj‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,12 @@
4747
</ItemGroup>
4848
<ItemGroup>
4949
<PackageReference Include="EntityFramework" Version="$(EF6ReferencePackageVersion)" />
50+
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="$(EF6ReferenceProviderVersion)" />
5051
</ItemGroup>
5152
<ItemGroup Condition="'$(TargetFramework)'=='net48'">
5253
<Reference Include="System.Configuration" />
5354
<Reference Include="Microsoft.CSharp" />
5455
</ItemGroup>
5556
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.1'">
5657
</ItemGroup>
57-
<ItemGroup Condition="'$(Configuration)'!='Debug'">
58-
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="$(EF6ReferenceProviderVersion)" />
59-
</ItemGroup>
60-
<ItemGroup Condition="'$(Configuration)'=='Debug'">
61-
<ProjectReference Include="..\FirebirdSql.Data.FirebirdClient\FirebirdSql.Data.FirebirdClient.csproj" />
62-
</ItemGroup>
6358
</Project>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
using System.IO;
2+
using System.Security.Cryptography;
3+
using System.Threading.Tasks;
4+
using FirebirdSql.Data.TestsBase;
5+
using NUnit.Framework;
6+
7+
namespace FirebirdSql.Data.FirebirdClient.Tests;
8+
9+
[TestFixtureSource(typeof(FbServerTypeTestFixtureSource), nameof(FbServerTypeTestFixtureSource.Default))]
10+
[TestFixtureSource(typeof(FbServerTypeTestFixtureSource), nameof(FbServerTypeTestFixtureSource.Embedded))]
11+
public class BlobStreamTests : FbTestsBase
12+
{
13+
public BlobStreamTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt)
14+
: base(serverType, compression, wireCrypt)
15+
{ }
16+
17+
[Test]
18+
public async Task FbBlobStreamReadTest()
19+
{
20+
var id_value = RandomNumberGenerator.GetInt32(int.MinValue, int.MaxValue);
21+
var insert_values = RandomNumberGenerator.GetBytes(100000 * 4);
22+
23+
await using (var transaction = await Connection.BeginTransactionAsync())
24+
{
25+
await using (var insert = new FbCommand("INSERT INTO TEST (int_field, blob_field) values(@int_field, @blob_field)", Connection, transaction))
26+
{
27+
insert.Parameters.Add("@int_field", FbDbType.Integer).Value = id_value;
28+
insert.Parameters.Add("@blob_field", FbDbType.Binary).Value = insert_values;
29+
await insert.ExecuteNonQueryAsync();
30+
}
31+
await transaction.CommitAsync();
32+
}
33+
34+
await using (var select = new FbCommand($"SELECT blob_field FROM TEST WHERE int_field = {id_value}", Connection))
35+
{
36+
await using var reader = await select.ExecuteReaderAsync();
37+
while (await reader.ReadAsync())
38+
{
39+
await using var output = new MemoryStream();
40+
await using (var stream = reader.GetStream(0))
41+
{
42+
await stream.CopyToAsync(output);
43+
}
44+
45+
var select_values = output.ToArray();
46+
CollectionAssert.AreEqual(insert_values, select_values);
47+
}
48+
}
49+
}
50+
51+
[Test]
52+
public async Task FbBlobStreamWriteTest()
53+
{
54+
var id_value = RandomNumberGenerator.GetInt32(int.MinValue, int.MaxValue);
55+
var insert_values = RandomNumberGenerator.GetBytes(100000 * 4);
56+
57+
await using (var transaction = await Connection.BeginTransactionAsync())
58+
{
59+
await using (var insert = new FbCommand("INSERT INTO TEST (int_field, blob_field) values(@int_field, @blob_field)", Connection, transaction))
60+
{
61+
insert.Parameters.Add("@int_field", FbDbType.Integer).Value = id_value;
62+
insert.Parameters.Add("@blob_field", FbDbType.Binary).Value = insert_values;
63+
await insert.ExecuteNonQueryAsync();
64+
}
65+
66+
await using (var select = new FbCommand($"SELECT blob_field FROM TEST WHERE int_field = {id_value}", Connection, transaction))
67+
{
68+
await using var reader = await select.ExecuteReaderAsync();
69+
while (await reader.ReadAsync())
70+
{
71+
await using var stream = reader.GetStream(0);
72+
await stream.WriteAsync(insert_values);
73+
74+
break;
75+
}
76+
}
77+
await transaction.CommitAsync();
78+
}
79+
80+
await using (var select = new FbCommand($"SELECT blob_field FROM TEST WHERE int_field = {id_value}", Connection))
81+
{
82+
var select_values = (byte[])await select.ExecuteScalarAsync();
83+
CollectionAssert.AreEqual(insert_values, select_values);
84+
}
85+
}
86+
}

‎src/FirebirdSql.Data.FirebirdClient.Tests/FbBlobTests.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public async Task BinaryBlobTest()
4444
insert.Parameters.Add("@blob_field", FbDbType.Binary).Value = insert_values;
4545
await insert.ExecuteNonQueryAsync();
4646
}
47+
4748
await transaction.CommitAsync();
4849
}
4950

‎src/FirebirdSql.Data.FirebirdClient.Tests/FbCommandTests.cs‎

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ public async Task GetCommandExplainedPlanNoPlanTest()
647647
}
648648

649649
[Test]
650-
public async Task ReadsTimeWithProperPrecision()
650+
public async Task ReadsTimeWithProperPrecisionTest()
651651
{
652652
await using (var cmd = Connection.CreateCommand())
653653
{
@@ -658,7 +658,7 @@ public async Task ReadsTimeWithProperPrecision()
658658
}
659659

660660
[Test]
661-
public async Task PassesTimeSpanWithProperPrecision()
661+
public async Task PassesTimeSpanWithProperPrecisionTest()
662662
{
663663
var ts = TimeSpan.FromTicks(14321000);
664664
await using (var cmd = Connection.CreateCommand())
@@ -671,7 +671,7 @@ public async Task PassesTimeSpanWithProperPrecision()
671671
}
672672

673673
[Test]
674-
public async Task ReadsDateTimeWithProperPrecision()
674+
public async Task ReadsDateTimeWithProperPrecisionTest()
675675
{
676676
await using (var cmd = Connection.CreateCommand())
677677
{
@@ -682,7 +682,7 @@ public async Task ReadsDateTimeWithProperPrecision()
682682
}
683683

684684
[Test]
685-
public async Task PassesDateTimeWithProperPrecision()
685+
public async Task PassesDateTimeWithProperPrecisionTest()
686686
{
687687
var dt = new DateTime(635583639614321000);
688688
await using (var cmd = Connection.CreateCommand())
@@ -695,7 +695,41 @@ public async Task PassesDateTimeWithProperPrecision()
695695
}
696696

697697
[Test]
698-
public async Task ExecuteNonQueryReturnsMinusOneOnNonInsertUpdateDelete()
698+
public async Task HighLowSurrogatePassingTest()
699+
{
700+
await using (var cmd = Connection.CreateCommand())
701+
{
702+
const string Value = "😊!";
703+
cmd.CommandText = "select cast(@value1 as varchar(2) character set utf8), cast(@value2 as char(2) character set utf8) from rdb$database";
704+
cmd.Parameters.Add("value1", Value);
705+
cmd.Parameters.Add("value2", Value);
706+
await using (var reader = await cmd.ExecuteReaderAsync())
707+
{
708+
await reader.ReadAsync();
709+
Assert.AreEqual(Value, reader[0]);
710+
Assert.AreEqual(Value, reader[1]);
711+
}
712+
}
713+
}
714+
715+
[Test]
716+
public async Task HighLowSurrogateReadingTest()
717+
{
718+
await using (var cmd = Connection.CreateCommand())
719+
{
720+
const string Value = "😊!";
721+
cmd.CommandText = "select cast(x'F09F988A21' as varchar(2) character set utf8), cast(x'F09F988A21' as char(2) character set utf8) from rdb$database";
722+
await using (var reader = await cmd.ExecuteReaderAsync())
723+
{
724+
await reader.ReadAsync();
725+
Assert.AreEqual(Value, reader[0]);
726+
Assert.AreEqual(Value, reader[1]);
727+
}
728+
}
729+
}
730+
731+
[Test]
732+
public async Task ExecuteNonQueryReturnsMinusOneOnNonInsertUpdateDeleteTest()
699733
{
700734
await using (var cmd = Connection.CreateCommand())
701735
{

0 commit comments

Comments
 (0)