Commit a597e0e1 authored by Sergei Petrunia's avatar Sergei Petrunia

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.
parent 3ecd9e0b
......@@ -5,10 +5,13 @@ show session variables like 'rocksdb_tmpdir';
Variable_name Value
rocksdb_tmpdir
# Connection con1
connect con1,localhost,root;
show session variables like 'rocksdb_tmpdir';
Variable_name Value
rocksdb_tmpdir
ALTER TABLE t1 ADD INDEX kb(b), ALGORITHM=INPLACE;
connection default;
disconnect con1;
DROP TABLE t1;
# rocksdb_tmpdir with valid location.
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=RocksDB;
......@@ -18,9 +21,12 @@ show session variables like 'rocksdb_tmpdir';
Variable_name Value
rocksdb_tmpdir
# Connection con3
connect con2,localhost,root;
show session variables like 'rocksdb_tmpdir';
Variable_name Value
rocksdb_tmpdir MYSQL_TMP_DIR/mysqld.1
ALTER TABLE t1 ADD INDEX kb(b), ALGORITHM=INPLACE;
disconnect con2;
connection default;
set global rocksdb_tmpdir=NULL;
DROP TABLE t1;
include/master-slave.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
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.
[connection master]
DROP TABLE IF EXISTS t1;
connection slave;
include/stop_slave.inc
connection master;
create table t1 (a int) engine=rocksdb;
connection slave;
show variables like 'rocksdb_rpl_skip_tx_api';
Variable_name Value
rocksdb_rpl_skip_tx_api ON
include/start_slave.inc
found
connection master;
DROP TABLE t1;
include/rpl_end.inc
set session debug= "+d,myrocks_enable_unknown_collation_index_only_scans";
set session debug_dbug= "+d,myrocks_enable_unknown_collation_index_only_scans";
create table t (id int not null auto_increment primary key,
c varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci,
key sk (c));
......@@ -11,7 +11,7 @@ c
ß
drop table t;
set session debug= "-d,myrocks_enable_unknown_collation_index_only_scans";
set session debug_dbug= "-d,myrocks_enable_unknown_collation_index_only_scans";
create table t (id int not null auto_increment,
c1 varchar(1) CHARACTER SET latin1 COLLATE latin1_swedish_ci,
c2 char(1) CHARACTER SET latin1 COLLATE latin1_general_ci,
......@@ -67,7 +67,7 @@ insert into t (c1) values ('a ');
ERROR 23000: Duplicate entry 'a' for key 'sk1'
explain select c1 from t;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t ALL NULL NULL NULL NULL # NULL
1 SIMPLE t ALL NULL NULL NULL NULL #
select c1 from t;
c1
Asdf
......@@ -78,7 +78,7 @@ create table t (id int primary key, email varchar(100), KEY email_i (email(30)))
insert into t values (1, ' a');
explain select 'email_i' as index_name, count(*) AS count from t force index(email_i);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t index NULL email_i 33 NULL # Using index
1 SIMPLE t ALL NULL NULL NULL NULL #
select 'email_i' as index_name, count(*) AS count from t force index(email_i);
index_name count
email_i 1
......
......@@ -2,7 +2,10 @@
[mysqld.1]
binlog_format=row
loose-enable-rocksdb_trx
[mysqld.2]
binlog_format=row
slave_parallel_workers=1
rocksdb_rpl_skip_tx_api=ON
loose-enable-rocksdb_trx
--source include/master-slave.inc
--source include/have_binlog_format_row.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
......
......@@ -2,7 +2,7 @@
--source include/have_debug.inc
# Test if unknown collation works.
set session debug= "+d,myrocks_enable_unknown_collation_index_only_scans";
set session debug_dbug= "+d,myrocks_enable_unknown_collation_index_only_scans";
create table t (id int not null auto_increment primary key,
c varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci,
key sk (c));
......@@ -11,7 +11,7 @@ insert into t (c) values ('☀'), ('ß');
explain select c from t;
select c from t;
drop table t;
set session debug= "-d,myrocks_enable_unknown_collation_index_only_scans";
set session debug_dbug= "-d,myrocks_enable_unknown_collation_index_only_scans";
# Testing if all characters in latin1 charset get restored correctly. This is
# done by comparing results from a PK scan.
......@@ -44,10 +44,9 @@ explain select hex(c2) from t IGNORE INDEX (sk1) order by c2;
--let $file1=$MYSQLTEST_VARDIR/tmp/filesort_order
--let $file2=$MYSQLTEST_VARDIR/tmp/sk_order
--disable_query_log
--eval select hex(c1) INTO OUTFILE '$file1' from t order by c1
--eval select hex(c1) INTO OUTFILE '$file2' from t IGNORE INDEX (sk1) order by c1
--eval select hex(weight_string(c1)) INTO OUTFILE '$file1' from t order by c1
--eval select hex(weight_string(c1)) INTO OUTFILE '$file2' from t IGNORE INDEX (sk1) order by c1
--enable_query_log
--diff_files $file1 $file2
......@@ -55,8 +54,8 @@ explain select hex(c2) from t IGNORE INDEX (sk1) order by c2;
--remove_file $file2
--disable_query_log
--eval select hex(c2) INTO OUTFILE '$file1' from t order by c2
--eval select hex(c2) INTO OUTFILE '$file2' from t IGNORE INDEX (sk1) order by c2
--eval select hex(weight_string(c2)) INTO OUTFILE '$file1' from t order by c2
--eval select hex(weight_string(c2)) INTO OUTFILE '$file2' from t IGNORE INDEX (sk1) order by c2
--enable_query_log
--diff_files $file1 $file2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment