Skip to content

Instantly share code, notes, and snippets.

View gist:338fe1b2addfa56f1f40
em --force --retry=1 --max-test-fail=100 --parallel=5 rocksdb.rocksdb
Logging: ./mysql-test-run --mysqld=--default-storage-engine=rocksdb --retry=1 --mem --force --retry=1 --max-test-fail=100 --parallel=5 rocksdb.rocksdb
[Note] Global variable initial value (from cmd line) @@datadir = '/tmp/a0TVEGWIrr'
[Note] Global variable initial value (from cmd line) @@lc_messages_dir = '/home/psergey/dev-git/mysql-5.6-rocksdb-bugfixing/sql/share'
2015-08-28 21:24:10 0 [Note] /home/psergey/dev-git/mysql-5.6-rocksdb-bugfixing/sql/mysqld (mysqld 5.6.24-debug) starting as process 3170 ...
2015-08-28 21:24:10 3170 [Note] Flashcache bypass: disabled
2015-08-28 21:24:10 3170 [Note] Flashcache setup error is : getmntent loop failed
2015-08-28 21:24:10 3170 [Note] Plugin 'FEDERATED' is disabled.
2015-08-28 21:24:10 3170 [Note] Binlog end
View gist:f25066026c1c5c15f416
psergey@pslp2:~/dev-git/mysql-5.6-rocksdb-bugfixing/mysql-test$ ./mysql-test-run --mysqld=--default-storage-engine=rocksdb --retry=1 --mem --force --retry=1 --max-test-fail=100 --parallel=5 rocksdb.rocksdb
Logging: ./mysql-test-run --mysqld=--default-storage-engine=rocksdb --retry=1 --mem --force --retry=1 --max-test-fail=100 --parallel=5 rocksdb.rocksdb
[Note] Global variable initial value (from cmd line) @@datadir = '/tmp/a0TVEGWIrr'
[Note] Global variable initial value (from cmd line) @@lc_messages_dir = '/home/psergey/dev-git/mysql-5.6-rocksdb-bugfixing/sql/share'
2015-08-28 21:24:10 0 [Note] /home/psergey/dev-git/mysql-5.6-rocksdb-bugfixing/sql/mysqld (mysqld 5.6.24-debug) starting as process 3170 ...
2015-08-28 21:24:10 3170 [Note] Flashcache bypass: disabled
2015-08-28 21:24:10 3170 [Note] Flashcache setup error is : getmntent loop failed
2015-08-28 21:24:10 3170 [Note] Plugin 'FEDERATED' is disabled.
View gist:9599260
mysql> explain extended select * from t100 where col1 < 5 order by key1 limit 10;
+------+-------------+-------+-------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+------+-------------+-------+-------+---------------+------+---------+------+------+----------+-------------+
| 1 | SIMPLE | t100 | index | NULL | key1 | 5 | NULL | 10 | 0.99 | Using where |
+------+-------------+-------+-------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)
mysql> explain extended select * from t100 where col1 > 5 order by key1 limit 10;
View gist:9663128
psergey@pslp2:~/dev2/10.0-noc$ grep -r THR_LOCK_dbug *
dbug/dbug.c:static pthread_mutex_t THR_LOCK_dbug;
dbug/dbug.c: pthread_mutex_init(&THR_LOCK_dbug, NULL);
dbug/dbug.c: pthread_mutex_lock(&THR_LOCK_dbug);
dbug/dbug.c: pthread_mutex_unlock(&THR_LOCK_dbug);
dbug/dbug.c: pthread_mutex_lock(&THR_LOCK_dbug);
dbug/dbug.c: pthread_mutex_lock(&THR_LOCK_dbug);
dbug/dbug.c: pthread_mutex_lock(&THR_LOCK_dbug);
dbug/dbug.c: pthread_mutex_unlock(&THR_LOCK_dbug);
dbug/dbug.c: pthread_mutex_lock(&THR_LOCK_dbug);
View gist:11224723
select
sum(aggregated_data._getSource(source, source2, source3, fb_source, request_ids)='no_source')
FROM
g9_tracker.app_logins u
WHERE
u.created_date = '2014-04-22';
select sum(IF(source IS NOT NULL AND
source2 IS NOT NULL AND
source3 IS NOT NULL AND
View gist:11223242
flush status;
SELECT COUNT(*)
FROM
(
SELECT
IF(source IS NOT NULL AND
source2 IS NOT NULL AND
source3 IS NOT NULL AND
fb_source IS NOT NULL AND
request_ids IS NOT NULL, 'request_id', 'no_source') AS source,
View gist:25335f227ffa2c6dee0c
BAD:
MariaDB [csc435]> explain extended SELECT ( SELECT t2.start FROM t2 WHERE t1.t1_id = t2.t1_id ORDER BY t2.t2_id LIMIT 1 ) AS first_start FROM t1;
+------+--------------------+-------+-------+---------------+---------+---------+------+------+----------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+------+--------------------+-------+-------+---------------+---------+---------+------+------+----------+-------------+
| 1 | PRIMARY | t1 | index | NULL | PRIMARY | 4 | NULL | 9999 | 100.00 | Using index |
| 2 | DEPENDENT SUBQUERY | t2 | index | t1_id | PRIMARY | 4 | NULL | 1 | 100.00 | Using where |
+------+--------------------+-------+-------+---------------+---------+---------+------+------+----------+-------------+
2 rows in set, 2 warnings (0.01 sec)
View gist:50964ac0cc61883bbe28
create table ten(a int);
insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table one_k(a int);
insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C;
create table r100 (
id int primary key,
value1 int,
value2 int,
View gist:cbc2b4e9f6650270f3f1
mysql_new_select (trigger)
(gdb) p select_lex
$205 = (SELECT_LEX *) 0x7fffe15e1470
(gdb) p select_lex->select_number
$206 = 2
mysql_make_view()
View gist:514b92387c6a8de3b0b1
Breakpoint 8, mysql_new_select (lex=0x7fffe1610088, move_down=true) at /home/psergey/dev-git/10.1/sql/sql_parse.cc:6252
(gdb) next
(gdb) next
(gdb) p lex
$315 = (LEX *) 0x7fffe1610088
(gdb) p select_lex
$316 = (SELECT_LEX *) 0x7fffe1611470
(gdb) p select_lex->select_number
$317 = 4
(gdb) wher