1
drop table if exists graph;
3
Note 1051 Unknown table 'graph'
5
latch SMALLINT UNSIGNED NULL,
6
origid BIGINT UNSIGNED NULL,
7
destid BIGINT UNSIGNED NULL,
9
seq BIGINT UNSIGNED NULL,
10
linkid BIGINT UNSIGNED NULL,
11
KEY (latch, origid, destid) USING HASH,
12
KEY (latch, destid, origid) USING HASH
15
insert into graph(origid, destid) values (1,2), (2,1);
16
insert into graph(origid, destid) values (1,3), (3,1);
17
insert into graph(origid, destid) values (3,4), (4,3);
18
insert into graph(origid, destid) values (3,5), (5,3);
19
insert into graph(origid, destid) values (5,6), (6,5);
20
select * from graph where latch = 2 and origid = 1 and weight = 1;
21
latch origid destid weight seq linkid
24
select * from graph where latch = 2 and origid = 1 and weight = 2;
25
latch origid destid weight seq linkid
29
where latch = 2 and origid = 1 and (weight = 1 or weight = 2);
30
latch origid destid weight seq linkid
35
select * from graph where latch=1 and origid=1 and destid=6;
36
latch origid destid weight seq linkid
41
select * from graph where latch=1 and origid=1 and destid=4;
42
latch origid destid weight seq linkid
46
select * from graph where latch=1 and origid=4 and destid=1;
47
latch origid destid weight seq linkid
51
insert into graph (origid,destid) values (4,6);
52
delete from graph where origid=5;
53
delete from graph where origid=3 and destid=5;
54
select * from graph where latch=1 and origid=1 and destid=6;
55
latch origid destid weight seq linkid
60
select * from graph where latch=1 and origid=6 and destid=1;
61
latch origid destid weight seq linkid