Skip to content

Commit c779542

Browse files
committed
fix rand() values in vector tests
hopefully, it'll fix MDEV-37559 main.vector sporadic failures MDEV-36890 Sporadic main.vector_innodb test result mismatch on ppc64el, i386 and mariadb-import sporadic failures
1 parent 399edc7 commit c779542

File tree

6 files changed

+14
-0
lines changed

6 files changed

+14
-0
lines changed

mysql-test/main/mariadb-import.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ db2.parent: Records: 2 Deleted: 0 Skipped: 0 Warnings: 0
262262
drop database db2;
263263
create database db2;
264264
use db2;
265+
set rand_seed1=1, rand_seed2=2;
265266
create table vec (id int auto_increment primary key, v vector(5) not null,
266267
vector index (v)) ENGINE=InnoDB;
267268
insert vec(v) values (x'e360d63ebe554f3fcdbc523f4522193f5236083d'),

mysql-test/main/mariadb-import.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ drop database db2;
106106
drop database db2;
107107
create database db2;
108108
use db2;
109+
set rand_seed1=1, rand_seed2=2;
109110

110111
# Test with vector/fulltext/spatial indexes
111112
create table vec (id int auto_increment primary key, v vector(5) not null,
@@ -128,6 +129,14 @@ create spatial index idx_geom on locations (geom);
128129
insert into locations (geom) values (ST_GeomFromText('POINT(40.785091 -73.968285)'));
129130
--mkdir $MYSQLTEST_VARDIR/tmp/dump
130131
--exec $MYSQL_DUMP --dir=$MYSQLTEST_VARDIR/tmp/dump db2
132+
133+
# vector index uses randomization when building the index
134+
# so unless one sets rand_seed variables, results are inherently
135+
# non-repeatable
136+
--append_file $MYSQLTEST_VARDIR/tmp/dump/db2/vec.sql
137+
set rand_seed1=1, rand_seed2=2;
138+
EOF
139+
131140
--echo # use --verbose to see "Adding secondary indexes" in the output
132141
--replace_result $MYSQLTEST_VARDIR vardir
133142
--exec $MYSQL_IMPORT --verbose --dir $MYSQLTEST_VARDIR/tmp/dump --database=db2

mysql-test/main/vector.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
4848
t1 0 PRIMARY 1 id A 0 NULL NULL BTREE NO
4949
t1 1 v 1 v A NULL NULL NULL VECTOR NO
5050
set mhnsw_default_m=default;
51+
set rand_seed1=1, rand_seed2=2;
5152
select * from information_schema.statistics where table_name='t1';
5253
TABLE_CATALOG def
5354
TABLE_SCHEMA test

mysql-test/main/vector.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ replace_result InnoDB MyISAM;
2424
show create table t1;
2525
show keys from t1;
2626
set mhnsw_default_m=default;
27+
set rand_seed1=1, rand_seed2=2;
2728

2829
query_vertical select * from information_schema.statistics where table_name='t1';
2930
# print unpack("H*",pack("f*",map{rand}1..5))

mysql-test/main/vector_innodb.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set rand_seed1=1, rand_seed2=2;
12
create table t1 (id int auto_increment primary key, v vector(8) not null, vector index (v)) engine=innodb;
23
show create table t1;
34
Table Create Table

mysql-test/main/vector_innodb.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
source include/have_innodb.inc;
22
source include/have_sequence.inc;
3+
set rand_seed1=1, rand_seed2=2;
34

45
create table t1 (id int auto_increment primary key, v vector(8) not null, vector index (v)) engine=innodb;
56
show create table t1;

0 commit comments

Comments
 (0)