diff --git a/include/my_sys.h b/include/my_sys.h index f9df265df0f..cc5bdc104f8 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -359,7 +359,6 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *); (memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\ ((info)->write_pos+=(Count)),0) : \ (*(info)->write_function)((info),(Buffer),(Count))) - #define my_b_get(info) \ @@ -370,17 +369,23 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *); /* my_b_write_byte dosn't have any err-check */ #define my_b_write_byte(info,chr) \ - (((info)->rc_pos < (info)->rc_end) ?\ - ((*(info)->rc_pos++)=(chr)) :\ - (_my_b_write(info,0,0) , ((*(info)->rc_pos++)=(chr)))) + (((info)->write_pos < (info)->write_end) ?\ + ((*(info)->write_pos++)=(chr)) :\ + (_my_b_write(info,0,0) , ((*(info)->write_pos++)=(chr)))) #define my_b_fill_cache(info) \ (((info)->rc_end=(info)->rc_pos),(*(info)->read_function)(info,0,0)) -#define my_b_tell(info) ((info)->pos_in_file + \ - ((info)->rc_pos - (info)->rc_request_pos)) +#define my_write_cache(info) (((info)->type == WRITE_CACHE)) +#define my_cache_pointer(info) (my_write_cache(info) ? \ + ((info)->write_pos) : ((info)->rc_pos)) -#define my_b_bytes_in_cache(info) ((uint) ((info)->rc_end - (info)->rc_pos)) +#define my_b_tell(info) ((info)->pos_in_file + \ + my_cache_pointer(info) - (info)->rc_request_pos) + +#define my_b_bytes_in_cache(info) (my_write_cache(info) ? \ + ((uint) ((info)->write_end - (info)->write_pos)): \ + ((uint) ((info)->rc_end - (info)->rc_pos))) typedef struct st_changeable_var { const char *name; /* Name of variable */ diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 61295bd5f12..af595e80244 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -177,6 +177,7 @@ while test $# -gt 0; do --skip-rpl) NO_SLAVE=1 ;; --skip-test=*) SKIP_TEST=`$ECHO "$1" | $SED -e "s;--skip-test=;;"`;; --do-test=*) DO_TEST=`$ECHO "$1" | $SED -e "s;--do-test=;;"`;; + --skip-gdb-magic) SKIP_GDB_MAGIC=1 ;; --wait-timeout=*) START_WAIT_TIMEOUT=`$ECHO "$1" | $SED -e "s;--wait-timeout=;;"` STOP_WAIT_TIMEOUT=$START_WAIT_TIMEOUT;; @@ -654,7 +655,7 @@ start_master() --basedir=$MY_BASEDIR --init-rpl-role=master \ --port=$MASTER_MYPORT \ --exit-info=256 \ - --core + --core \ --datadir=$MASTER_MYDDIR \ --pid-file=$MASTER_MYPID \ --socket=$MASTER_MYSOCK \ @@ -694,13 +695,18 @@ start_master() "gdb -x $GDB_MASTER_INIT" $MYSQLD elif [ x$DO_GDB = x1 ] then - $CAT <<__GDB_MASTER_INIT__ > $GDB_MASTER_INIT + ( echo set args $master_args; + if [ -z "$SKIP_GDB_MAGIC" ] ; + then + cat < $GDB_MASTER_INIT manager_launch master $XTERM -display $DISPLAY \ -title "Master" -e gdb -x $GDB_MASTER_INIT $MYSQLD else @@ -982,7 +988,7 @@ run_testcase () fi fi cd $MYSQL_TEST_DIR - + if [ -f $tf ] ; then $RM -f r/$tname.*reject mysql_test_args="-R r/$tname.result $EXTRA_MYSQL_TEST_OPT" diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c index 76b8055bb45..4e8f3e19ad9 100644 --- a/mysys/mf_iocache2.c +++ b/mysys/mf_iocache2.c @@ -38,10 +38,10 @@ void my_b_seek(IO_CACHE *info,my_off_t pos) } else if (info->type == WRITE_CACHE) { - byte* try_rc_pos; - try_rc_pos = info->rc_pos + (pos - info->pos_in_file); - if (try_rc_pos >= info->buffer && try_rc_pos <= info->rc_end) - info->rc_pos = try_rc_pos; + byte* try_write_pos; + try_write_pos = info->write_pos + (pos - info->pos_in_file); + if (try_write_pos >= info->buffer && try_write_pos <= info->write_end) + info->write_pos = try_write_pos; else flush_io_cache(info); } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0c6f9e7dc53..e6f712dc6da 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -627,7 +627,9 @@ void kill_mysql(void) #endif DBUG_PRINT("quit",("After pthread_kill")); shutdown_in_progress=1; // Safety if kill didn't work +#ifdef SIGNALS_DONT_BREAK_READ abort_loop=1; +#endif DBUG_VOID_RETURN; } diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index ece8e11064b..c836e6803ee 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -138,6 +138,7 @@ int update_slave_list(MYSQL* mysql) goto err; } si->server_id = server_id; + hash_insert(&slave_list, (byte*)si); } strnmov(si->host, row[1], sizeof(si->host)); si->port = atoi(row[port_ind]);