summaryrefslogtreecommitdiff
path: root/mysql-test/suite/oqgraph/r/basic.result
blob: e90659c0986dd6b440358f9d250084f9e74b747e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
drop table if exists graph;
Warnings:
Note	1051	Unknown table 'graph'
CREATE TABLE graph (
latch   SMALLINT  UNSIGNED 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;
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;
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;
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);
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;
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;
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;
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 origid=5;
delete from graph where origid=3 and destid=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;
latch	origid	destid	weight	seq	linkid
truncate table graph;
drop table graph;