Skip to content

Commit a597e0e

Browse files
committed
MariaRocks port: fix tests
- rocksdb.tmpdir works (however @@rocksdb_tmpdir has no effect yet!) - trx_info_rpl is only run in RBR mode - type_char_indexes_collation now works = take into account that characters with the same weight can have any order after sorting (and they do in MariaDB) = MariaDB doesn't use index-only for extended keys that have partially- covered columns.
1 parent 3ecd9e0 commit a597e0e

File tree

6 files changed

+24
-14
lines changed

6 files changed

+24
-14
lines changed

storage/rocksdb/mysql-test/rocksdb/r/tmpdir.result

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ show session variables like 'rocksdb_tmpdir';
55
Variable_name Value
66
rocksdb_tmpdir
77
# Connection con1
8+
connect con1,localhost,root;
89
show session variables like 'rocksdb_tmpdir';
910
Variable_name Value
1011
rocksdb_tmpdir
1112
ALTER TABLE t1 ADD INDEX kb(b), ALGORITHM=INPLACE;
13+
connection default;
14+
disconnect con1;
1215
DROP TABLE t1;
1316
# rocksdb_tmpdir with valid location.
1417
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=RocksDB;
@@ -18,9 +21,12 @@ show session variables like 'rocksdb_tmpdir';
1821
Variable_name Value
1922
rocksdb_tmpdir
2023
# Connection con3
24+
connect con2,localhost,root;
2125
show session variables like 'rocksdb_tmpdir';
2226
Variable_name Value
2327
rocksdb_tmpdir MYSQL_TMP_DIR/mysqld.1
2428
ALTER TABLE t1 ADD INDEX kb(b), ALGORITHM=INPLACE;
29+
disconnect con2;
30+
connection default;
2531
set global rocksdb_tmpdir=NULL;
2632
DROP TABLE t1;
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
include/master-slave.inc
2-
Warnings:
3-
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4-
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
52
[connection master]
63
DROP TABLE IF EXISTS t1;
4+
connection slave;
75
include/stop_slave.inc
6+
connection master;
87
create table t1 (a int) engine=rocksdb;
8+
connection slave;
99
show variables like 'rocksdb_rpl_skip_tx_api';
1010
Variable_name Value
1111
rocksdb_rpl_skip_tx_api ON
1212
include/start_slave.inc
1313
found
14+
connection master;
1415
DROP TABLE t1;
1516
include/rpl_end.inc

storage/rocksdb/mysql-test/rocksdb/r/type_char_indexes_collation.result

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set session debug= "+d,myrocks_enable_unknown_collation_index_only_scans";
1+
set session debug_dbug= "+d,myrocks_enable_unknown_collation_index_only_scans";
22
create table t (id int not null auto_increment primary key,
33
c varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci,
44
key sk (c));
@@ -11,7 +11,7 @@ c
1111
ß
1212
1313
drop table t;
14-
set session debug= "-d,myrocks_enable_unknown_collation_index_only_scans";
14+
set session debug_dbug= "-d,myrocks_enable_unknown_collation_index_only_scans";
1515
create table t (id int not null auto_increment,
1616
c1 varchar(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci,
1717
c2 char(1) CHARACTER SET latin1 COLLATE latin1_general_ci,
@@ -67,7 +67,7 @@ insert into t (c1) values ('a ');
6767
ERROR 23000: Duplicate entry 'a' for key 'sk1'
6868
explain select c1 from t;
6969
id select_type table type possible_keys key key_len ref rows Extra
70-
1 SIMPLE t ALL NULL NULL NULL NULL # NULL
70+
1 SIMPLE t ALL NULL NULL NULL NULL #
7171
select c1 from t;
7272
c1
7373
Asdf
@@ -78,7 +78,7 @@ create table t (id int primary key, email varchar(100), KEY email_i (email(30)))
7878
insert into t values (1, ' a');
7979
explain select 'email_i' as index_name, count(*) AS count from t force index(email_i);
8080
id select_type table type possible_keys key key_len ref rows Extra
81-
1 SIMPLE t index NULL email_i 33 NULL # Using index
81+
1 SIMPLE t ALL NULL NULL NULL NULL #
8282
select 'email_i' as index_name, count(*) AS count from t force index(email_i);
8383
index_name count
8484
email_i 1

storage/rocksdb/mysql-test/rocksdb/t/trx_info_rpl.cnf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
[mysqld.1]
44
binlog_format=row
5+
loose-enable-rocksdb_trx
6+
57
[mysqld.2]
68
binlog_format=row
79
slave_parallel_workers=1
810
rocksdb_rpl_skip_tx_api=ON
11+
loose-enable-rocksdb_trx

storage/rocksdb/mysql-test/rocksdb/t/trx_info_rpl.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
--source include/master-slave.inc
2+
--source include/have_binlog_format_row.inc
23

34
--disable_warnings
45
DROP TABLE IF EXISTS t1;

storage/rocksdb/mysql-test/rocksdb/t/type_char_indexes_collation.test

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--source include/have_debug.inc
33

44
# Test if unknown collation works.
5-
set session debug= "+d,myrocks_enable_unknown_collation_index_only_scans";
5+
set session debug_dbug= "+d,myrocks_enable_unknown_collation_index_only_scans";
66
create table t (id int not null auto_increment primary key,
77
c varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci,
88
key sk (c));
@@ -11,7 +11,7 @@ insert into t (c) values ('☀'), ('ß');
1111
explain select c from t;
1212
select c from t;
1313
drop table t;
14-
set session debug= "-d,myrocks_enable_unknown_collation_index_only_scans";
14+
set session debug_dbug= "-d,myrocks_enable_unknown_collation_index_only_scans";
1515

1616
# Testing if all characters in latin1 charset get restored correctly. This is
1717
# done by comparing results from a PK scan.
@@ -44,19 +44,18 @@ explain select hex(c2) from t IGNORE INDEX (sk1) order by c2;
4444

4545
--let $file1=$MYSQLTEST_VARDIR/tmp/filesort_order
4646
--let $file2=$MYSQLTEST_VARDIR/tmp/sk_order
47-
4847
--disable_query_log
49-
--eval select hex(c1) INTO OUTFILE '$file1' from t order by c1
50-
--eval select hex(c1) INTO OUTFILE '$file2' from t IGNORE INDEX (sk1) order by c1
48+
--eval select hex(weight_string(c1)) INTO OUTFILE '$file1' from t order by c1
49+
--eval select hex(weight_string(c1)) INTO OUTFILE '$file2' from t IGNORE INDEX (sk1) order by c1
5150
--enable_query_log
5251

5352
--diff_files $file1 $file2
5453
--remove_file $file1
5554
--remove_file $file2
5655

5756
--disable_query_log
58-
--eval select hex(c2) INTO OUTFILE '$file1' from t order by c2
59-
--eval select hex(c2) INTO OUTFILE '$file2' from t IGNORE INDEX (sk1) order by c2
57+
--eval select hex(weight_string(c2)) INTO OUTFILE '$file1' from t order by c2
58+
--eval select hex(weight_string(c2)) INTO OUTFILE '$file2' from t IGNORE INDEX (sk1) order by c2
6059
--enable_query_log
6160

6261
--diff_files $file1 $file2

0 commit comments

Comments
 (0)