-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: .ci/config/config.compression+ssl.json .ci/config/config.compression.json .ci/config/config.json .ci/config/config.ssl.json azure-pipelines.yml src/MySqlConnector/Core/ConnectionPool.cs src/MySqlConnector/Core/ServerSession.cs src/MySqlConnector/Logging/Log.cs src/MySqlConnector/MySqlConnection.cs src/MySqlConnector/Protocol/Payloads/OkPayload.cs tests/IntegrationTests/RedirectionTests.cs tests/IntegrationTests/ServerFeatures.cs Signed-off-by: Bradley Grainger <[email protected]>
- Loading branch information
Showing
12 changed files
with
156 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace MySqlConnector.Core; | ||
|
||
internal interface IConnectionPoolMetadata | ||
{ | ||
/// <summary> | ||
/// Returns the <see cref="ConnectionPool"/> this <see cref="IConnectionPoolMetadata"/> is associated with, | ||
/// or <c>null</c> if it represents a non-pooled connection. | ||
/// </summary> | ||
ConnectionPool? ConnectionPool { get; } | ||
|
||
/// <summary> | ||
/// Returns the ID of the connection pool, or 0 if this is a non-pooled connection. | ||
/// </summary> | ||
int Id { get; } | ||
|
||
/// <summary> | ||
/// Returns the generation of the connection pool, or 0 if this is a non-pooled connection. | ||
/// </summary> | ||
int Generation { get; } | ||
|
||
/// <summary> | ||
/// Returns a new session ID. | ||
/// </summary> | ||
/// <returns>A new session ID.</returns> | ||
int GetNewSessionId(); | ||
} |
13 changes: 13 additions & 0 deletions
13
src/MySqlConnector/Core/NonPooledConnectionPoolMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace MySqlConnector.Core; | ||
|
||
internal sealed class NonPooledConnectionPoolMetadata : IConnectionPoolMetadata | ||
{ | ||
public static IConnectionPoolMetadata Instance { get; } = new NonPooledConnectionPoolMetadata(); | ||
|
||
public ConnectionPool? ConnectionPool => null; | ||
public int Id => 0; | ||
public int Generation => 0; | ||
public int GetNewSessionId() => Interlocked.Increment(ref m_lastId); | ||
|
||
private int m_lastId; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.