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
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
Kirill Smelkov
mariadb
Commits
c1184ee3
Commit
c1184ee3
authored
Mar 01, 2013
by
Arjen Lentz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated oqgraph basic test for v3
parent
219a00b1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
51 deletions
+61
-51
mysql-test/suite/oqgraph/r/basic.result
mysql-test/suite/oqgraph/r/basic.result
+31
-28
mysql-test/suite/oqgraph/t/basic.test
mysql-test/suite/oqgraph/t/basic.test
+30
-23
No files found.
mysql-test/suite/oqgraph/r/basic.result
View file @
c1184ee3
drop table if exists graph;
DROP TABLE IF EXISTS graph_base;
Warnings:
Note 1051 Unknown table 'graph_base'
DROP TABLE IF EXISTS graph;
Warnings:
Note 1051 Unknown table 'graph'
CREATE TABLE graph_base (
from_id INT UNSIGNED NOT NULL,
to_id INT UNSIGNED NOT NULL,
PRIMARY KEY (from_id,to_id),
INDEX (to_id)
) ENGINE=MyISAM;
CREATE TABLE graph (
latch SMALLINT UNSIGNED NULL,
origid BIGINT UNSIGNED NULL,
...
...
@@ -10,54 +19,48 @@ seq BIGINT UNSIGNED NULL,
linkid BIGINT UNSIGNED NULL,
KEY (latch, origid, destid) USING HASH,
KEY (latch, destid, origid) USING HASH
) ENGINE=OQGRAPH;
delete from graph;
insert into graph(origid, destid) values (1,2), (2,1);
insert into graph(origid, destid) values (1,3), (3,1);
insert into graph(origid, destid) values (3,4), (4,3);
insert into graph(origid, destid) values (3,5), (5,3);
insert into graph(origid, destid) values (5,6), (6,5);
select * from graph where latch = 2 and origid = 1 and weight = 1;
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id';
INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1);
INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1);
INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3);
INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5);
SELECT * FROM graph WHERE latch = 2 AND origid = 1 AND weight = 1;
latch origid destid weight seq linkid
2 1 NULL 1 3 3
2 1 NULL 1 2 2
select * from graph where latch = 2 and origid = 1 and
weight = 2;
SELECT * FROM graph WHERE latch = 2 AND origid = 1 AND
weight = 2;
latch origid destid weight seq linkid
2 1 NULL 2 5 5
2 1 NULL 2 4 4
select * from graph
where latch = 2 and origid = 1 and (weight = 1 or weight = 2);
SELECT * FROM graph WHERE latch = 2 AND origid = 1 AND (weight = 1 OR weight = 2);
latch origid destid weight seq linkid
2 1 NULL 2 5 5
2 1 NULL 2 4 4
2 1 NULL 1 3 3
2 1 NULL 1 2 2
select * from graph where latch=1 and origid=1 and
destid=6;
SELECT * FROM graph WHERE latch=1 AND origid=1 AND
destid=6;
latch origid destid weight seq linkid
1 1 6 NULL 0 1
1 1 6 1 1 3
1 1 6 1 2 5
1 1 6 1 3 6
select * from graph where latch=1 and origid=1 and destid=4;
SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=4;
latch origid destid weight seq linkid
1 1 4 NULL 0 1
1 1 4 1 1 3
1 1 4 1 2 4
select * from graph where latch=1 and origid=4 and
destid=1;
SELECT * FROM graph WHERE latch=1 AND origid=4 AND
destid=1;
latch origid destid weight seq linkid
1 4 1 NULL 0 4
1 4 1 1 1 3
1 4 1 1 2 1
insert into graph (origid,destid) values
(4,6);
delete from graph where orig
id=5;
delete from graph where origid=3 and dest
id=5;
select * from graph where latch=1 and origid=1 and
destid=6;
INSERT INTO graph_base (from_id,to_id) VALUES
(4,6);
DELETE FROM graph_base WHERE from_
id=5;
DELETE FROM graph_base WHERE from_id=3 AND to_
id=5;
SELECT * FROM graph WHERE latch=1 AND origid=1 AND
destid=6;
latch origid destid weight seq linkid
1 1 6 NULL 0 1
1 1 6 1 1 3
1 1 6 1 2 4
1 1 6 1 3 6
select * from graph where latch=1 and origid=6 and
destid=1;
SELECT * FROM graph WHERE latch=1 AND origid=6 AND
destid=1;
latch origid destid weight seq linkid
truncate table graph;
drop table graph;
DELETE FROM graph_base;
FLUSH TABLES;
TRUNCATE TABLE graph_base;
DROP TABLE graph;
DROP TABLE graph_base;
mysql-test/suite/oqgraph/t/basic.test
View file @
c1184ee3
drop
table
if
exists
graph
;
DROP
TABLE
IF
EXISTS
graph_base
;
DROP
TABLE
IF
EXISTS
graph
;
CREATE
TABLE
graph_base
(
from_id
INT
UNSIGNED
NOT
NULL
,
to_id
INT
UNSIGNED
NOT
NULL
,
PRIMARY
KEY
(
from_id
,
to_id
),
INDEX
(
to_id
)
)
ENGINE
=
MyISAM
;
CREATE
TABLE
graph
(
latch
SMALLINT
UNSIGNED
NULL
,
...
...
@@ -9,35 +17,34 @@ CREATE TABLE graph (
linkid
BIGINT
UNSIGNED
NULL
,
KEY
(
latch
,
origid
,
destid
)
USING
HASH
,
KEY
(
latch
,
destid
,
origid
)
USING
HASH
)
ENGINE
=
OQGRAPH
;
delete
from
graph
;
)
ENGINE
=
OQGRAPH
DATA_TABLE
=
'graph_base'
ORIGID
=
'from_id'
,
DESTID
=
'to_id'
;
insert
into
graph
(
origid
,
destid
)
values
(
1
,
2
),
(
2
,
1
);
insert
into
graph
(
origid
,
destid
)
values
(
1
,
3
),
(
3
,
1
);
insert
into
graph
(
origid
,
destid
)
values
(
3
,
4
),
(
4
,
3
);
insert
into
graph
(
origid
,
destid
)
values
(
3
,
5
),
(
5
,
3
);
insert
into
graph
(
origid
,
destid
)
values
(
5
,
6
),
(
6
,
5
);
INSERT
INTO
graph_base
(
from_id
,
to_id
)
VALUES
(
1
,
2
),
(
2
,
1
);
INSERT
INTO
graph_base
(
from_id
,
to_id
)
VALUES
(
1
,
3
),
(
3
,
1
);
INSERT
INTO
graph_base
(
from_id
,
to_id
)
VALUES
(
3
,
4
),
(
4
,
3
);
INSERT
INTO
graph_base
(
from_id
,
to_id
)
VALUES
(
5
,
6
),
(
6
,
5
);
select
*
from
graph
where
latch
=
2
and
origid
=
1
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
2
AND
origid
=
1
AND
weight
=
1
;
select
*
from
graph
where
latch
=
2
and
origid
=
1
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
2
AND
origid
=
1
AND
weight
=
2
;
select
*
from
graph
where
latch
=
2
and
origid
=
1
and
(
weight
=
1
or
weight
=
2
);
SELECT
*
FROM
graph
WHERE
latch
=
2
AND
origid
=
1
AND
(
weight
=
1
OR
weight
=
2
);
select
*
from
graph
where
latch
=
1
and
origid
=
1
and
destid
=
6
;
select
*
from
graph
where
latch
=
1
and
origid
=
1
and
destid
=
4
;
select
*
from
graph
where
latch
=
1
and
origid
=
4
and
destid
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
1
AND
origid
=
1
AND
destid
=
6
;
SELECT
*
FROM
graph
WHERE
latch
=
1
AND
origid
=
1
AND
destid
=
4
;
SELECT
*
FROM
graph
WHERE
latch
=
1
AND
origid
=
4
AND
destid
=
1
;
insert
into
graph
(
origid
,
destid
)
values
(
4
,
6
);
INSERT
INTO
graph_base
(
from_id
,
to_id
)
VALUES
(
4
,
6
);
delete
from
graph
where
orig
id
=
5
;
delete
from
graph
where
origid
=
3
and
dest
id
=
5
;
DELETE
FROM
graph_base
WHERE
from_
id
=
5
;
DELETE
FROM
graph_base
WHERE
from_id
=
3
AND
to_
id
=
5
;
select
*
from
graph
where
latch
=
1
and
origid
=
1
and
destid
=
6
;
select
*
from
graph
where
latch
=
1
and
origid
=
6
and
destid
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
1
AND
origid
=
1
AND
destid
=
6
;
SELECT
*
FROM
graph
WHERE
latch
=
1
AND
origid
=
6
AND
destid
=
1
;
truncate
table
graph
;
DELETE
FROM
graph_base
;
FLUSH
TABLES
;
TRUNCATE
TABLE
graph_base
;
drop
table
graph
;
DROP
TABLE
graph
;
DROP
TABLE
graph_base
;
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