Skip to content

Instantly share code, notes, and snippets.

View gist:13d967cc5b6ab02e2be003b9ac59c86e
./mtr --rr alias
TEST RESULT TIME (ms) or COMMENT
--------------------------------------------------------------------------
worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
worker[1] mysql-test-run: WARNING: Process [mysqld.1 - pid: 20572, winpid: 20572, exit: 256] died after mysql-test-run waited 0.2 seconds for /optane/dev-git2/10.6/mysql-test/var/run/mysqld.1.pid to be created.
worker[1] mysql-test-run: *** ERROR: Failed to start mysqld mysqld.1 with command env
mysql-test-run: *** ERROR: Test suite aborted
View gist:94333b3e443b83e9d90dd60894f8982c
== Expose Index Condition Pushdown r_filtered% ==
MariaDB has Index Condition Pushdown optimization.
MariaDB also has ANALYZE FORMAT=JSON command which reports condition
selectivities.
Unfortunately the selectivity of pushed index condition is not reported.
For example, consider query:
View gist:a15e9b68d5b5bc6c0d2e33fa5debcb3e
== Check cheaper parts of WHERE first ==
Consider two queries:
Q1: select * from t1 where exists(select 1 from t2 where t2.col=t1.col2) and t1.col1<3
Q2: select * from t1 where t1.col1<3 and exists(select 1 from t2 where t2.col=t1.col2)
Suppose both are executed by scanning table t1 and reading each row. Suppose
we have any idea about the selectivities of the "t1.col1<3" or "exists(select
...)" clauses.
View 2.diff
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 496b920208b..e1d0a83dc95 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -7758,7 +7758,7 @@ int ha_rocksdb::create_table(const std::string &table_name,
goto error;
}
- save_table_version(batch, table_arg->s->path.str, 0);
+ save_table_version(batch, table_name.c_str(), 0);
View 1.diff
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 496b920208b..e431c8c0995 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -14607,6 +14607,9 @@ void ha_rocksdb::print_error(int error, myf errflag) {
std::string make_table_version_lookup_key(const char *path) {
std::string res;
+ char buf[Rdb_key_def::INDEX_NUMBER_SIZE];
+ rdb_netbuf_store_index((uchar*)buf, Rdb_key_def::TABLE_VERSION);
View gist:8cb92da93dcc20e65f169129fba3a630
2021-04-19T14:51:28.997628Z 0 [Note] [MY-000000] [Server] RocksDB: Opening TransactionDB...
[FATAL /build/rr-ViolGa/rr-5.1.0/src/record_syscall.cc:4870:rec_process_syscall_arch()]
(task 6061 (rec:6061) at time 533998)
-> Assertion `t->regs().syscall_result_signed() == -syscall_state.expect_errno' failed to hold. Expected ENOSYS for 'sync_file_range' but got result 0 (errno SUCCESS); execution of syscall unsupported by rr
=== Start rr backtrace:
rr(_ZN2rr13dump_rr_stackEv+0x41)[0x55b8428ebdd1]
rr(_ZN2rr9GdbServer15emergency_debugEPNS_4TaskE+0x5c5)[0x55b84281e135]
rr(_ZN2rr21EmergencyDebugOstreamD1Ev+0x11e)[0x55b84282b6be]
rr(+0xe95a1)[0x55b84287b5a1]
View mdev25149.diff
diff --git a/mysql-test/suite/json/r/json_table.result b/mysql-test/suite/json/r/json_table.result
index 34f25f316d4..2fee5aae5a6 100644
--- a/mysql-test/suite/json/r/json_table.result
+++ b/mysql-test/suite/json/r/json_table.result
@@ -360,10 +360,12 @@ json_table( '[{"a":"asd"}, {"a":123}, {"a":[]}, {"a":{}} ]', '$[*]'
intcol int path '$.a' default '1234' on empty default '5678' on error)
) as tt;
id intcol
-1 5678
+1 0
View fix-myrocks-version.diff
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index e8f54485197..30e7f4e728e 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -223,10 +223,12 @@ void dbug_dump_database(rocksdb::DB *db);
static handler *rocksdb_create_handler(my_core::handlerton *hton,
my_core::TABLE_SHARE *table_arg,
my_core::MEM_ROOT *mem_root);
+
void save_table_version(rocksdb::WriteBatch *wb, const char *path,
View fix-myrocks-build.diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b1ad256a4af..11119e496c5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -369,6 +369,7 @@ INCLUDE(configure.cmake)
# Always use USE_MYSYS_NEW
ADD_DEFINITIONS(-DUSE_MYSYS_NEW)
+SET(USING_MYSYS_NEW ON)
View gist:ae1f329b1f0e533ce8c7e6817b283b74
MariaDB [j2]> explain format=json select * from t10 join (select t11.a, 12.b from t11, t12 limit 10) T\G
*************************** 1. row ***************************
EXPLAIN: {
"query_block": {
"select_id": 1,
"table": {
"table_name": "t10",
"access_type": "ALL",
"rows": 1,
"filtered": 100