Skip to content
  • Daniel Colson's avatar
    698722e9
    Fix max_allowed_packet math · 698722e9
    Daniel Colson authored
    Prior to this commit our `max_allowed_packed` would fail any time the
    `len` of the data being written to the buffer was itself greater than
    the configured `max_allowed_packet`.
    
    This is because both the `len` and the `max_allowed_packet`
    (aka `builder->packet_max_length`) are unsigned (`size_t`).
    
    This commit bypasses the problem by adding to the left side instead of
    subtracting from the right.
    698722e9
    Fix max_allowed_packet math
    Daniel Colson authored
    Prior to this commit our `max_allowed_packed` would fail any time the
    `len` of the data being written to the buffer was itself greater than
    the configured `max_allowed_packet`.
    
    This is because both the `len` and the `max_allowed_packet`
    (aka `builder->packet_max_length`) are unsigned (`size_t`).
    
    This commit bypasses the problem by adding to the left side instead of
    subtracting from the right.
Loading