Skip to content

Commit fb04cad

Browse files
committed
trying to stabilize floating-point tests
1 parent f867c2a commit fb04cad

File tree

4 files changed

+182
-160
lines changed

4 files changed

+182
-160
lines changed

mysql-test/main/vector.result

Lines changed: 140 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ id hex(v) vec_totext(v)
108108
flush tables;
109109
select id,vec_distance_euclidean(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
110110
id d
111-
9 0.4719976290006591
112-
10 0.5069011044450041
113-
3 0.5865673124650332
111+
9 0.47199
112+
10 0.50690
113+
3 0.58656
114114
select id,vec_distance_euclidean(x'b047263C9f87233fcfd27e3eae493e3f0329f43e', v) d from t1 order by d limit 3;
115115
id d
116-
9 0.4719976290006591
117-
10 0.5069011044450041
118-
3 0.5865673124650332
116+
9 0.47199
117+
10 0.50690
118+
3 0.58656
119119
select id>0,vec_distance_euclidean(v, NULL) d from t1 order by d limit 3;
120120
id>0 d
121121
1 NULL
@@ -138,156 +138,156 @@ id1 id2 vec_distance_euclidean(t1.v, t2.v)
138138
8 8 0
139139
9 9 0
140140
10 10 0
141-
7 10 0.35209010323904116
142-
10 7 0.35209010323904116
143-
1 7 0.557267332724855
144-
7 1 0.557267332724855
145-
2 3 0.6065128837978769
146-
3 2 0.6065128837978769
147-
1 3 0.6128238020507096
148-
3 1 0.6128238020507096
149-
5 8 0.6219995745138945
150-
8 5 0.6219995745138945
151-
3 10 0.6523185662547816
152-
10 3 0.6523185662547816
153-
9 10 0.6732681362788765
154-
10 9 0.6732681362788765
155-
3 7 0.6799892416547949
156-
7 3 0.6799892416547949
157-
3 9 0.6820752294088018
158-
9 3 0.6820752294088018
159-
2 10 0.6916305331777215
160-
10 2 0.6916305331777215
161-
2 9 0.6966650510789955
162-
9 2 0.6966650510789955
163-
3 6 0.7102823580937639
164-
6 3 0.7102823580937639
165-
2 7 0.7120217580666971
166-
7 2 0.7120217580666971
167-
2 6 0.7351618106552689
168-
6 2 0.7351618106552689
169-
1 10 0.7386864491588024
170-
10 1 0.7386864491588024
171-
4 6 0.7784357824370262
172-
6 4 0.7784357824370262
173-
4 8 0.7795837407361241
174-
8 4 0.7795837407361241
175-
4 5 0.8132007346697969
176-
5 4 0.8132007346697969
177-
2 4 0.8260925223296488
178-
4 2 0.8260925223296488
179-
5 10 0.8286488932765299
180-
10 5 0.8286488932765299
181-
5 9 0.8769351333060768
182-
9 5 0.8769351333060768
183-
1 6 0.8861410875047832
184-
6 1 0.8861410875047832
185-
3 5 0.9224201772876247
186-
5 3 0.9224201772876247
187-
4 7 0.9347916246876117
188-
7 4 0.9347916246876117
189-
7 9 0.9364253407685257
190-
9 7 0.9364253407685257
191-
3 4 0.9757105842688992
192-
4 3 0.9757105842688992
193-
1 2 0.9810272439433514
194-
2 1 0.9810272439433514
195-
1 4 0.9965475544626712
196-
4 1 0.9965475544626712
197-
5 7 0.9976863778073342
198-
7 5 0.9976863778073342
199-
4 10 1.0109345944029724
200-
10 4 1.0109345944029724
201-
1 5 1.0208359400987237
202-
5 1 1.0208359400987237
203-
6 7 1.0221332668982412
204-
7 6 1.0221332668982412
205-
2 5 1.050769316594881
206-
5 2 1.050769316594881
207-
6 8 1.103420381318026
208-
8 6 1.103420381318026
209-
3 8 1.1170300826294572
210-
8 3 1.1170300826294572
211-
6 10 1.1523451990991307
212-
10 6 1.1523451990991307
213-
1 9 1.1637750565139302
214-
9 1 1.1637750565139302
215-
2 8 1.1736571017573874
216-
8 2 1.1736571017573874
217-
4 9 1.1746893942711878
218-
9 4 1.1746893942711878
219-
1 8 1.1909959973982214
220-
8 1 1.1909959973982214
221-
8 10 1.209359617652948
222-
10 8 1.209359617652948
223-
6 9 1.214529873940304
224-
9 6 1.214529873940304
225-
5 6 1.227278506501395
226-
6 5 1.227278506501395
227-
8 9 1.2575258643523053
228-
9 8 1.2575258643523053
229-
7 8 1.288239696195716
230-
8 7 1.288239696195716
141+
7 10 0.35209
142+
10 7 0.35209
143+
1 7 0.55726
144+
7 1 0.55726
145+
2 3 0.60651
146+
3 2 0.60651
147+
1 3 0.61282
148+
3 1 0.61282
149+
5 8 0.62199
150+
8 5 0.62199
151+
3 10 0.65231
152+
10 3 0.65231
153+
9 10 0.67326
154+
10 9 0.67326
155+
3 7 0.67998
156+
7 3 0.67998
157+
3 9 0.68207
158+
9 3 0.68207
159+
2 10 0.69163
160+
10 2 0.69163
161+
2 9 0.69666
162+
9 2 0.69666
163+
3 6 0.71028
164+
6 3 0.71028
165+
2 7 0.71202
166+
7 2 0.71202
167+
2 6 0.73516
168+
6 2 0.73516
169+
1 10 0.73868
170+
10 1 0.73868
171+
4 6 0.77843
172+
6 4 0.77843
173+
4 8 0.77958
174+
8 4 0.77958
175+
4 5 0.81320
176+
5 4 0.81320
177+
2 4 0.82609
178+
4 2 0.82609
179+
5 10 0.82864
180+
10 5 0.82864
181+
5 9 0.87693
182+
9 5 0.87693
183+
1 6 0.88614
184+
6 1 0.88614
185+
3 5 0.92242
186+
5 3 0.92242
187+
4 7 0.93479
188+
7 4 0.93479
189+
7 9 0.93642
190+
9 7 0.93642
191+
3 4 0.97571
192+
4 3 0.97571
193+
1 2 0.98102
194+
2 1 0.98102
195+
1 4 0.99654
196+
4 1 0.99654
197+
5 7 0.99768
198+
7 5 0.99768
199+
4 10 1.01093
200+
10 4 1.01093
201+
1 5 1.02083
202+
5 1 1.02083
203+
6 7 1.02213
204+
7 6 1.02213
205+
2 5 1.05076
206+
5 2 1.05076
207+
6 8 1.10342
208+
8 6 1.10342
209+
3 8 1.11703
210+
8 3 1.11703
211+
6 10 1.15234
212+
10 6 1.15234
213+
1 9 1.16377
214+
9 1 1.16377
215+
2 8 1.17365
216+
8 2 1.17365
217+
4 9 1.17468
218+
9 4 1.17468
219+
1 8 1.19099
220+
8 1 1.19099
221+
8 10 1.20935
222+
10 8 1.20935
223+
6 9 1.21452
224+
9 6 1.21452
225+
5 6 1.22727
226+
6 5 1.22727
227+
8 9 1.25752
228+
9 8 1.25752
229+
7 8 1.28823
230+
8 7 1.28823
231231
select * from (
232232
select id,vec_distance_euclidean(v, x'b047263C9F87233fcfd27e3eae493e3f0329f43e') d
233233
from t1 where id < 10
234234
) u order by d limit 3;
235235
id d
236-
9 0.4719976290006591
237-
3 0.5865673124650332
236+
9 0.47199
237+
3 0.58656
238238
flush session status;
239239
select id,vec_distance_euclidean(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
240240
id d
241-
9 0.4719976290006591
242-
10 0.5069011044450041
243-
3 0.5865673124650332
241+
9 0.47199
242+
10 0.50690
243+
3 0.58656
244244
show status like 'handler_read_rnd_next';
245245
Variable_name Value
246246
Handler_read_rnd_next 0
247247
select id,vec_distance_euclidean(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 use index () order by d limit 3;
248248
id d
249-
9 0.4719976290006591
250-
10 0.5069011044450041
251-
3 0.5865673124650332
249+
9 0.47199
250+
10 0.50690
251+
3 0.58656
252252
show status like 'handler_read_rnd_next';
253253
Variable_name Value
254254
Handler_read_rnd_next 11
255255
flush session status;
256256
select id,vec_distance_cosine(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
257257
id d
258-
10 0.05905546376032378
259-
9 0.06546887818344715
260-
3 0.10750282439505232
258+
10 0.05905
259+
9 0.06546
260+
3 0.10750
261261
show status like 'handler_read_rnd_next';
262262
Variable_name Value
263263
Handler_read_rnd_next 11
264264
delete from t1 where v = x'7b713f3e5258323f80d1113d673b2b3f66e3583f';
265265
select id,vec_distance_euclidean(v, x'B047263C9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
266266
id d
267-
10 0.5069011044450041
268-
3 0.5865673124650332
269-
7 0.7344464697214867
267+
10 0.50690
268+
3 0.58656
269+
7 0.73444
270270
insert t1 (v) values (x'7b713f3e5258323f80d1113d673b2b3f66e3583f');
271271
select id,vec_distance_euclidean(v, x'b047263c9F87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
272272
id d
273-
11 0.4719976290006591
274-
10 0.5069011044450041
275-
3 0.5865673124650332
273+
11 0.47199
274+
10 0.50690
275+
3 0.58656
276276
select id,vec_distance_euclidean(v, x'B047263c9F87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 5;
277277
id d
278-
11 0.4719976290006591
279-
10 0.5069011044450041
280-
3 0.5865673124650332
281-
7 0.7344464697214867
282-
5 0.7671033529042712
278+
11 0.47199
279+
10 0.50690
280+
3 0.58656
281+
7 0.73444
282+
5 0.76710
283283
update t1 set v=x'76EDFC3E4B57243F10F8423FB158713F020BAA3E' where v=x'6CA1D43E9DF91B3FE580DA3E1C247D3F147CF33E';
284284
select id,vec_distance_euclidean(v, x'B047263C9F87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 5;
285285
id d
286-
11 0.4719976290006591
287-
3 0.5865673124650332
288-
7 0.7344464697214867
289-
10 0.746836719209219
290-
5 0.7671033529042712
286+
11 0.47199
287+
3 0.58656
288+
7 0.73444
289+
10 0.74683
290+
5 0.76710
291291
delete from t1;
292292
insert t1 (v) values (x'e360d63ebe554f3fcdbc523f4522193f5236083d'),
293293
(x'f511303f72224a3fdd05fe3eb22a133ffae86a3f'),
@@ -301,11 +301,11 @@ insert t1 (v) values (x'e360d63ebe554f3fcdbc523f4522193f5236083d'),
301301
(x'6ca1d43e9df91b3fe580da3e1c247d3f147cf33e');
302302
select id,vec_distance_euclidean(v, x'b047263c9f87233Fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 5;
303303
id d
304-
20 0.4719976290006591
305-
21 0.5069011044450041
306-
14 0.5865673124650332
307-
18 0.7344464697214867
308-
16 0.7671033529042712
304+
20 0.47199
305+
21 0.50690
306+
14 0.58656
307+
18 0.73444
308+
16 0.76710
309309
insert t1 (v) values ('');
310310
ERROR 22007: Incorrect vector value: '...' for column `test`.`t1`.`v` at row 1
311311
insert t1 (v) values (x'1234');
@@ -436,32 +436,32 @@ insert t1 (v) values (x'e360d63ebe554f3fcdbc523f4522193f5236083d'),
436436
(x'6ca1d43e9df91b3fe580da3e1c247d3f147cf33e');
437437
select id,vec_distance_cosine(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
438438
id d
439-
10 0.05905546376032378
440-
9 0.06546887818344715
441-
3 0.10750282439505232
439+
10 0.05905
440+
9 0.06546
441+
3 0.10750
442442
flush session status;
443443
select id,vec_distance_cosine(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
444444
id d
445-
10 0.05905546376032378
446-
9 0.06546887818344715
447-
3 0.10750282439505232
445+
10 0.05905
446+
9 0.06546
447+
3 0.10750
448448
show status like 'handler_read_rnd_next';
449449
Variable_name Value
450450
Handler_read_rnd_next 0
451451
select id,vec_distance_cosine(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 use index () order by d limit 3;
452452
id d
453-
10 0.05905546376032378
454-
9 0.06546887818344715
455-
3 0.10750282439505232
453+
10 0.05905
454+
9 0.06546
455+
3 0.10750
456456
show status like 'handler_read_rnd_next';
457457
Variable_name Value
458458
Handler_read_rnd_next 11
459459
flush session status;
460460
select id,vec_distance_euclidean(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
461461
id d
462-
9 0.4719976290006591
463-
10 0.5069011044450041
464-
3 0.5865673124650332
462+
9 0.47199
463+
10 0.50690
464+
3 0.58656
465465
show status like 'handler_read_rnd_next';
466466
Variable_name Value
467467
Handler_read_rnd_next 11

0 commit comments

Comments
 (0)