Skip to content

MATCH() match type smallest value has inferior handling of numeric types than greatest or equal matches #3141

Closed
@Natrak

Description

@Natrak

matchSmallestValue does not have any extra handling to make sure double and integer types are treated as matchable.
$typeMatch = gettype($lookupValue) === gettype($lookupArrayValue);

Both matchFirstvalue and matchLargestValue use:
$typeMatch = ((gettype($lookupValue) === gettype($lookupArrayValue)) || (is_numeric($lookupValue) && is_numeric($lookupArrayValue)));

This results in the matcher for matchSmallestValue skipping valid comparisons when one of the values is an integer and the other a double.

I had no problems just reusing the logic from the other matching functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions