remove custom vt_mysqlbinlog from mysql

This commit is contained in:
Sugu Sougoumarane 2013-11-27 11:16:02 -08:00
Родитель 9e4e320cee
Коммит 89c1781849
5 изменённых файлов: 63 добавлений и 184 удалений

Просмотреть файл

@ -69,19 +69,16 @@ then
else
git clone https://code.google.com/r/sougou-vitess-mysql/ third_party/mysql
pushd third_party/mysql
cp client/mysqlbinlog.cc client/vt_mysqlbinlog.cc
git apply ../mysql.patch
set -e
enable_minimal="--enable-minimal"
git apply ../mysql.patch
export VT_MYSQL_ROOT=$VTROOT/dist/mysql
source google/env.inc
source ../mysql-compile.inc 2>&1 | tee log
VT_MYSQL_ROOT=$VTROOT/dist/mysql
source google/compile.inc
# Install
make -s install #DESTDIR=$VTROOT/dist/mysql
rm -rf $VTROOT/dist/mysql/mysql-test && \
rm -rf $VTROOT/dist/mysql/sql-bench
rm -rf $VTROOT/dist/mysql/mysql-test
rm -rf $VTROOT/dist/mysql/sql-bench
popd
rm -rf third_party/mysql
fi

Просмотреть файл

@ -216,12 +216,7 @@ def _exec_vt_txn(host, query_list=None):
vtdb_conn.commit()
def main():
vt_mysqlbinlog = os.environ.get('VT_MYSQL_ROOT') + '/bin/vt_mysqlbinlog'
if not os.path.isfile(vt_mysqlbinlog):
sys.exit("%s is not present, please install it and then re-run the test" % vt_mysqlbinlog)
print "Note: This is a slow test, has a couple of sleeps in it to simulate proper state changes"
utils.main()
if __name__ == '__main__':

Просмотреть файл

@ -156,9 +156,6 @@ def kill_sub_processes():
os.kill(pid, signal.SIGTERM)
except OSError as e:
logging.debug("kill_sub_processes: %s", str(e))
# temporary hack until we figure it out
logging.debug("===== killing any remaining vt_mysqlbinlog process just to be sure...")
os.system("killall -q vt_mysqlbinlog")
def kill_sub_process(proc):
pid = proc.pid

72
third_party/mysql-compile.inc поставляемый
Просмотреть файл

@ -1,72 +0,0 @@
# This script contains the autogen/configure/make part of the
# build. It is included in several executables (build, deb, mpm, etc)
# and it assumes a whole set of environmental variables are properly
# set.
VT_MYSQL_ROOT=$VTROOT/dist/mysql
# Autogen
${ACLOCAL}
autoheader
libtoolize --automake --force --copy
${AUTOMAKE} --foreign --add-missing --copy
autoconf
# Configure
pushd ./
cd ${BUILD_DIR}
set -x
${SRC_DIR}/configure \
--host=${GNU_TARGET} \
--enable-assembler \
--enable-local-infile \
--enable-profiling \
--with-big-tables \
--without-manager \
--with-extra-charsets=all \
--with-mysqld-user=mysql \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \
--with-pic \
--prefix=$VT_MYSQL_ROOT \
--exec-prefix=$VT_MYSQL_ROOT \
--libexecdir=$VT_MYSQL_ROOT/sbin \
--libdir=$VT_MYSQL_ROOT/lib \
--datadir=$VT_MYSQL_ROOT/share \
--localstatedir=/var/lib/mysql \
--sysconfdir=/etc \
--infodir=$VT_MYSQL_ROOT/share/info \
--includedir=$VT_MYSQL_ROOT/include \
--enable-thread-safe-client \
--with-plugins=innodb_plugin,googlestats \
--with-lzo2-dir=bundled \
--with-ncurses-dir=bundled \
--with-readline \
--with-perftools-dir=bundled \
${enable_perftools_profiling} \
--enable-perftools-tcmalloc \
${enable_minimal} \
--with-ssl=/usr \
--with-comment="Google MySQL ${MYSQL_VERSION} build ${MYSQL_RELEASE}" \
--with-zlib-dir=bundled \
--with-server-suffix=${server_suffix} \
--without-embedded-server \
--without-vio \
${with_debug} \
--without-docs \
--without-man \
CC=${CC} CPP=${CPP} CXX=${CXX} LD=${LD} RANLIB=${RANLIB} AR=${AR} \
CPPFLAGS="${CPPFLAGS}" \
LDFLAGS="${LDFLAGS} ${profile_lib}" \
STRIP="/bin/true" \
CFLAGS="${CFLAGS} ${profile_opt} ${ncurses_inc}" \
CXXFLAGS="${CXXFLAGS} ${profile_opt} ${ncurses_inc}" \
GETCONF="${GETCONF_BIN}"
set -x
# Build
make ${MAKEFLAGS}
popd

154
third_party/mysql.patch поставляемый
Просмотреть файл

@ -1,96 +1,58 @@
diff --git a/client/vt_mysqlbinlog.cc b/client/vt_mysqlbinlog.cc
index f85219a..862438b 100644
--- a/client/vt_mysqlbinlog.cc
+++ b/client/vt_mysqlbinlog.cc
@@ -1798,8 +1798,17 @@ static Exit_status check_header(IO_CACHE* file,
return ERROR_STOP;
}
- pos= my_b_tell(file);
- my_b_seek(file, (my_off_t)0);
+ if (logname && strcmp(logname, "-") != 0)
+ {
+ pos= my_b_tell(file);
+ my_b_seek(file, (my_off_t)0);
+ }
+ else
+ {
+ // input is stdin - assume the offset is zero
+ pos= 0;
+ }
+
if (my_b_read(file, header, sizeof(header)))
{
error("Failed reading header; probably an empty file.");
@@ -1987,7 +1996,7 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
}
#endif
if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
- 0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
+ 0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE | MY_FULL_IO)))
{
error("Failed to init IO cache.");
return ERROR_STOP;
diff --git a/client/Makefile.am b/client/Makefile.am
index 8158783..8b137c0 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -44,6 +44,7 @@ CLEANFILES = $(BUILT_SOURCES)
bin_PROGRAMS = mysql \
mysqladmin \
mysqlbinlog \
+ vt_mysqlbinlog \
mysqlcheck \
mysqldump \
mysqlimport \
@@ -57,6 +58,7 @@ mysql_SOURCES = mysql.cc readline.cc sql_string.cc \
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ @NCURSES_LIBS@ \
$(LDADD) $(CXXLDFLAGS)
mysqladmin_SOURCES = mysqladmin.cc
+mysqlcheck_SOURCES = mysqlcheck.cc $(top_srcdir)/mysys/checksum.c
mysqlbinlog_SOURCES = mysqlbinlog.cc \
$(top_srcdir)/mysys/checksum.c \
@@ -68,6 +70,16 @@ mysqlbinlog_SOURCES = mysqlbinlog.cc \
$(top_srcdir)/mysys/base64.c
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
+vt_mysqlbinlog_SOURCES = vt_mysqlbinlog.cc \
+ $(top_srcdir)/mysys/checksum.c \
+ $(top_srcdir)/mysys/mf_tempdir.c \
+ $(top_srcdir)/mysys/my_new.cc \
+ $(top_srcdir)/mysys/my_bit.c \
+ $(top_srcdir)/mysys/my_bitmap.c \
+ $(top_srcdir)/mysys/my_vle.c \
+ $(top_srcdir)/mysys/base64.c
+vt_mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
+
mysqldump_SOURCES= mysqldump.c \
my_user.c \
$(top_srcdir)/mysys/mf_getdate.c
diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am
index 2453547..7e3d970 100644
--- a/libmysql/Makefile.am
+++ b/libmysql/Makefile.am
@@ -28,7 +28,7 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
include $(srcdir)/Makefile.shared
-libmysqlclient_la_SOURCES = $(target_sources)
+libmysqlclient_la_SOURCES = $(target_sources) $(top_srcdir)/mysys/checksum.c
libmysqlclient_la_LIBADD = $(target_libadd) $(yassl_las)
libmysqlclient_la_LDFLAGS = $(target_ldflags)
EXTRA_DIST = Makefile.shared libmysql.def dll.c CMakeLists.txt
diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am
index d4f0bea..77cf6c3 100644
--- a/libmysql_r/Makefile.am
+++ b/libmysql_r/Makefile.am
@@ -28,7 +28,7 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include
include $(top_srcdir)/libmysql/Makefile.shared
-nodist_libmysqlclient_r_la_SOURCES = $(target_sources)
+nodist_libmysqlclient_r_la_SOURCES = $(target_sources) $(top_srcdir)/mysys/checksum.c
libmysqlclient_r_la_LIBADD = $(target_libadd) $(yassl_las)
libmysqlclient_r_la_LDFLAGS = $(target_ldflags)
diff --git a/google/compile.inc b/google/compile.inc
index efdac62..edc9170 100644
--- a/google/compile.inc
+++ b/google/compile.inc
@@ -27,16 +27,16 @@ ${SRC_DIR}/configure \
--with-mysqld-user=mysql \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \
--with-pic \
- --prefix=/ \
- --exec-prefix=/usr \
- --libexecdir=/usr/sbin \
- --libdir=/usr/lib \
+ --with-ssl=$VT_MYSQL_ROOT \
+ --prefix=$VT_MYSQL_ROOT \
+ --exec-prefix=$VT_MYSQL_ROOT \
+ --libexecdir=$VT_MYSQL_ROOT/sbin \
+ --libdir=$VT_MYSQL_ROOT/lib \
--sysconfdir=/etc \
- --datadir=/usr/share \
+ --datadir=$VT_MYSQL_ROOT/share \
--localstatedir=/var/lib/mysql \
- --infodir=/usr/share/info \
- --includedir=/usr/include \
- --mandir=/usr/share/man \
+ --infodir=$VT_MYSQL_ROOT/share/info \
+ --includedir=$VT_MYSQL_ROOT/include \
--enable-thread-safe-client \
--with-plugins=innodb_plugin,googlestats \
--with-lzo2-dir=bundled \
@@ -47,14 +47,13 @@ ${SRC_DIR}/configure \
--enable-perftools-tcmalloc \
${enable_minimal} \
--with-comment="Google MySQL ${MYSQL_VERSION} build ${MYSQL_RELEASE}" \
- --disable-shared \
--with-zlib-dir=bundled \
--with-server-suffix=${server_suffix} \
--without-embedded-server \
--without-vio \
${with_debug} \
--without-docs \
- --with-man \
+ --without-man \
CC=${CC} CPP=${CPP} CXX=${CXX} LD=${LD} RANLIB=${RANLIB} AR=${AR} \
CPPFLAGS="${CPPFLAGS}" \
LDFLAGS="${LDFLAGS} ${profile_lib}" \
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index ee2bbc3..5854a14 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -61,7 +61,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
my_symlink.lo my_fstream.lo mf_arr_appstr.lo \
mf_loadpath.lo my_pthread.lo my_thr_init.lo \
thr_mutex.lo mulalloc.lo string.lo \
- default.lo default_modify.lo checksum_io.lo \
+ default.lo default_modify.lo checksum_io.lo checksum.lo\
my_compress.lo array.lo my_once.lo list.lo my_net.lo \
charset.lo charset-def.lo hash.lo mf_iocache.lo \
mf_iocache2.lo my_seek.lo my_sleep.lo \