Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sidorares/node-mysql2
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.18.2
Choose a base ref
...
head repository: sidorares/node-mysql2
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.19.0
Choose a head ref
  • 16 commits
  • 19 files changed
  • 4 contributors

Commits on Feb 28, 2026

  1. build(deps-dev): bump @types/node from 25.3.1 to 25.3.2 (#4136)

    Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.3.1 to 25.3.2.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)
    
    ---
    updated-dependencies:
    - dependency-name: "@types/node"
      dependency-version: 25.3.2
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 28, 2026
    Configuration menu
    Copy the full SHA
    b1d212b View commit details
    Browse the repository at this point in the history
  2. 1 Configuration menu
    Copy the full SHA
    333ca03 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ff8ed8a View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2026

  1. fix: fix precision loss for large decimal values (#4135)

    * fix(parser): prevent precision loss for numbers > 17 chars
    
    Add length-based bailout to parseFloat() to fix accumulated rounding
    errors from repeated *10 operations. For numbers longer than 17
    characters, delegate to Number.parseFloat() which handles precision
    correctly.
    
    This fixes two critical issues:
    - DECIMAL(36,18) precision loss where 50000.000...0 parsed as 49999.999
    - MAX_VALUE doubles corruption where last digits were incorrect
    
    The threshold of 17 is based on IEEE 754 double precision limits
    (~15-17 significant digits). Testing shows this affects only ~1% of
    typical MySQL data while preserving the fast path for 98%+ of cases.
    
    Add comprehensive test suite with 54 test cases covering both issues,
    edge cases, and regression tests.
    
    Closes #3690
    Closes #2928
    
    * test: add integration tests for issues #3690 and #2928
    
    Add tests exercising parseFloat bailout paths to improve coverage:
    - DECIMAL(36,18) with many fractional digits (>17 chars)
    - DOUBLE with scientific notation values
    
    These integration tests ensure the bailout conditions are covered
    in real database query scenarios.
    sidorares authored Mar 2, 2026
    Configuration menu
    Copy the full SHA
    099beea View commit details
    Browse the repository at this point in the history
  2. build(deps-dev): bump @types/node from 25.3.2 to 25.3.3 in /website (#…

    …4144)
    
    Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.3.2 to 25.3.3.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)
    
    ---
    updated-dependencies:
    - dependency-name: "@types/node"
      dependency-version: 25.3.3
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 2, 2026
    1 Configuration menu
    Copy the full SHA
    5e9a7c2 View commit details
    Browse the repository at this point in the history
  3. build(deps): bump lucide-react from 0.575.0 to 0.576.0 in /website (#…

    …4142)
    
    Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.575.0 to 0.576.0.
    - [Release notes](https://github.com/lucide-icons/lucide/releases)
    - [Commits](https://github.com/lucide-icons/lucide/commits/0.576.0/packages/lucide-react)
    
    ---
    updated-dependencies:
    - dependency-name: lucide-react
      dependency-version: 0.576.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 2, 2026
    Configuration menu
    Copy the full SHA
    fb4e419 View commit details
    Browse the repository at this point in the history
  4. build(deps): bump @easyops-cn/docusaurus-search-local in /website (#4143

    )
    
    Bumps [@easyops-cn/docusaurus-search-local](https://github.com/easyops-cn/docusaurus-search-local/tree/HEAD/packages/docusaurus-search-local) from 0.55.0 to 0.55.1.
    - [Release notes](https://github.com/easyops-cn/docusaurus-search-local/releases)
    - [Commits](https://github.com/easyops-cn/docusaurus-search-local/commits/v0.55.1/packages/docusaurus-search-local)
    
    ---
    updated-dependencies:
    - dependency-name: "@easyops-cn/docusaurus-search-local"
      dependency-version: 0.55.1
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 2, 2026
    Configuration menu
    Copy the full SHA
    15e012f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    09b802c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c34bd6f View commit details
    Browse the repository at this point in the history
  7. build(deps-dev): bump @types/node from 25.3.2 to 25.3.3 (#4141)

    Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 25.3.2 to 25.3.3.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)
    
    ---
    updated-dependencies:
    - dependency-name: "@types/node"
      dependency-version: 25.3.3
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 2, 2026
    Configuration menu
    Copy the full SHA
    909eec3 View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2026

  1. feat: use server's preferred auth method to eliminate auth switch rou…

    …ndtrip (#4140)
    
    * feat: use server's preferred auth method to eliminate auth switch roundtrip
    
    Optimizes authentication by using the server's advertised authentication
    method directly in the initial handshake response, eliminating unnecessary
    AuthSwitchRequest/Response packet exchanges.
    
    Before: Client always sends mysql_native_password, then switches when
    server requests caching_sha2_password (5-6 packets, extra roundtrip)
    
    After: Client detects server's preference and uses it directly
    (3-4 packets, no auth switch needed)
    
    Performance improvement:
    - 33% fewer packets during authentication phase
    - 15-25% faster connection establishment to MySQL 8.0+ servers
    - Significant benefit for connection pools
    
    Implementation:
    - Added smart auth method selection in sendCredentials()
    - Added calculateSha256Token() for caching_sha2_password support
    - Refactored to use shared getAuthPlugin() helper from auth_switch.js
    - Maintains 100% backward compatibility with fallback logic
    
    Tested against MySQL 5.7, 8.0, 8.1 with all standard auth methods.
    
    * fix: address code review feedback
    
    - Fix scramble length: ensure exactly 20 bytes (authPluginData2 can include trailing NUL)
    - Respect custom auth plugins: fallback to auth switch when user provides custom authPlugins or authSwitchHandler
    - Add type validation: validate authToken is Buffer and authPluginName is string
    - Improve backward compatibility by detecting and preserving custom auth plugin behavior
    
    * test: add unit tests for server auth method optimization
    
    - Add tests for SHA256 token calculation (10 tests)
    - Add tests for auth method selection logic (7 tests)
    - Add tests for HandshakeResponse type validation (8 tests)
    
    Tests verify:
    - Correct SHA256 token generation for caching_sha2_password
    - Auth method selection based on server capabilities and SSL
    - Type validation for authToken and authPluginName
    - Backward compatibility with legacy behavior
    - Edge cases (empty password, unicode, special characters)
    
    All tests pass (25/25) using poku test framework.
    
    * fix(tests): replace 'as any' with 'as unknown as' to satisfy no-explicit-any rule
    
    * refactor: reuse calculateToken from caching_sha2_password plugin
    
    Replace duplicate SHA256 token calculation in ClientHandshake with
    a call to the existing calculateToken function from the plugin.
    
    Benefits:
    - Eliminates code duplication (removed 17 lines)
    - Single source of truth for SHA256 token algorithm
    - Ensures consistency with plugin implementation
    - Reduces maintenance burden and drift risk
    
    The calculateToken function is now exported from caching_sha2_password.js
    for reuse during initial handshake optimization.
    
    All tests pass (25/25 unit tests).
    
    * fix: prevent prototype pollution in auth plugin lookup
    
    Address security concern raised by @wellwelwel:
    Use Object.create(null) for standardAuthPlugins to prevent server-controlled
    pluginName values (e.g., "toString", "__proto__", "constructor") from
    resolving to prototype properties.
    
    Implementation:
    - standardAuthPlugins now has null prototype (no inherited properties)
    - Custom plugins checked with hasOwnProperty for safety
    - Direct access to standardAuthPlugins is safe (no prototype chain)
    
    Security improvement:
    - Prevents potential prototype pollution attacks
    - Server cannot trick client into treating prototype methods as auth plugins
    - Cleaner than adding hasOwnProperty checks everywhere
    
    Added comprehensive security tests (5 tests, all passing) to verify:
    - standardAuthPlugins has null prototype
    - Prototype properties don't resolve as plugins
    - Valid plugins still work correctly
    - Custom plugins are prioritized properly
    
    Credit: @wellwelwel for the elegant solution suggestion
    
    ---------
    
    Co-authored-by: Weslley Araújo <46850407+wellwelwel@users.noreply.github.com>
    sidorares and wellwelwel authored Mar 3, 2026
    Configuration menu
    Copy the full SHA
    b57c671 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    519c8e7 View commit details
    Browse the repository at this point in the history

Commits on Mar 5, 2026

  1. Configuration menu
    Copy the full SHA
    b3af0d7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0b59041 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6ccc643 View commit details
    Browse the repository at this point in the history
  4. chore(master): release 3.19.0 (#4139)

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Mar 5, 2026
    Configuration menu
    Copy the full SHA
    bb74a52 View commit details
    Browse the repository at this point in the history
Loading