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
55d9cfc8
Commit
55d9cfc8
authored
Aug 09, 2013
by
Andrew McDonnell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Regression test for 1196036 dijkstra weights
parent
a7074124
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
171 additions
and
0 deletions
+171
-0
mysql-test/suite/oqgraph/regression_1196036.result
mysql-test/suite/oqgraph/regression_1196036.result
+103
-0
mysql-test/suite/oqgraph/regression_1196036.test
mysql-test/suite/oqgraph/regression_1196036.test
+68
-0
No files found.
mysql-test/suite/oqgraph/regression_1196036.result
0 → 100644
View file @
55d9cfc8
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,
weight FLOAT NOT NULL,
PRIMARY KEY (from_id,to_id),
INDEX (to_id)
) ENGINE=MyISAM;
CREATE TABLE graph (
latch VARCHAR(32) NULL,
origid BIGINT UNSIGNED NULL,
destid BIGINT UNSIGNED NULL,
weight DOUBLE NULL,
seq BIGINT UNSIGNED NULL,
linkid BIGINT UNSIGNED NULL,
KEY (latch, origid, destid) USING HASH,
KEY (latch, destid, origid) USING HASH
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id', WEIGHT='weight';
INSERT INTO graph_base(from_id, to_id, weight) VALUES (1,2,16), (2,1,16);
INSERT INTO graph_base(from_id, to_id, weight) VALUES (2,3,256), (3,2,256);
INSERT INTO graph_base(from_id, to_id, weight) VALUES (3,4,65536), (4,3,65536);
INSERT INTO graph_base(from_id, to_id, weight) VALUES (2,4,768);
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1;
latch origid destid weight seq linkid
dijkstras 1 NULL 784 4 4
dijkstras 1 NULL 272 3 3
dijkstras 1 NULL 16 2 2
dijkstras 1 NULL 0 1 1
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2;
latch origid destid weight seq linkid
dijkstras 2 NULL 768 4 4
dijkstras 2 NULL 256 3 3
dijkstras 2 NULL 16 2 1
dijkstras 2 NULL 0 1 2
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3;
latch origid destid weight seq linkid
dijkstras 3 NULL 1024 4 4
dijkstras 3 NULL 272 3 1
dijkstras 3 NULL 256 2 2
dijkstras 3 NULL 0 1 3
SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 1;
latch origid destid weight seq linkid
dijkstras NULL 1 784 4 4
dijkstras NULL 1 272 3 3
dijkstras NULL 1 16 2 2
dijkstras NULL 1 0 1 1
SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 2;
latch origid destid weight seq linkid
dijkstras NULL 2 768 4 4
dijkstras NULL 2 256 3 3
dijkstras NULL 2 16 2 1
dijkstras NULL 2 0 1 2
SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 3;
latch origid destid weight seq linkid
dijkstras NULL 3 1024 4 4
dijkstras NULL 3 272 3 1
dijkstras NULL 3 256 2 2
dijkstras NULL 3 0 1 3
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and destid=3;
latch origid destid weight seq linkid
dijkstras 1 3 NULL 0 1
dijkstras 1 3 16 1 2
dijkstras 1 3 256 2 3
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and destid=4;
latch origid destid weight seq linkid
dijkstras 1 4 NULL 0 1
dijkstras 1 4 16 1 2
dijkstras 1 4 768 2 4
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and weight=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2 and weight=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3 and weight=1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and weight=16;
latch origid destid weight seq linkid
dijkstras 1 NULL 16 2 2
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2 and weight=16;
latch origid destid weight seq linkid
dijkstras 2 NULL 16 2 1
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3 and weight=16;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and weight=784;
latch origid destid weight seq linkid
dijkstras 1 NULL 784 4 4
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2 and weight=784;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3 and weight=784;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1 and weight=256;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2 and weight=256;
latch origid destid weight seq linkid
dijkstras 2 NULL 256 3 3
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3 and weight=256;
latch origid destid weight seq linkid
dijkstras 3 NULL 256 2 2
DELETE FROM graph_base;
FLUSH TABLES;
TRUNCATE TABLE graph_base;
DROP TABLE graph_base;
DROP TABLE graph;
mysql-test/suite/oqgraph/regression_1196036.test
0 → 100644
View file @
55d9cfc8
# Regression test for https://bugs.launchpad.net/oqgraph/+bug/1196036
#-- bug with Djikstras algorithm - find reachable vertices (origid=X) returns weight=0 instead of weight=count of hops
--
disable_warnings
DROP
TABLE
IF
EXISTS
graph_base
;
DROP
TABLE
IF
EXISTS
graph
;
--
enable_warnings
# Create the backing store
CREATE
TABLE
graph_base
(
from_id
INT
UNSIGNED
NOT
NULL
,
to_id
INT
UNSIGNED
NOT
NULL
,
weight
FLOAT
NOT
NULL
,
PRIMARY
KEY
(
from_id
,
to_id
),
INDEX
(
to_id
)
)
ENGINE
=
MyISAM
;
CREATE
TABLE
graph
(
latch
VARCHAR
(
32
)
NULL
,
origid
BIGINT
UNSIGNED
NULL
,
destid
BIGINT
UNSIGNED
NULL
,
weight
DOUBLE
NULL
,
seq
BIGINT
UNSIGNED
NULL
,
linkid
BIGINT
UNSIGNED
NULL
,
KEY
(
latch
,
origid
,
destid
)
USING
HASH
,
KEY
(
latch
,
destid
,
origid
)
USING
HASH
)
ENGINE
=
OQGRAPH
DATA_TABLE
=
'graph_base'
ORIGID
=
'from_id'
,
DESTID
=
'to_id'
,
WEIGHT
=
'weight'
;
INSERT
INTO
graph_base
(
from_id
,
to_id
,
weight
)
VALUES
(
1
,
2
,
16
),
(
2
,
1
,
16
);
INSERT
INTO
graph_base
(
from_id
,
to_id
,
weight
)
VALUES
(
2
,
3
,
256
),
(
3
,
2
,
256
);
INSERT
INTO
graph_base
(
from_id
,
to_id
,
weight
)
VALUES
(
3
,
4
,
65536
),
(
4
,
3
,
65536
);
INSERT
INTO
graph_base
(
from_id
,
to_id
,
weight
)
VALUES
(
2
,
4
,
768
);
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
1
and
destid
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
1
and
destid
=
4
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
1
and
weight
=
1
;
# <-- should return nothing
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
2
and
weight
=
1
;
# <-- should return nothing
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
3
and
weight
=
1
;
# <-- should return nothing
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
1
and
weight
=
16
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
2
and
weight
=
16
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
3
and
weight
=
16
;
# <-- should return nothing
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
1
and
weight
=
784
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
2
and
weight
=
784
;
# <-- should return nothing
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
3
and
weight
=
784
;
# <-- should return nothing
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
1
and
weight
=
256
;
# <-- should return nothing
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
2
and
weight
=
256
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
3
and
weight
=
256
;
DELETE
FROM
graph_base
;
FLUSH
TABLES
;
TRUNCATE
TABLE
graph_base
;
DROP
TABLE
graph_base
;
DROP
TABLE
graph
;
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