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
a4b5836b
Commit
a4b5836b
authored
May 24, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: Fix FDW schema check when tables and columns are not in the same order
parent
a097c137
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
ee/changelogs/unreleased/sh-improve-fdw-comparison.yml
ee/changelogs/unreleased/sh-improve-fdw-comparison.yml
+5
-0
ee/lib/gitlab/geo/fdw.rb
ee/lib/gitlab/geo/fdw.rb
+1
-1
ee/spec/lib/gitlab/geo/fdw_spec.rb
ee/spec/lib/gitlab/geo/fdw_spec.rb
+13
-0
No files found.
ee/changelogs/unreleased/sh-improve-fdw-comparison.yml
0 → 100644
View file @
a4b5836b
---
title
:
'
Geo:
Fix
FDW
schema
check
when
tables
and
columns
are
not
in
the
same
order'
merge_request
:
author
:
type
:
fixed
ee/lib/gitlab/geo/fdw.rb
View file @
a4b5836b
...
...
@@ -75,7 +75,7 @@ module Gitlab
Gitlab
::
Geo
.
cache_value
(
:geo_fdw_schema_tables_match
)
do
schema
=
gitlab_schema
schema
.
present?
&&
schema
==
fdw_schema
schema
.
present?
&&
(
schema
.
to_set
==
fdw_schema
.
to_set
)
end
end
...
...
ee/spec/lib/gitlab/geo/fdw_spec.rb
View file @
a4b5836b
...
...
@@ -172,6 +172,19 @@ describe Gitlab::Geo::Fdw, :geo do
# rake geo:db:test:refresh_foreign_tables
expect
(
described_class
.
foreign_schema_tables_match?
).
to
be_truthy
end
it
'returns true if order is different'
do
one_schema
=
[
{
"table_name"
=>
"events"
,
"column_name"
=>
"target_type"
,
"data_type"
=>
"character varying"
},
{
"table_name"
=>
"ci_job_artifacts"
,
"column_name"
=>
"id"
,
"data_type"
=>
"integer"
}
]
second_schema
=
one_schema
.
reverse
allow
(
described_class
).
to
receive
(
:gitlab_schema
).
and_return
(
one_schema
)
allow
(
described_class
).
to
receive
(
:fdw_schema
).
and_return
(
second_schema
)
expect
(
described_class
.
foreign_schema_tables_match?
).
to
be_truthy
end
end
end
end
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