summaryrefslogtreecommitdiff
path: root/storage/oqgraph/mysql-test/oqgraph/regression_796647b.result
blob: 2a5e632b674acd3f5fce40ccbe8c2126a12b7303 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
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   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';
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 count(*) FROM graph;
count(*)
8
SELECT count(*) FROM graph_base;
count(*)
8
INSERT INTO graph_base(from_id, to_id) VALUES (5,7);
INSERT INTO graph_base(from_id, to_id) VALUES (9,9);
INSERT INTO graph_base(from_id, to_id) VALUES (10,11);
INSERT INTO graph_base(from_id, to_id) VALUES (11,12);
INSERT INTO graph_base(from_id, to_id) VALUES (12,10);
SELECT count(*) FROM graph;
count(*)
13
SELECT count(*) FROM graph_base;
count(*)
13
INSERT INTO graph_base(from_id, to_id) VALUES (11,13);
INSERT INTO graph_base(from_id, to_id) VALUES (10,14);
INSERT INTO graph_base(from_id, to_id) VALUES (14,13);
SELECT count(*) FROM graph;
count(*)
16
SELECT count(*) FROM graph_base;
count(*)
16
DELETE FROM graph_base where from_id=10 and to_id=11;
INSERT INTO graph_base(from_id, to_id) VALUES (10,15);
INSERT INTO graph_base(from_id, to_id) VALUES (15,13);
INSERT INTO graph_base(from_id, to_id) VALUES (10,11);
SELECT count(*) FROM graph;
count(*)
18
SELECT count(*) FROM graph_base;
count(*)
18
INSERT INTO graph_base(from_id, to_id) VALUES (21,22);
INSERT INTO graph_base(from_id, to_id) VALUES (4,17);
INSERT INTO graph_base(from_id, to_id) VALUES (4,16);
INSERT INTO graph_base(from_id, to_id) VALUES (17,18);
INSERT INTO graph_base (from_id,to_id) VALUES (4,6);
SELECT count(*) FROM graph;
count(*)
23
SELECT count(*) FROM graph_base;
count(*)
23
SELECT * from graph;
latch	origid	destid	weight	seq	linkid
NULL	1	2	1	NULL	NULL
NULL	2	1	1	NULL	NULL
NULL	1	3	1	NULL	NULL
NULL	3	1	1	NULL	NULL
NULL	3	4	1	NULL	NULL
NULL	4	3	1	NULL	NULL
NULL	5	6	1	NULL	NULL
NULL	6	5	1	NULL	NULL
NULL	5	7	1	NULL	NULL
NULL	9	9	1	NULL	NULL
NULL	10	15	1	NULL	NULL
NULL	11	12	1	NULL	NULL
NULL	12	10	1	NULL	NULL
NULL	11	13	1	NULL	NULL
NULL	10	14	1	NULL	NULL
NULL	14	13	1	NULL	NULL
NULL	15	13	1	NULL	NULL
NULL	10	11	1	NULL	NULL
NULL	21	22	1	NULL	NULL
NULL	4	17	1	NULL	NULL
NULL	4	16	1	NULL	NULL
NULL	17	18	1	NULL	NULL
NULL	4	6	1	NULL	NULL
SELECT * from graph where latch='0';
latch	origid	destid	weight	seq	linkid
0	NULL	NULL	NULL	NULL	1
0	NULL	NULL	NULL	NULL	2
0	NULL	NULL	NULL	NULL	3
0	NULL	NULL	NULL	NULL	4
0	NULL	NULL	NULL	NULL	5
0	NULL	NULL	NULL	NULL	6
0	NULL	NULL	NULL	NULL	7
0	NULL	NULL	NULL	NULL	9
0	NULL	NULL	NULL	NULL	10
0	NULL	NULL	NULL	NULL	15
0	NULL	NULL	NULL	NULL	11
0	NULL	NULL	NULL	NULL	12
0	NULL	NULL	NULL	NULL	13
0	NULL	NULL	NULL	NULL	14
0	NULL	NULL	NULL	NULL	21
0	NULL	NULL	NULL	NULL	22
0	NULL	NULL	NULL	NULL	17
0	NULL	NULL	NULL	NULL	16
0	NULL	NULL	NULL	NULL	18
SELECT * from graph_base;
from_id	to_id
1	2
1	3
2	1
3	1
3	4
4	3
4	6
4	16
4	17
5	6
5	7
6	5
9	9
10	11
10	14
10	15
11	12
11	13
12	10
14	13
15	13
17	18
21	22
# And delete all references to node 5
DELETE FROM graph_base WHERE from_id=5;
DELETE FROM graph_base WHERE from_id=3 AND to_id=5;
# This is currently bogus:
SELECT count(*) FROM graph;
count(*)
21
SELECT count(*) FROM graph_base;
count(*)
21
SELECT * from graph;
latch	origid	destid	weight	seq	linkid
NULL	1	2	1	NULL	NULL
NULL	2	1	1	NULL	NULL
NULL	1	3	1	NULL	NULL
NULL	3	1	1	NULL	NULL
NULL	3	4	1	NULL	NULL
NULL	4	3	1	NULL	NULL
NULL	6	5	1	NULL	NULL
NULL	9	9	1	NULL	NULL
NULL	10	15	1	NULL	NULL
NULL	11	12	1	NULL	NULL
NULL	12	10	1	NULL	NULL
NULL	11	13	1	NULL	NULL
NULL	10	14	1	NULL	NULL
NULL	14	13	1	NULL	NULL
NULL	15	13	1	NULL	NULL
NULL	10	11	1	NULL	NULL
NULL	21	22	1	NULL	NULL
NULL	4	17	1	NULL	NULL
NULL	4	16	1	NULL	NULL
NULL	17	18	1	NULL	NULL
NULL	4	6	1	NULL	NULL
SELECT * from graph where latch='0';
latch	origid	destid	weight	seq	linkid
0	NULL	NULL	NULL	NULL	1
0	NULL	NULL	NULL	NULL	2
0	NULL	NULL	NULL	NULL	3
0	NULL	NULL	NULL	NULL	4
0	NULL	NULL	NULL	NULL	6
0	NULL	NULL	NULL	NULL	5
0	NULL	NULL	NULL	NULL	9
0	NULL	NULL	NULL	NULL	10
0	NULL	NULL	NULL	NULL	15
0	NULL	NULL	NULL	NULL	11
0	NULL	NULL	NULL	NULL	12
0	NULL	NULL	NULL	NULL	13
0	NULL	NULL	NULL	NULL	14
0	NULL	NULL	NULL	NULL	21
0	NULL	NULL	NULL	NULL	22
0	NULL	NULL	NULL	NULL	17
0	NULL	NULL	NULL	NULL	16
0	NULL	NULL	NULL	NULL	18
SELECT * from graph_base;
from_id	to_id
1	2
1	3
2	1
3	1
3	4
4	3
4	6
4	16
4	17
6	5
9	9
10	11
10	14
10	15
11	12
11	13
12	10
14	13
15	13
17	18
21	22
DELETE FROM graph_base;
FLUSH TABLES;
TRUNCATE TABLE graph_base;
DROP TABLE graph_base;
DROP TABLE graph;