Skip to content

Commit 1dae111

Browse files
committed
Merge master into net9.
2 parents 92787d1 + e2a0f58 commit 1dae111

File tree

80 files changed

+693
-491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+693
-491
lines changed

.ci/docker-run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ MYSQL=mysql
2828
if [[ "$IMAGE" == mariadb* ]]; then
2929
MYSQL_EXTRA='--in-predicate-conversion-threshold=100000'
3030
fi
31-
if [ "$IMAGE" == "mariadb:11.2" ]; then
31+
if [ "$IMAGE" == "mariadb:11.4" ]; then
3232
MYSQL='mariadb'
3333
fi
3434

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ indent_style = tab
1616
indent_size = 4
1717

1818
# changes from VS2017 defaults
19+
csharp_style_expression_bodied_local_functions = true:suggestion
1920
csharp_style_expression_bodied_methods = true:suggestion
2021
csharp_style_expression_bodied_constructors = true:suggestion
2122
csharp_style_expression_bodied_operators = true:suggestion
23+
csharp_style_namespace_declarations = file_scoped
2224
csharp_prefer_braces = false:none
2325
csharp_indent_switch_labels = true
2426
csharp_space_after_cast = true
2527
csharp_preserve_single_line_statements = false
28+
dotnet_style_prefer_conditional_expression_over_return = false:suggestion
2629

2730
# use VS2017 defaults, but make them warnings (instead of none)
2831
dotnet_style_qualification_for_field = false:warning
@@ -84,7 +87,11 @@ dotnet_diagnostic.CA2100.severity = none # Review SQL queries for security vulne
8487
dotnet_diagnostic.CA2213.severity = silent # Disposable fields should be disposed.
8588
dotnet_diagnostic.CA5398.severity = none # Avoid hardcoded SslProtocols values.
8689
dotnet_diagnostic.IDE0044.severity = error # Make fields readonly.
90+
dotnet_diagnostic.IDE0045.severity = suggestion # Use conditional expression for assignment.
91+
dotnet_diagnostic.IDE0058.severity = none # Remove unnecessary expression value.
92+
dotnet_diagnostic.IDE0059.severity = none # Remove unnecessary value assignment.
8793
dotnet_diagnostic.IDE0065.severity = error # Using directives must be placed outside of a namespace declaration.
94+
dotnet_diagnostic.IDE0072.severity = silent # Add missing cases to switch expression.
8895
dotnet_diagnostic.SA1003.severity = none # Operator must not be followed by whitespace.
8996
dotnet_diagnostic.SA1008.severity = none # Opening parenthesis must not be preceded by a space.
9097
dotnet_diagnostic.SA1009.severity = none # Closing parenthesis must not be followed by a space.

Directory.Packages.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
1616
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
1717
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
18-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
19-
<PackageVersion Include="MySql.Data" Version="8.3.0" />
18+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
19+
<PackageVersion Include="MySql.Data" Version="9.0.0" />
2020
<PackageVersion Include="NLog" Version="4.5.0" />
2121
<PackageVersion Include="Serilog" Version="2.6.0" />
2222
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
2323
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="7.0.2" />
2424
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
25-
<PackageVersion Include="xunit" Version="2.6.6" />
26-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6" />
25+
<PackageVersion Include="xunit" Version="2.7.0" />
26+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
2727
<PackageVersion Include="YamlDotNet" Version="13.7.1" />
2828
</ItemGroup>
2929

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
[![NuGet](https://img.shields.io/nuget/vpre/MySqlConnector.svg)](https://www.nuget.org/packages/MySqlConnector/)
44

55
This is an [ADO.NET](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/) data
6-
provider for [MySQL](https://www.mysql.com/). It provides implementations of
6+
provider for [MySQL](https://www.mysql.com/) and other compatible servers including [MariaDB](https://www.mariadb.org).
7+
It provides implementations of
78
`DbConnection`, `DbCommand`, `DbDataReader`, `DbTransaction`—the classes
89
needed to query and update databases from managed code.
910

@@ -21,7 +22,7 @@ This library outperforms MySQL Connector/NET (`MySql.Data`) on benchmarks:
2122

2223
### Server Compatibility
2324

24-
This library is compatible with [many MySQL-compatible servers](https://mysqlconnector.net/#server-compatibility).
25+
This library is compatible with [many MySQL-compatible servers](https://mysqlconnector.net/#server-compatibility), including MySQL 5.5 and newer and MariaDB 10.x and newer.
2526
MySql.Data [only supports MySQL Server](https://bugs.mysql.com/bug.php?id=109331).
2627

2728
### Bug Fixes

azure-pipelines.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,16 @@ jobs:
210210
vmimage: 'ubuntu-20.04'
211211
strategy:
212212
matrix:
213-
'MySQL 5.7':
214-
image: 'mysql:5.7'
215-
connectionStringExtra: 'Tls Cipher Suites=TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256'
216-
unsupportedFeatures: 'CachingSha2Password,Ed25519,QueryAttributes,Tls11,Tls13,UuidToBin'
217213
'MySQL 8.0':
218214
image: 'mysql:8.0'
219215
connectionStringExtra: 'AllowPublicKeyRetrieval=True'
220216
unsupportedFeatures: 'Ed25519,StreamingResults,Tls11,ZeroDateTime'
221-
'MySQL 8.3':
222-
image: 'mysql:8.3'
217+
'MySQL 8.4':
218+
image: 'mysql:8.4'
219+
connectionStringExtra: 'AllowPublicKeyRetrieval=True'
220+
unsupportedFeatures: 'Ed25519,StreamingResults,Tls11,ZeroDateTime'
221+
'MySQL 9.0':
222+
image: 'mysql:9.0'
223223
connectionStringExtra: 'AllowPublicKeyRetrieval=True'
224224
unsupportedFeatures: 'Ed25519,StreamingResults,Tls11,ZeroDateTime'
225225
'MariaDB 10.6':
@@ -230,8 +230,8 @@ jobs:
230230
image: 'mariadb:10.11'
231231
connectionStringExtra: ''
232232
unsupportedFeatures: 'CachingSha2Password,CancelSleepSuccessfully,Json,RoundDateTime,QueryAttributes,Sha256Password,Tls11,UuidToBin'
233-
'MariaDB 11.2':
234-
image: 'mariadb:11.2'
233+
'MariaDB 11.4':
234+
image: 'mariadb:11.4'
235235
connectionStringExtra: ''
236236
unsupportedFeatures: 'CachingSha2Password,CancelSleepSuccessfully,Json,RoundDateTime,QueryAttributes,Sha256Password,Tls11,UuidToBin'
237237
steps:

contrib/NewRelic/README.md

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

docs/content/connection-options.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Connection pooling is enabled by default. These options are used to configure it
229229
<td>The minimum number of connections to leave in the pool if ConnectionIdleTimeout is reached.</td>
230230
</tr>
231231
<tr id="MaximumPoolSize">
232-
<td>Maximum Pool Size, Max Pool Size, MaximumPoolsize, maxpoolsize</td>
232+
<td>Maximum Pool Size, Max Pool Size, MaximumPoolSize, maxpoolsize</td>
233233
<td>100</td>
234234
<td>The maximum number of connections allowed in the pool.</td>
235235
</tr>
@@ -515,7 +515,7 @@ from your connection string when migrating from Connector/NET to MySqlConnector.
515515
<td>Use <a href="/overview/logging/">MySqlConnector logging</a> (which is more flexible) instead.</td>
516516
</tr>
517517
<tr id="OldGetStringBehavior">
518-
<td></td>
518+
<td>OldGetStringBehavior</td>
519519
<td>false</td>
520520
<td>This option is temporary in Connector/NET and unsupported in MySqlConnector.</td>
521521
</tr>

docs/content/home.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ Server | Versions | Notes
6464
Amazon Aurora RDS | 2.x, 3.x | Use `Pipelining=False` [for Aurora 2.x](https://mysqlconnector.net/troubleshooting/aurora-freeze/)
6565
Azure Database for MySQL | 5.7, 8.0 | Single Server and Flexible Server
6666
Google Cloud SQL for MySQL | 5.6, 5.7, 8.0 |
67-
MariaDB | 10.x (**10.6**, **10.11**), 11.x (**11.2**) |
68-
MySQL | 5.5, 5.6, **5.7**, 8.x (**8.0**, **8.3**) | 5.5 is EOL and has some [compatibility issues](https://github.com/mysql-net/MySqlConnector/issues/1192); 5.6 and 5.7 are EOL
67+
MariaDB | 10.x (**10.6**, **10.11**), 11.x (**11.4**) |
68+
MySQL | 5.5, 5.6, 5.7, 8.x (**8.0**, **8.4**), **9.0** | 5.5 is EOL and has some [compatibility issues](https://github.com/mysql-net/MySqlConnector/issues/1192); 5.6 and 5.7 are EOL
6969
Percona Server | 5.6, 5.7, 8.0 |
7070
PlanetScale | | See PlanetScale [MySQL compatibility notes](https://planetscale.com/docs/reference/mysql-compatibility)
7171
ProxySQL | 2.x | Some [compatibility issues](https://github.com/search?q=repo%3Amysql-net%2FMySqlConnector+proxysql&type=issues)

docs/content/overview/version-history.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
lastmod: 2024-01-20
2+
lastmod: 2024-04-22
33
date: 2017-03-27
44
menu:
55
main:
@@ -11,6 +11,29 @@ weight: 30
1111

1212
# Version History
1313

14+
### 2.3.7
15+
16+
* Fix `NullReferenceException` in `MySqlDataReader.ActivateResultSet` and `MySqlDataReader.DisposeAsync`: [#1459](https://github.com/mysql-net/MySqlConnector/issues/1459).
17+
* This bug likely also caused "Packet received out-of-order" errors.
18+
* This was introduced in 2.3.0.
19+
* Fix rare `NullReferenceException` in `ServerSession` during cancellation: [#1472](https://github.com/mysql-net/MySqlConnector/issues/1472).
20+
* Fix `Foreign Keys` schema not being generated asynchronously.
21+
22+
### 2.3.6
23+
24+
* Fix `VerifyCA` incompatibility with AWS Aurora: [#1462](https://github.com/mysql-net/MySqlConnector/issues/1462).
25+
* Verify that the server's root certificate is present (in the list of provided CA certificates) when using the `SslCa` connection string option and `SslMode` is `VerifyCA` or `VerifyFull`.
26+
* Optimization: Use pipelining to begin a transaction: [#1286](https://github.com/mysql-net/MySqlConnector/issues/1286).
27+
* Use `Pipelining = False;` in your connection string to disable this optimization if there are compatibility issues.
28+
* Optimization: cache `START TRANSACTION` payloads.
29+
* Add transaction logging: [#1411](https://github.com/mysql-net/MySqlConnector/issues/1411).
30+
* Fix incompatibility with MySQL Server 5.1: [#1445](https://github.com/mysql-net/MySqlConnector/issues/1445).
31+
* This fixes a regression introduced in 2.3.0.
32+
33+
#### MySqlConnector.DependencyInjection
34+
35+
* Add overload of `AddMySqlDataSource` that takes an `Action<IServiceProvider, MySqlDataSourceBuilder>` action to configure the `MySqlDataSourceBuilder` instance: [#1316](https://github.com/mysql-net/MySqlConnector/issues/1316).
36+
1437
### 2.3.5
1538

1639
* DLL files within the NuGet packages are now digitally signed.
@@ -700,7 +723,7 @@ weight: 30
700723

701724
* **Breaking** `MySqlBulkLoader` (for local files) and `LOAD DATA LOCAL INFILE` are disabled by default.
702725
* Set `AllowLoadLocalInfile=true` in the connection string to enable loading local data.
703-
* This is a security measure; see https://fl.vu/mysql-load-data for details.
726+
* This is a security measure; see https://mysqlconnector.net/load-data for details.
704727
* Add `AllowLoadLocalInfile` connection string option: [#643](https://github.com/mysql-net/MySqlConnector/issues/643).
705728
* Add `SslCert` and `SslKey` connection string options to specify a client certificate using PEM files: [#641](https://github.com/mysql-net/MySqlConnector/issues/641).
706729
* Add `SslCa` alias for the `CACertificateFile` connection string option: [#640](https://github.com/mysql-net/MySqlConnector/issues/640).

docs/content/troubleshooting/transaction-usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ menu:
1616

1717
When using `MySqlTransaction` from a C# program, you may receive the following error:
1818

19-
* **System.InvalidOperationException: The transaction associated with this command is not the connection's active transaction; see https://fl.vu/mysql-trans**
19+
* **System.InvalidOperationException: The transaction associated with this command is not the connection's active transaction**
2020

2121
By default, MySqlConnector requires `MySqlCommand.Transaction` to be set to the connection's active transaction in order for the command to be executed successfully. This strictness is intended to catch programming bugs related to using the wrong transaction, a disposed transaction, or forgetting to set the transaction (and using the default value `null`).
2222

2323
However, this strictness can make migrating from Connector/NET more difficult, as it may require significant code changes to pass the current transaction through to all command objects. It can also be challenging when using a library like Dapper that creates the `MySqlCommand` objects itself.
2424

2525
## Workaround: Use IgnoreCommandTransaction=true
2626

27-
To easily migrate code from Connector/NET, use the `IgnoreCommandTransaction=true` connection string setting to emulate Connector/NET's behaviour and not validate the value of `MySqlCommand.Transaction`. By doing this, you will not need the code fixes prescribed below.
27+
To easily migrate code from Connector/NET, use the `IgnoreCommandTransaction=true` connection string setting to emulate Connector/NET's behavior and not validate the value of `MySqlCommand.Transaction`. By doing this, you will not need the code fixes prescribed below.
2828

2929
## Code Fix: Set MySqlCommand.Transaction
3030

0 commit comments

Comments
 (0)