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
190571f2
Verified
Commit
190571f2
authored
4 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: retrieve versioning history
parent
6d11e4f5
Branches
f-retrieve-history
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
procedures/entityVersioning.sql
+8
-2
8 additions, 2 deletions
procedures/entityVersioning.sql
procedures/retrieveEntity.sql
+11
-3
11 additions, 3 deletions
procedures/retrieveEntity.sql
with
19 additions
and
5 deletions
procedures/entityVersioning.sql
+
8
−
2
View file @
190571f2
...
...
@@ -317,7 +317,10 @@ BEGIN
SELECT
c
.
version
AS
child
,
NULL
as
parent
,
t
.
seconds
AS
child_seconds
,
t
.
nanos
AS
child_nanos
t
.
nanos
AS
child_nanos
,
t
.
srid
AS
child_srid
,
t
.
username
as
child_username
,
t
.
realm
as
child_realm
FROM
entity_version
AS
c
INNER
JOIN
transactions
as
t
ON
(
c
.
srid
=
t
.
srid
)
WHERE
c
.
entity_id
=
EntityID
...
...
@@ -331,7 +334,10 @@ BEGIN
UNION
SELECT
c
.
version
AS
child
,
p
.
version
AS
parent
,
t
.
seconds
AS
child_seconds
,
t
.
nanos
AS
child_nanos
t
.
nanos
AS
child_nanos
,
t
.
srid
AS
child_srid
,
t
.
username
as
child_username
,
t
.
realm
as
child_realm
FROM
entity_version
AS
p
INNER
JOIN
entity_version
as
c
INNER
JOIN
transactions
AS
t
...
...
This diff is collapsed.
Click to expand it.
procedures/retrieveEntity.sql
+
11
−
3
View file @
190571f2
...
...
@@ -55,6 +55,9 @@ retrieveEntityBody: BEGIN
DECLARE
CollectionName
VARCHAR
(
255
)
DEFAULT
NULL
;
DECLARE
VersionSeconds
BIGINT
UNSIGNED
DEFAULT
NULL
;
DECLARE
VersionNanos
INT
(
10
)
UNSIGNED
DEFAULT
NULL
;
DECLARE
VersionUser
VARBINARY
(
255
)
DEFAULT
NULL
;
DECLARE
VersionRealm
VARBINARY
(
255
)
DEFAULT
NULL
;
DECLARE
VersionSRID
VARBINARY
(
255
)
DEFAULT
NULL
;
DECLARE
IsHead
BOOLEAN
DEFAULT
TRUE
;
DECLARE
IVersion
INT
UNSIGNED
DEFAULT
NULL
;
...
...
@@ -70,14 +73,16 @@ retrieveEntityBody: BEGIN
SELECT
get_head_version
(
EntityID
)
=
Version
INTO
IsHead
;
END
IF
;
SELECT
t
.
seconds
,
t
.
nanos
INTO
VersionSeconds
,
VersionNanos
SELECT
t
.
seconds
,
t
.
nanos
,
t
.
username
,
t
.
realm
,
t
.
srid
INTO
VersionSeconds
,
VersionNanos
,
VersionUser
,
VersionRealm
,
VersionSRID
FROM
entity_version
AS
e
INNER
JOIN
transactions
AS
t
ON
(
e
.
srid
=
t
.
srid
)
WHERE
e
.
entity_id
=
EntityID
AND
e
.
version
=
Version
;
IF
IsHead
IS
FALSE
THEN
SET
IVersion
=
get_iversion
(
EntityID
,
Version
);
...
...
@@ -189,7 +194,10 @@ retrieveEntityBody: BEGIN
(
SELECT
acl
FROM
entity_acl
AS
a
WHERE
a
.
id
=
e
.
acl
)
AS
ACL
,
Version
AS
Version
,
VersionSeconds
AS
VersionSeconds
,
VersionNanos
AS
VersionNanos
VersionNanos
AS
VersionNanos
,
VersionUser
AS
VersionUser
,
VersionRealm
AS
VersionRealm
,
VersionSRID
AS
VersionSRID
FROM
entities
e
WHERE
id
=
EntityID
LIMIT
1
;
END
;
//
...
...
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