Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1f78b6c6
Commit
1f78b6c6
authored
Aug 02, 2021
by
Alex Pooley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle int and bigint namespaces.id column
Changelog: changed
parent
a20f106e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
app/models/namespace/traversal_hierarchy.rb
app/models/namespace/traversal_hierarchy.rb
+4
-4
No files found.
app/models/namespace/traversal_hierarchy.rb
View file @
1f78b6c6
...
...
@@ -36,7 +36,7 @@ class Namespace
SET traversal_ids = cte.traversal_ids
FROM (
#{
recursive_traversal_ids
}
) as cte
WHERE namespaces.id = cte.id
AND namespaces.traversal_ids <> cte.traversal_ids
AND namespaces.traversal_ids
::bigint[]
<> cte.traversal_ids
"""
Namespace
.
transaction
do
@root
.
lock!
...
...
@@ -51,7 +51,7 @@ class Namespace
def
incorrect_traversal_ids
Namespace
.
joins
(
"INNER JOIN (
#{
recursive_traversal_ids
}
) as cte ON namespaces.id = cte.id"
)
.
where
(
'namespaces.traversal_ids <> cte.traversal_ids'
)
.
where
(
'namespaces.traversal_ids
::bigint[]
<> cte.traversal_ids'
)
end
private
...
...
@@ -66,9 +66,9 @@ class Namespace
<<~
SQL
WITH RECURSIVE cte(id, traversal_ids, cycle) AS (
VALUES(
#{
root_id
}
, ARRAY[
#{
root_id
}
], false)
VALUES(
#{
root_id
}
::bigint, ARRAY[
#{
root_id
}
]::bigint[
], false)
UNION ALL
SELECT n.id, cte.traversal_ids || n.id, n.id = ANY(cte.traversal_ids)
SELECT n.id, cte.traversal_ids || n.id
::bigint
, n.id = ANY(cte.traversal_ids)
FROM namespaces n, cte
WHERE n.parent_id = cte.id AND NOT cycle
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment