Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developed UserVarEvent and Added Statement-Based Logging Test #466

Conversation

mjs1995
Copy link
Contributor

@mjs1995 mjs1995 commented Sep 1, 2023

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.

    • Test Cases include:
      • Unsigned Maximum: 18446744073709551615
      • Signed Maximum: 9223372036854775807
      • Signed Minimum: -9223372036854775808
      • Near Zero: -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 Method

This 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 Method

This static method has been introduced to parse decimal numbers from bytes.


Reference

mjs1995 and others added 6 commits September 1, 2023 21:16
Co-authored-by: heehehe <heeseon0315@gmail.com>
Co-authored-by: sean-k1 <sean.k1@kakaoent.com>
Co-authored-by: mjs1995 <munmun2004@naver.com>
Co-authored-by: starcat37 <starcat37@korea.ac.kr>
Co-authored-by: minakiz <k515jina@gmail.com>
@mjs1995 mjs1995 closed this Sep 1, 2023
@mjs1995 mjs1995 reopened this Sep 1, 2023
@julien-duponchelle
Copy link
Owner

Wow great work

@julien-duponchelle julien-duponchelle merged commit 73e2eeb into julien-duponchelle:main Sep 1, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants