Skip to content

Instantly share code, notes, and snippets.

@yoku0825
yoku0825 / mysqldump_5.5.30.patch
Created April 30, 2013 07:01
MySQL 5.5.30のmysqldumpに当てるパッチ。
*** client/mysqldump.c.org 2013-01-16 16:35:17.000000000 +0900
--- client/mysqldump.c 2013-04-10 14:21:27.334773435 +0900
***************
*** 1,5 ****
--- 1,6 ----
/*
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2013 yoku0825. in modified parts based MySQL 5.5.30.
This program is free software; you can redistribute it and/or modify
@yoku0825
yoku0825 / mysql-5.5.31
Created May 16, 2013 02:08
MySQL5.5.31とMySQL5.6.11のログ中のタイムスタンプの変更点あたり。 print_buffer_to_fileはmysqldの全般的なログ記録、ut_print_timestampはInnoDB独自のログ記録の時に呼び出されてる。
mysql-5.5.31/sql/log.cc: print_buffer_to_file
5900 #ifndef EMBEDDED_LIBRARY
5901 static void print_buffer_to_file(enum loglevel level, const char *buffer,
5902 size_t length)
5903 {
5904 time_t skr;
5905 struct tm tm_tmp;
5906 struct tm *start;
5907 DBUG_ENTER("print_buffer_to_file");
@yoku0825
yoku0825 / switch.sh
Created May 27, 2013 13:08
真面目に動作確認していないです。 mysqladmin pingの結果から参照スレーブをよしなに切り替えてみる。
#!/usr/bin/env bash
###################################################################
# switch.sh - check mysqladmin ping and rewrite iptables
# Copyright (C) 2013 yoku0825
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
$ uname -a
CYGWIN_NT-6.1-WOW64 xxxx 1.7.18(0.263/5/3) 2013-04-19 10:39 i686 Cygwin
$ ps -V
ps (cygwin) 1.7.18
Show process statistics
Copyright (C) 1996 - 2013 Red Hat, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*** client/mysql.cc.org 2013-05-22 00:18:39.000000000 +0900
--- client/mysql.cc 2013-07-10 12:22:42.008765722 +0900
***************
*** 151,157 ****
default_pager_set= 0, opt_sigint_ignore= 0,
auto_vertical_output= 0,
show_warnings= 0, executing_query= 0, interrupted_query= 0,
! ignore_spaces= 0;
static my_bool debug_info_flag, debug_check_flag;
static my_bool column_types_flag;
*** sql/sql_db.cc.org 2013-05-13 22:33:33.000000000 +0900
--- sql/sql_db.cc 2013-07-05 16:32:49.777762885 +0900
***************
*** 893,898 ****
--- 893,901 ----
bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
{
+ if (check_global_access(thd, SUPER_ACL))
+ DBUG_RETURN(0);
@yoku0825
yoku0825 / gist:6128270
Created August 1, 2013 03:48
fdが5~8のものはibdata1(4)とib_logfile(9, 10)の間なので、起動処理でUNDOセグメントやロールフォワード、ibufのマージなどで使われた残骸かなと推測しています。 fd12のものもinnodb_index_statsの直後なので、5.6の`統計情報永続化'関連の何かなのかなーと思えます。 すいません、ソースは全く追っていません。。
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 30367 mysql cwd DIR 253,0 4096 572370 /usr/mysql/5.6.12/data
mysqld 30367 mysql rtd DIR 253,0 4096 2 /
mysqld 30367 mysql txt REG 253,0 82786893 547097 /usr/mysql/5.6.12/bin/mysqld
mysqld 30367 mysql mem REG 253,0 5624 1700610 /lib64/libaio.so.1.0.1
mysqld 30367 mysql mem REG 253,0 156872 1700702 /lib64/ld-2.12.so
mysqld 30367 mysql mem REG 253,0 1922152 1700706 /lib64/libc-2.12.so
mysqld 30367 mysql DEL REG 253,0 1700717 /lib64/libdl-2.12.so
mysqld 30367 mysql mem REG 253,0 145720 1700712 /lib64/libpthread-2.12.so
mysqld 30367 mysql mem REG 253,0 91096 1701011 /lib64/libz.so.1.2.3
@yoku0825
yoku0825 / gist:6128271
Created August 1, 2013 03:48
fdが5~8のものはibdata1(4)とib_logfile(9, 10)の間なので、起動処理でUNDOセグメントやロールフォワード、ibufのマージなどで使われた残骸かなと推測しています。 fd12のものもinnodb_index_statsの直後なので、5.6の`統計情報永続化'関連の何かなのかなーと思えます。 すいません、ソースは全く追っていません。。
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 30367 mysql cwd DIR 253,0 4096 572370 /usr/mysql/5.6.12/data
mysqld 30367 mysql rtd DIR 253,0 4096 2 /
mysqld 30367 mysql txt REG 253,0 82786893 547097 /usr/mysql/5.6.12/bin/mysqld
mysqld 30367 mysql mem REG 253,0 5624 1700610 /lib64/libaio.so.1.0.1
mysqld 30367 mysql mem REG 253,0 156872 1700702 /lib64/ld-2.12.so
mysqld 30367 mysql mem REG 253,0 1922152 1700706 /lib64/libc-2.12.so
mysqld 30367 mysql DEL REG 253,0 1700717 /lib64/libdl-2.12.so
mysqld 30367 mysql mem REG 253,0 145720 1700712 /lib64/libpthread-2.12.so
mysqld 30367 mysql mem REG 253,0 91096 1701011 /lib64/libz.so.1.2.3
@yoku0825
yoku0825 / gist:6421819
Last active June 22, 2016 08:09
replication_filter
mysql56> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: localhost
Master_User: replicator
Master_Port: 64055
Connect_Retry: 60
Master_Log_File: bin.000001
Read_Master_Log_Pos: 184
Relay_Log_File: relay.000005
(gdb) bt
#0 create_temp_file (to=0x7f1ae94b17f0 "5ce2fe28308fd9f2a7baf3\\\004", dir=0x7f1ac4016ea0 "/tmp",
prefix=0x7f1ac4015100 "ML", mode=514, MyFlags=16) at /home/yoku0825/mysql-5.6.14/mysys/mf_tempfile.c:60
#1 0x00000000008c890e in real_open_cached_file (cache=0x7f1ac401c858) at /home/yoku0825/mysql-5.6.14/mysys/mf_cache.c:86
#2 0x00000000008c9fa8 in my_b_flush_io_cache (info=0x7f1ac401c858, need_append_buffer_lock=<value optimized out>)
at /home/yoku0825/mysql-5.6.14/mysys/mf_iocache.c:1750
#3 0x00000000008cae34 in _my_b_write (info=0x7f1ac401c858, Buffer=0x7f1ac4032660 "93fbdabb0c5ef2c3\374\a\003", Count=100)
at /home/yoku0825/mysql-5.6.14/mysys/mf_iocache.c:1556
#4 0x00000000008806b6 in wrapper_my_b_safe_write (this=0x7f1ac40158a0, file=0x7f1ac401c858)
at /home/yoku0825/mysql-5.6.14/sql/log_event.cc:1031