Developed UserVarEvent and Added Statement-Based Logging Test #466
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This Pull Request introduces the UserVarEvent class, aimed at providing robust handling for MySQL/MariaDB binary log events related to user variables. To validate the effectiveness of this implementation, TestStatementConnectionSetting, has been added to focus on statement-based logging scenarios.
Description
UserVarEvent Class
The
UserVarEvent
class has been implemented following the official documentation of MySQL and MariaDB. It supports various user variable event types, including:STRING_RESULT
REAL_RESULT
INT_RESULT
ROW_RESULT
(Currently not in use)DECIMAL_RESULT
Type-Specific Value Parsing
STRING, REAL, INT, ROW, DECIMAL Types: Each data type has its dedicated function to parse values appropriately.
DECIMAL Type: Introduced a specialized bit-parsing function to handle decimal types.
INT Type: Utilized flags to distinguish between signed and unsigned integers.
18446744073709551615
9223372036854775807
-9223372036854775808
-1
TestStatementConnectionSetting Class
A new test was added to cater specifically to the testing requirements of UserVarEvent under statement-based logging.
Additional Method
_set_value_from_temp_buffer
MethodThis method serves to populate a designated class attribute with an accurately parsed value extracted from a temporary buffer. Utilizing a dictionary as a mapping mechanism, it correlates each event type code to its specific value-parsing function.
_parse_decimal_from_bytes
MethodThis static method has been introduced to parse decimal numbers from bytes.
Reference