Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
73f1cd66
Commit
73f1cd66
authored
Jun 29, 2013
by
Andrew McDonnell
Browse files
Options
Browse Files
Download
Plain Diff
Added tests for no_search - edges, out edges and in edges
parents
eda7f5eb
254cf762
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
mysql-test/suite/oqgraph/basic.test
mysql-test/suite/oqgraph/basic.test
+39
-0
No files found.
mysql-test/suite/oqgraph/basic.test
View file @
73f1cd66
...
...
@@ -61,6 +61,45 @@ INSERT INTO graph_base(from_id, to_id) VALUES (10,11);
INSERT
INTO
graph_base
(
from_id
,
to_id
)
VALUES
(
11
,
12
);
INSERT
INTO
graph_base
(
from_id
,
to_id
)
VALUES
(
12
,
10
);
--
echo
# Return all edges
#-- we note that when weight is NULL it defaults to 1
SELECT
*
FROM
graph
;
--
echo
# Currently count should be 13
SELECT
count
(
*
)
FROM
graph
;
# FIXME - this is currently returning empty instead of all edges
#--echo # Return all edges - in v2, NULL latch should do this, but v3 now returns nothing...
#SELECT * FROM graph where latch=NULL;
--
echo
# Return all vertices, and subsets of vertices
SELECT
*
FROM
graph
where
latch
=
'no_search'
;
--
echo
# Currently count should be 11
SELECT
count
(
*
)
FROM
graph
where
latch
=
'no_search'
;
#-- get a subset of vertices
SELECT
*
FROM
graph
where
latch
=
'no_search'
and
linkid
=
2
;
SELECT
*
FROM
graph
where
latch
=
'no_search'
and
(
linkid
>
2
and
linkid
<
6
);
#-- Query out-edges for vertex (no_search AND origid=N)
SELECT
origid
as
`from`
,
linkid
as
`to`
FROM
graph
where
latch
=
'no_search'
and
origid
=
1
;
SELECT
origid
as
`from`
,
linkid
as
`to`
FROM
graph
where
latch
=
'no_search'
and
origid
=
2
;
SELECT
origid
as
`from`
,
linkid
as
`to`
FROM
graph
where
latch
=
'no_search'
and
origid
=
4
;
SELECT
origid
as
`from`
,
linkid
as
`to`
FROM
graph
where
latch
=
'no_search'
and
origid
=
9
;
SELECT
origid
as
`from`
,
linkid
as
`to`
FROM
graph
where
latch
=
'no_search'
and
origid
=
10
;
#-- Query in-edges for vertex (no_search AND destid=N)
#-- linkid will have the other end
SELECT
linkid
as
`from`
,
destid
as
`to`
FROM
graph
where
latch
=
'no_search'
and
destid
=
1
;
SELECT
linkid
as
`from`
,
destid
as
`to`
FROM
graph
where
latch
=
'no_search'
and
destid
=
2
;
SELECT
linkid
as
`from`
,
destid
as
`to`
FROM
graph
where
latch
=
'no_search'
and
destid
=
4
;
SELECT
linkid
as
`from`
,
destid
as
`to`
FROM
graph
where
latch
=
'no_search'
and
destid
=
9
;
SELECT
linkid
as
`from`
,
destid
as
`to`
FROM
graph
where
latch
=
'no_search'
and
destid
=
10
;
# The following returns a result that makes no sense...
#-- what happens when we combined orig and dest?
#SELECT * FROM graph where latch='no_search' and origid = 1;
#SELECT * FROM graph where latch='no_search' and destid = 2;
#SELECT * FROM graph where latch='no_search' and origid=1 and destid = 2;
--
echo
# Breadth-first search tests
#-- We are asking "Is there a path from node 'origid' to (all) other nodes?"
#-- We return a row for each other node that is reachable, with its id in 'linkid'
...
...
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