-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoids SET NAMES commands if not needed
for MariaDB since 15.1 (https://jira.mariadb.org/browse/MDEV-31609) followed session variables are sent in initial OK_Packet. This permits to avoids initial query SET NAMES command, since charset is really know, defaulting to server corresponding default collation. Signed-off-by: rusher <[email protected]>
- Loading branch information
Showing
9 changed files
with
138 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using MySqlConnector.Protocol; | ||
|
||
namespace MySqlConnector.Core; | ||
|
||
internal sealed class Context | ||
{ | ||
public Context(ProtocolCapabilities protocolCapabilities, string? database, int connectionId) | ||
{ | ||
SupportsDeprecateEof = (protocolCapabilities & ProtocolCapabilities.DeprecateEof) != 0; | ||
SupportsCachedPreparedMetadata = (protocolCapabilities & ProtocolCapabilities.MariaDbCacheMetadata) != 0; | ||
SupportsQueryAttributes = (protocolCapabilities & ProtocolCapabilities.QueryAttributes) != 0; | ||
SupportsSessionTrack = (protocolCapabilities & ProtocolCapabilities.SessionTrack) != 0; | ||
ConnectionId = connectionId; | ||
Database = database; | ||
m_initialDatabase = database; | ||
} | ||
|
||
public bool SupportsDeprecateEof { get; } | ||
public bool SupportsQueryAttributes { get; } | ||
public bool SupportsSessionTrack { get; } | ||
public bool SupportsCachedPreparedMetadata { get; } | ||
public string? ClientCharset { get; set; } | ||
|
||
public string? Database { get; set; } | ||
private readonly string? m_initialDatabase; | ||
public bool IsInitialDatabase() => string.Equals(m_initialDatabase, Database, StringComparison.Ordinal); | ||
|
||
public int ConnectionId { get; set; } | ||
} |
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.