diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index f85219a..72081df 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -36,6 +36,7 @@ #include "mysql_priv.h" #include "log_event.h" #include "sql_common.h" +#include "my_dir.h" #include // ORACLE_WELCOME_COPYRIGHT_NOTICE #define BIN_LOG_HEADER_SIZE 4 @@ -1790,6 +1791,7 @@ static Exit_status check_header(IO_CACHE* file, uchar header[BIN_LOG_HEADER_SIZE]; uchar buf[PROBE_HEADER_LEN]; my_off_t tmp_pos, pos; + MY_STAT my_file_stat; delete glob_description_event; if (!(glob_description_event= new Format_description_log_event(3))) @@ -1799,7 +1801,16 @@ static Exit_status check_header(IO_CACHE* file, } pos= my_b_tell(file); - my_b_seek(file, (my_off_t)0); + + /* fstat the file to check if the file is a regular file. */ + if (my_fstat(file->file, &my_file_stat, MYF(0)) == -1) + { + error("Unable to stat the file."); + return ERROR_STOP; + } + if ((my_file_stat.st_mode & S_IFMT) == S_IFREG) + my_b_seek(file, (my_off_t)0); + if (my_b_read(file, header, sizeof(header))) { error("Failed reading header; probably an empty file."); 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 \