Skip to content

Commit 9026116

Browse files
committed
Merge net6 branch into master.
2 parents 67dc064 + 4366e85 commit 9026116

33 files changed

+407
-240
lines changed

.ci/build-steps.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,15 @@ steps:
8181
inputs:
8282
artifactName: 'SideBySide-net5.0-$(Agent.OS)'
8383
targetPath: 'tests/SideBySide/bin/Release/net5.0/publish'
84+
85+
- task: DotNetCoreCLI@2
86+
displayName: 'Publish SideBySide (6.0)'
87+
inputs:
88+
command: 'publish'
89+
arguments: '-c Release -f net6.0 --no-build tests/SideBySide/SideBySide.csproj'
90+
publishWebProjects: false
91+
zipAfterPublish: false
92+
- task: PublishPipelineArtifact@0
93+
inputs:
94+
artifactName: 'SideBySide-net6.0-$(Agent.OS)'
95+
targetPath: 'tests/SideBySide/bin/Release/net6.0/publish'

.ci/integration-tests-steps.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ steps:
2222
inputs:
2323
version: 3.1.x
2424
packageType: runtime
25+
- task: UseDotNet@2
26+
displayName: 'Install .NET Core 5.0'
27+
inputs:
28+
version: '5.0.x'
29+
packageType: runtime
2530
- task: UseDotNet@2
2631
displayName: 'Install .NET Core'
2732
inputs:
@@ -38,26 +43,26 @@ steps:
3843
image: ${{ parameters.image }}
3944
unsupportedFeatures: ${{ parameters.unsupportedFeatures }}
4045
connectionString: 'server=localhost;port=3300;user id=mysqltest;password=test;database=mysqltest;ssl mode=required;DefaultCommandTimeout=3600;certificate file=$(Build.Repository.LocalPath)/.ci/server/certs/ssl-client.pfx'
41-
platform: 'netcoreapp3.1'
46+
platform: 'net5.0'
4247
description: 'SSL'
4348
- template: 'sidebyside-test-steps.yml'
4449
parameters:
4550
image: ${{ parameters.image }}
4651
unsupportedFeatures: ${{ parameters.unsupportedFeatures }}
4752
connectionString: 'server=localhost;port=3300;user id=mysqltest;password=test;database=mysqltest;ssl mode=none;UseCompression=True;DefaultCommandTimeout=3600'
48-
platform: 'netcoreapp3.1'
53+
platform: 'net5.0'
4954
description: 'Compression'
5055
- template: 'sidebyside-test-steps.yml'
5156
parameters:
5257
image: ${{ parameters.image }}
5358
unsupportedFeatures: ${{ parameters.unsupportedFeatures }}
5459
connectionString: 'server=localhost;port=3300;user id=mysqltest;password=test;database=mysqltest;ssl mode=none;DefaultCommandTimeout=3600'
55-
platform: 'net5.0'
60+
platform: 'net6.0'
5661
description: 'No SSL'
5762
- template: 'sidebyside-test-steps.yml'
5863
parameters:
5964
image: ${{ parameters.image }}
6065
unsupportedFeatures: ${{ parameters.unsupportedFeatures }}
6166
connectionString: 'server=localhost;port=3300;user id=mysqltest;password=test;database=mysqltest;ssl mode=required;DefaultCommandTimeout=3600;certificate file=$(Build.Repository.LocalPath)/.ci/server/certs/ssl-client.pfx'
62-
platform: 'net5.0'
67+
platform: 'net6.0'
6368
description: 'SSL'

.ci/mysqlconnector-tests-steps.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
steps:
2+
- task: UseDotNet@2
3+
displayName: 'Install .NET Core 5.0'
4+
inputs:
5+
version: '5.0.x'
6+
packageType: runtime
27
- task: UseDotNet@2
38
displayName: 'Install .NET Core'
49
inputs:

.github/workflows/publish-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v1
2121

22-
- name: Set up .NET 5.0
22+
- name: Set up .NET 6.0
2323
uses: actions/setup-dotnet@v1
2424
with:
25-
dotnet-version: 5.0.102
25+
dotnet-version: 6.0.100-preview.5.21302.13
2626

2727
- name: Restore
2828
run: dotnet restore

.github/workflows/sonarcloud.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up .NET 5.0
2424
uses: actions/setup-dotnet@v1
2525
with:
26-
dotnet-version: 5.0.x
26+
dotnet-version: '5.0.x'
2727
- uses: actions/checkout@v2
2828
with:
2929
fetch-depth: 0 # fetch all revisions
@@ -48,6 +48,10 @@ jobs:
4848
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
4949
- name: Install minver
5050
run: dotnet tool install --global minver-cli
51+
- name: Set up .NET 6.0
52+
uses: actions/setup-dotnet@v1
53+
with:
54+
dotnet-version: 6.0.100-preview.5.21302.13
5155
- name: Restore Packages
5256
run: dotnet restore
5357
- name: Build and analyze

appveyor.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ cache:
99
- '%USERPROFILE%\.nuget\packages -> **\*.csproj'
1010
install:
1111
- ps: Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile "install-dotnet.ps1"
12-
- ps: .\install-dotnet.ps1 -Version 3.1.409 -InstallDir "dotnetcli"
13-
- ps: .\install-dotnet.ps1 -Version 5.0.300 -InstallDir "dotnetcli"
12+
- ps: .\install-dotnet.ps1 -Version 3.1.410 -InstallDir "dotnetcli"
13+
- ps: .\install-dotnet.ps1 -Version 5.0.301 -InstallDir "dotnetcli"
14+
- ps: .\install-dotnet.ps1 -Version 6.0.100-preview.5.21302.13 -InstallDir "dotnetcli"
1415
build_script:
1516
- dotnet --info
1617
before_test:

azure-pipelines.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variables:
2-
DotNetCoreSdkVersion: '5.0.102'
2+
DotNetCoreSdkVersion: '6.0.100-preview.5.21302.13'
33
NUGET_PACKAGES: '$(Pipeline.Workspace)/.nuget/packages'
44

55
jobs:
@@ -41,27 +41,15 @@ jobs:
4141
contents: 'config.json'
4242
targetFolder: 'tests/SideBySide'
4343
- task: UseDotNet@2
44-
displayName: 'Install .NET Core'
45-
inputs:
46-
version: $(DotNetCoreSdkVersion)
47-
- task: DotNetCoreCLI@2
48-
displayName: 'Restore packages'
44+
displayName: 'Install .NET Core 5.0'
4945
inputs:
50-
command: 'restore'
51-
arguments: 'tests\MySqlConnector.Tests\MySqlConnector.Tests.csproj /p:Configuration=Baseline'
52-
verbosityRestore: 'minimal'
46+
version: '5.0.x'
5347
- task: DotNetCoreCLI@2
5448
displayName: 'Unit tests'
5549
inputs:
5650
command: 'test'
5751
arguments: 'tests\MySqlConnector.Tests\MySqlConnector.Tests.csproj -c Baseline'
5852
testRunTitle: 'Baseline unit tests'
59-
- task: DotNetCoreCLI@2
60-
displayName: 'Restore packages'
61-
inputs:
62-
command: 'restore'
63-
arguments: 'tests\SideBySide\SideBySide.csproj /p:Configuration=Baseline'
64-
verbosityRestore: 'minimal'
6553
- task: DotNetCoreCLI@2
6654
displayName: 'Baseline tests'
6755
inputs:
@@ -108,6 +96,11 @@ jobs:
10896
inputs:
10997
version: 3.1.x
11098
packageType: runtime
99+
- task: UseDotNet@2
100+
displayName: 'Install .NET Core 5.0'
101+
inputs:
102+
version: '5.0.x'
103+
packageType: runtime
111104
- task: UseDotNet@2
112105
displayName: 'Install .NET Core'
113106
inputs:
@@ -124,6 +117,11 @@ jobs:
124117
vmimage: 'windows-latest'
125118
steps:
126119
- template: '.ci/install-mysql-windows.yml'
120+
- task: UseDotNet@2
121+
displayName: 'Install .NET Core 5.0'
122+
inputs:
123+
version: '5.0.x'
124+
packageType: runtime
127125
- task: UseDotNet@2
128126
displayName: 'Install .NET Core'
129127
inputs:

src/MySqlConnector/Core/ConnectionPool.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ private int GetSessionHealth(ServerSession session)
158158
return 0;
159159
}
160160

161-
#if NET45 || NET461 || NET471 || NETSTANDARD1_3 || NETSTANDARD2_0
162-
public async ValueTask<int> ReturnAsync(IOBehavior ioBehavior, ServerSession session)
163-
#else
161+
#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
164162
public async ValueTask ReturnAsync(IOBehavior ioBehavior, ServerSession session)
163+
#else
164+
public async ValueTask<int> ReturnAsync(IOBehavior ioBehavior, ServerSession session)
165165
#endif
166166
{
167167
if (Log.IsDebugEnabled())
@@ -193,7 +193,7 @@ public async ValueTask ReturnAsync(IOBehavior ioBehavior, ServerSession session)
193193
m_sessionSemaphore.Release();
194194
}
195195

196-
#if NET45 || NET461 || NET471 || NETSTANDARD1_3 || NETSTANDARD2_0
196+
#if !NETCOREAPP2_1_OR_GREATER && !NETSTANDARD2_1_OR_GREATER
197197
return default;
198198
#endif
199199
}

src/MySqlConnector/Core/ConnectionSettings.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public ConnectionSettings(MySqlConnectionStringBuilder csb)
7575
TlsVersions |= SslProtocols.Tls11;
7676
else if (minorVersion == '2')
7777
TlsVersions |= SslProtocols.Tls12;
78-
#if !NET45 && !NET461 && !NET471 && !NETSTANDARD1_3 && !NETSTANDARD2_0 && !NETSTANDARD2_1 && !NETCOREAPP2_1
78+
#if NETCOREAPP3_0_OR_GREATER
7979
else if (minorVersion == '3')
8080
TlsVersions |= SslProtocols.Tls13;
8181
#endif
@@ -88,9 +88,7 @@ public ConnectionSettings(MySqlConnectionStringBuilder csb)
8888

8989
if (csb.TlsCipherSuites != "")
9090
{
91-
#if NET45 || NET461 || NET471 || NETSTANDARD1_3 || NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP2_1
92-
throw new PlatformNotSupportedException("The TlsCipherSuites connection string option is only supported on .NET Core 3.1 (or later) on Linux.");
93-
#else
91+
#if NETCOREAPP3_0_OR_GREATER
9492
var tlsCipherSuites = new List<TlsCipherSuite>();
9593
foreach (var token in csb.TlsCipherSuites.Split(','))
9694
{
@@ -105,6 +103,8 @@ public ConnectionSettings(MySqlConnectionStringBuilder csb)
105103
throw new NotSupportedException("Unknown value '{0}' for TlsCipherSuites.".FormatInvariant(suiteName));
106104
}
107105
TlsCipherSuites = tlsCipherSuites;
106+
#else
107+
throw new PlatformNotSupportedException("The TlsCipherSuites connection string option is only supported on .NET Core 3.1 (or later) on Linux.");
108108
#endif
109109
}
110110

@@ -201,7 +201,7 @@ private static MySqlGuidFormat GetEffectiveGuidFormat(MySqlGuidFormat guidFormat
201201
public MySqlCertificateStoreLocation CertificateStoreLocation { get; }
202202
public string CertificateThumbprint { get; }
203203
public SslProtocols TlsVersions { get; }
204-
#if !NET45 && !NET461 && !NET471 && !NETSTANDARD1_3 && !NETSTANDARD2_0 && !NETSTANDARD2_1 && !NETCOREAPP2_1
204+
#if NETCOREAPP3_0_OR_GREATER
205205
public IReadOnlyList<TlsCipherSuite>? TlsCipherSuites { get; }
206206
#endif
207207

src/MySqlConnector/Core/Row.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -552,14 +552,14 @@ protected object ParseDateTime(ReadOnlySpan<byte> value)
552552
protected unsafe static Guid CreateGuidFromBytes(MySqlGuidFormat guidFormat, ReadOnlySpan<byte> bytes) =>
553553
guidFormat switch
554554
{
555-
#if NET45 || NET461 || NET471 || NETSTANDARD1_3 || NETSTANDARD2_0
556-
MySqlGuidFormat.Binary16 => new Guid(new[] { bytes[3], bytes[2], bytes[1], bytes[0], bytes[5], bytes[4], bytes[7], bytes[6], bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15] }),
557-
MySqlGuidFormat.TimeSwapBinary16 => new Guid(new[] { bytes[7], bytes[6], bytes[5], bytes[4], bytes[3], bytes[2], bytes[1], bytes[0], bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15] }),
558-
_ => new Guid(bytes.ToArray()),
559-
#else
555+
#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
560556
MySqlGuidFormat.Binary16 => new Guid(stackalloc byte[16] { bytes[3], bytes[2], bytes[1], bytes[0], bytes[5], bytes[4], bytes[7], bytes[6], bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15] }),
561557
MySqlGuidFormat.TimeSwapBinary16 => new Guid(stackalloc byte[16] { bytes[7], bytes[6], bytes[5], bytes[4], bytes[3], bytes[2], bytes[1], bytes[0], bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15] }),
562558
_ => new Guid(bytes),
559+
#else
560+
MySqlGuidFormat.Binary16 => new Guid(new[] { bytes[3], bytes[2], bytes[1], bytes[0], bytes[5], bytes[4], bytes[7], bytes[6], bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15] }),
561+
MySqlGuidFormat.TimeSwapBinary16 => new Guid(new[] { bytes[7], bytes[6], bytes[5], bytes[4], bytes[3], bytes[2], bytes[1], bytes[0], bytes[8], bytes[9], bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15] }),
562+
_ => new Guid(bytes.ToArray()),
563563
#endif
564564
};
565565

0 commit comments

Comments
 (0)