Skip to content

Commit

Permalink
Update semver db functions to use 64 bits integers (#4154)
Browse files Browse the repository at this point in the history
Closes #4146

Signed-off-by: Sergio Castaño Arteaga <[email protected]>
  • Loading branch information
tegioz authored Nov 18, 2024
1 parent 6832d38 commit 54d74f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions database/migrations/functions/packages/semver_gt.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ declare
semver_regexp text := '(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?';
v1_parts text[] = regexp_match(p_v1, semver_regexp);
v2_parts text[] = regexp_match(p_v2, semver_regexp);
v1 int[] := v1_parts[1:3]::int[];
v2 int[] := v2_parts[1:3]::int[];
v1 bigint[] := v1_parts[1:3]::bigint[];
v2 bigint[] := v2_parts[1:3]::bigint[];
v1_prerelease text := v1_parts[4];
v2_prerelease text := v2_parts[4];
begin
Expand Down
4 changes: 2 additions & 2 deletions database/migrations/functions/packages/semver_gte.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ declare
semver_regexp text := '(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?';
v1_parts text[] = regexp_match(p_v1, semver_regexp);
v2_parts text[] = regexp_match(p_v2, semver_regexp);
v1 int[] := v1_parts[1:3]::int[];
v2 int[] := v2_parts[1:3]::int[];
v1 bigint[] := v1_parts[1:3]::bigint[];
v2 bigint[] := v2_parts[1:3]::bigint[];
v1_prerelease text := v1_parts[4];
v2_prerelease text := v2_parts[4];
begin
Expand Down

0 comments on commit 54d74f2

Please sign in to comment.