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
82614136
Commit
82614136
authored
Jun 15, 2014
by
Andrew McDonnell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added regression test for MDEV-6282
parent
1973c009
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
0 deletions
+84
-0
storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.result
...age/oqgraph/mysql-test/oqgraph/regression_mdev6282.result
+37
-0
storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.test
storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.test
+47
-0
No files found.
storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.result
0 → 100644
View file @
82614136
CREATE TABLE `db_history` (
`version` VARCHAR(10) NOT NULL,
`updateJSON` MEDIUMTEXT,
`prevVersion` VARCHAR(10) NOT NULL,
`nodeID` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
`prevNodeID` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`prevNodeID`,`nodeID`),
KEY `version` (`version`) USING BTREE,
KEY `prevVersion` (`prevVersion`) USING BTREE,
KEY `nodeID` (`nodeID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `db_history` VALUES
('0.0.1','{}','0.0.0',1,0),
('0.0.2','{\"data\":{\"add\":{},\"update\":{},\"delete\":{}}}','0.0.1',2,1),
('0.0.3','{\"data\":{\"add\":{},\"update\":{},\"delete\":{}}}','0.0.2',3,2);
CREATE TABLE IF NOT EXISTS version_history (
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='db_history' ORIGID='prevNodeID' DESTID='nodeID';
SELECT `db`.`version`, `db`.`nodeID`
FROM `version_history` AS `v` INNER JOIN `db_history` AS `db` ON `db`.`nodeID` = `v`.`linkid`
WHERE `latch` = 'breadth_first' AND `origid` = '1' ORDER BY `weight` DESC LIMIT 1;
version nodeID
0.0.3 3
SELECT `db`.`version`, `db`.`nodeID`
FROM `version_history` AS `v` INNER JOIN `db_history` AS `db` ON `db`.`nodeID` = `v`.`linkid`
WHERE `latch` = 'breadth_first' AND `origid` = '1' ORDER BY `weight` DESC LIMIT 1;
version nodeID
0.0.3 3
DROP TABLE db_history;
DROP TABLE version_history;
storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.test
0 → 100644
View file @
82614136
--
connect
(
con1
,
localhost
,
root
,,
test
)
CREATE
TABLE
`db_history`
(
`version`
VARCHAR
(
10
)
NOT
NULL
,
`updateJSON`
MEDIUMTEXT
,
`prevVersion`
VARCHAR
(
10
)
NOT
NULL
,
`nodeID`
BIGINT
(
20
)
UNSIGNED
NOT
NULL
DEFAULT
'0'
,
`prevNodeID`
BIGINT
(
20
)
UNSIGNED
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`prevNodeID`
,
`nodeID`
),
KEY
`version`
(
`version`
)
USING
BTREE
,
KEY
`prevVersion`
(
`prevVersion`
)
USING
BTREE
,
KEY
`nodeID`
(
`nodeID`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
;
INSERT
INTO
`db_history`
VALUES
(
'0.0.1'
,
'{}'
,
'0.0.0'
,
1
,
0
),
(
'0.0.2'
,
'{\"data\":{\"add\":{},\"update\":{},\"delete\":{}}}'
,
'0.0.1'
,
2
,
1
),
(
'0.0.3'
,
'{\"data\":{\"add\":{},\"update\":{},\"delete\":{}}}'
,
'0.0.2'
,
3
,
2
);
CREATE
TABLE
IF
NOT
EXISTS
version_history
(
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
=
'db_history'
ORIGID
=
'prevNodeID'
DESTID
=
'nodeID'
;
SELECT
`db`
.
`version`
,
`db`
.
`nodeID`
FROM
`version_history`
AS
`v`
INNER
JOIN
`db_history`
AS
`db`
ON
`db`
.
`nodeID`
=
`v`
.
`linkid`
WHERE
`latch`
=
'breadth_first'
AND
`origid`
=
'1'
ORDER
BY
`weight`
DESC
LIMIT
1
;
--
disconnect
con1
--
connect
(
con2
,
localhost
,
root
,,
test
)
SELECT
`db`
.
`version`
,
`db`
.
`nodeID`
FROM
`version_history`
AS
`v`
INNER
JOIN
`db_history`
AS
`db`
ON
`db`
.
`nodeID`
=
`v`
.
`linkid`
WHERE
`latch`
=
'breadth_first'
AND
`origid`
=
'1'
ORDER
BY
`weight`
DESC
LIMIT
1
;
--
disconnect
con2
--
connect
(
con3
,
localhost
,
root
,,
test
)
DROP
TABLE
db_history
;
DROP
TABLE
version_history
;
--
disconnect
con3
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