Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-mysqlbackend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-mysqlbackend
Commits
d511da7b
Verified
Commit
d511da7b
authored
5 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
EHN: versioning phase 5
parent
037ea62e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
procedures/retrieveEntityOverrides.sql
+7
-2
7 additions, 2 deletions
procedures/retrieveEntityOverrides.sql
procedures/retrieveEntityProperties.sql
+8
-2
8 additions, 2 deletions
procedures/retrieveEntityProperties.sql
tests/test_0_next_patch.sql
+39
-0
39 additions, 0 deletions
tests/test_0_next_patch.sql
with
54 additions
and
4 deletions
procedures/retrieveEntityOverrides.sql
+
7
−
2
View file @
d511da7b
...
...
@@ -35,13 +35,18 @@ retrieveOverridesBody: BEGIN
IF
is_feature_config
(
"ENTITY_VERSIONING"
,
"ENABLED"
)
THEN
IF
Version
IS
NOT
NULL
THEN
SELECT
get_head_version
(
EntityID
)
=
Version
INTO
IsHead
;
IF
DomainID
=
0
THEN
SELECT
get_head_version
(
EntityID
)
=
Version
INTO
IsHead
;
ELSE
SELECT
get_head_version
(
DomainID
)
=
Version
INTO
IsHead
;
END
IF
;
END
IF
;
IF
IsHead
IS
FALSE
THEN
SELECT
e
.
_iversion
INTO
IVersion
FROM
entity_version
as
e
WHERE
e
.
entity_id
=
EntityID
WHERE
((
e
.
entity_id
=
EntityID
AND
DomainID
=
0
)
OR
(
e
.
entity_id
=
DomainID
))
AND
e
.
version
=
Version
;
IF
IVersion
IS
NULL
THEN
...
...
This diff is collapsed.
Click to expand it.
procedures/retrieveEntityProperties.sql
+
8
−
2
View file @
d511da7b
...
...
@@ -37,13 +37,19 @@ retrieveEntityPropertiesBody: BEGIN
IF
is_feature_config
(
"ENTITY_VERSIONING"
,
"ENABLED"
)
THEN
IF
Version
IS
NOT
NULL
THEN
SELECT
get_head_version
(
EntityID
)
=
Version
INTO
IsHead
;
IF
DomainID
=
0
THEN
SELECT
get_head_version
(
EntityID
)
=
Version
INTO
IsHead
;
ELSE
SELECT
get_head_version
(
DomainID
)
=
Version
INTO
IsHead
;
END
IF
;
END
IF
;
IF
IsHead
IS
FALSE
THEN
SELECT
e
.
_iversion
INTO
IVersion
FROM
entity_version
as
e
WHERE
e
.
entity_id
=
EntityID
WHERE
((
e
.
entity_id
=
EntityID
AND
DomainID
=
0
)
OR
(
e
.
entity_id
=
DomainID
))
AND
e
.
version
=
Version
;
IF
IVersion
IS
NULL
THEN
...
...
This diff is collapsed.
Click to expand it.
tests/test_0_next_patch.sql
+
39
−
0
View file @
d511da7b
...
...
@@ -358,6 +358,45 @@ BEGIN
END
//
DROP
PROCEDURE
IF
EXISTS
retrieveQueryTemplateDef
//
CREATE
PROCEDURE
retrieveQueryTemplateDef
(
in
EntityID
INT
UNSIGNED
,
in
Version
VARBINARY
(
255
))
retrieveQueryTemplateDefBody
:
BEGIN
DECLARE
IVersion
INT
UNSIGNED
DEFAULT
NULL
;
DECLARE
IsHead
BOOLEAN
DEFAULT
TRUE
;
IF
is_feature_config
(
"ENTITY_VERSIONING"
,
"ENABLED"
)
THEN
IF
Version
IS
NOT
NULL
THEN
SELECT
get_head_version
(
EntityID
)
=
Version
INTO
IsHead
;
END
IF
;
IF
IsHead
IS
FALSE
THEN
SELECT
e
.
_iversion
INTO
IVersion
FROM
entity_version
as
e
WHERE
e
.
entity_id
=
EntityID
AND
e
.
version
=
Version
;
IF
IVersion
IS
NULL
THEN
-- RETURN EARLY - Version does not exist.
LEAVE
retrieveQueryTemplateDefBody
;
END
IF
;
SELECT
definition
FROM
archive_query_template_def
WHERE
id
=
EntityID
AND
_iversion
=
IVersion
;
LEAVE
retrieveQueryTemplateDefBody
;
END
IF
;
END
IF
;
SELECT
definition
FROM
query_template_def
WHERE
id
=
EntityID
;
END
//
delimiter
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment