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
09c88b76
Verified
Commit
09c88b76
authored
1 year ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: String IDs
parent
918af4df
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!17
Release 6.0
,
!15
External String IDs
,
!11
DRAFT: file system cleanup
Pipeline
#41812
failed
1 year ago
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
procedures/query/applyIDFilter.sql
+10
-4
10 additions, 4 deletions
procedures/query/applyIDFilter.sql
with
10 additions
and
4 deletions
procedures/query/applyIDFilter.sql
+
10
−
4
View file @
09c88b76
...
...
@@ -55,6 +55,7 @@ IDFILTER_LABEL: BEGIN
DECLARE
data
VARCHAR
(
20000
)
DEFAULT
NULL
;
DECLARE
aggVal
VARCHAR
(
255
)
DEFAULT
NULL
;
DECLARE
direction
CHAR
(
4
)
DEFAULT
NULL
;
DECLARE
entity_id_type
VARCHAR
(
255
)
DEFAULT
"eids.id "
;
#
-- get aggVal if possible
IF
agg
IS
NOT
NULL
THEN
...
...
@@ -82,6 +83,10 @@ IF agg IS NOT NULL THEN
SET
aggVal
=
@
sAggVal
;
END
IF
;
IF
o
=
">"
OR
o
=
">="
OR
o
=
"<"
or
o
=
"<="
THEN
SET
entity_id_type
=
"CAST(eids.id AS UNSIGNED INT) "
;
END
IF
;
#
-- generate stmt string
IF
targetSet
IS
NULL
OR
targetSet
=
sourceSet
THEN
SET
data
=
CONCAT
(
...
...
@@ -90,7 +95,8 @@ IF targetSet IS NULL OR targetSet = sourceSet THEN
"` WHERE "
,
IF
(
o
IS
NULL
OR
EntityID
IS
NULL
,
"1=1"
,
CONCAT
(
"NOT EXISTS (SELECT 1 FROM entity_ids AS eids WHERE eids.id "
,
CONCAT
(
"NOT EXISTS (SELECT 1 FROM entity_ids AS eids WHERE "
,
entity_id_type
,
o
,
' "'
,
EntityID
,
...
...
@@ -111,7 +117,7 @@ ELSEIF versioned AND sourceSet = "entities" THEN
'` (id, _iversion) SELECT e.id, _get_head_iversion(e.id) FROM `entities` AS e JOIN entity_ids AS eids ON (e.id = eids.internal_id) WHERE '
,
IF
(
o
IS
NULL
OR
EntityID
IS
NULL
,
"1=1"
,
CONCAT
(
"eids.id "
,
CONCAT
(
entity_id_type
,
o
,
' "'
,
EntityID
,
...
...
@@ -124,7 +130,7 @@ ELSEIF versioned AND sourceSet = "entities" THEN
' UNION SELECT e.id, _iversion FROM `archive_entities` AS e JOIN entity_ids AS eids ON (e.id = eids.internal_id) WHERE '
,
IF
(
o
IS
NULL
OR
EntityID
IS
NULL
,
"1=1"
,
CONCAT
(
"eids.id "
,
CONCAT
(
entity_id_type
,
o
,
' "'
,
EntityID
,
...
...
@@ -147,7 +153,7 @@ ELSE
"` AS data JOIN entity_ids AS eids ON (eids.internal_id = data.id) WHERE "
,
IF
(
o
IS
NULL
OR
EntityID
IS
NULL
,
"1=1"
,
CONCAT
(
"eids.id"
,
CONCAT
(
entity_id_type
,
o
,
' "'
,
EntityID
,
...
...
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