Skip to content

to_semver_no_prerelease doesn't handle build metadata with hyphens correctly #3882

Closed
@ghost

Description

Describe the bug
I noticed while messing around with the database that the to_semver_no_prerelease function doesn't account for build metadata containing hyphens, e.g. 0.4.45+curl-7.78.0 is not a prerelease version however to_semver_no_prerelease('0.4.45+curl-7.78.0') is NULL. I verified this with the regex from https://semver.org/ - see https://regex101.com/r/vEYRnS/1.

To Reproduce
Steps to reproduce the behavior:

  1. SELECT to_semver_no_prerelease('0.4.45+curl-7.78.0') returns NULL;

Expected behavior
The above query should return (0,4,45).

Additional context
This may result in reverse dependencies query returning inaccurate results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions