From 94806e013dfdd1ba68232d5abc790a39ebb87cf2 Mon Sep 17 00:00:00 2001 From: "tim@cane.mysql.fi" <> Date: Fri, 22 Dec 2000 16:09:10 +0200 Subject: [PATCH 1/3] Fix bug in FINISH.sh that kept CFLAGS from being used. Allow multiple options to be passed to mysql-test-run. --- BUILD/FINISH.sh | 2 +- mysql-test/mysql-test-run.sh | 62 +++++++++++++++--------------------- 2 files changed, 26 insertions(+), 38 deletions(-) diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh index 02deb67bd25..089ff19a7be 100644 --- a/BUILD/FINISH.sh +++ b/BUILD/FINISH.sh @@ -6,7 +6,7 @@ for arg in "$@"; do done -CFLAGS="$cflags" CXX=gcc CXXFLAGS="$cxxflags" eval "$configure" +eval "CFLAGS='$cflags' CXX=gcc CXXFLAGS='$cxxflags' $configure" if [ "x$do_make" = "xno" ] ; then exit 0 diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 5fe578b05a6..63ed0f53bcd 100755 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -60,7 +60,7 @@ TIMEFILE="$MYSQL_TEST_DIR/var/tmp/mysqltest-time" RES_SPACE=" " MYSQLD_SRC_DIRS="strings mysys include extra regex isam merge myisam \ myisammrg heap sql" -GCOV_MSG=/tmp/mysqld-gcov.out #gcov output +GCOV_MSG=/tmp/mysqld-gcov.out GCOV_ERR=/tmp/mysqld-gcov.err MASTER_RUNNING=0 @@ -136,41 +136,29 @@ MYSQL_TEST="$MYSQL_TEST --no-defaults --socket=$MASTER_MYSOCK --database=$DB --u GDB_MASTER_INIT=/tmp/gdbinit.master GDB_SLAVE_INIT=/tmp/gdbinit.slave -if [ "$1" = "--force" ] ; then - FORCE=1 - shift 1 -fi - - -if [ "$1" = "--record" ] ; then - RECORD=1 - shift 1 -fi - - -if [ "$1" = "--gcov" ]; -then - if [ x$BINARY_DIST = x1 ] ; then - echo "Cannot do coverage test without the source - please us source dist" - exit 1 - fi - DO_GCOV=1 - shift 1 -fi - -if [ "$1" = "--gdb" ]; -then -# if the user really wanted to run binary dist in a debugger, he can -# but we should warn him - if [ x$BINARY_DIST = x1 ] ; then - echo "Note: you will get more meaningful output on a source distribution \ - compiled with debugging option when running tests with -gdb option" - fi - DO_GDB=1 - shift 1 -fi - - +while test $# -gt 0; do + case "$1" in + --force ) FORCE=1 ;; + --record ) RECORD=1 ;; + --gcov ) + if [ x$BINARY_DIST = x1 ] ; then + echo "Cannot do coverage test without the source - please use source dist" + exit 1 + fi + DO_GCOV=1 + ;; + --gdb ) + if [ x$BINARY_DIST = x1 ] ; then + echo "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with -gdb option" + fi + DO_GDB=1 + ;; + -- ) shift; break ;; + --* ) echo "Unrecognized option: $1"; exit 1 ;; + * ) break ;; + esac + shift +done #++ # Function Definitions @@ -289,7 +277,7 @@ start_slave() { [ x$SKIP_SLAVE = x1 ] && return [ x$SLAVE_RUNNING = 1 ] && return - if [ -z "$SLAVE_MASTER_INFO" ] ; then + if [ -z "$SLAVE_MASTER_INF" ] ; then master_info="--master-user=root \ --master-connect-retry=1 \ --master-host=127.0.0.1 \ From 281a054f2a85250c1f9507c3d65d8e42912dceb9 Mon Sep 17 00:00:00 2001 From: "tim@cane.mysql.fi" <> Date: Fri, 22 Dec 2000 16:19:54 +0200 Subject: [PATCH 2/3] Fix replace bug w/ BDB tables by passing key_length to index_read_idx. --- mysql-test/t/replace.test | 1 + sql/sql_insert.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/replace.test b/mysql-test/t/replace.test index 4000ee1b4e2..2d59b26a525 100644 --- a/mysql-test/t/replace.test +++ b/mysql-test/t/replace.test @@ -10,6 +10,7 @@ CREATE TABLE t1 ( PRIMARY KEY (gesuchnr,benutzer_id) ) type=ISAM; +replace into t1 (gesuchnr,benutzer_id) values (2,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); alter table t1 type=myisam; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 13da095607d..c10e2a205b8 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -366,7 +366,8 @@ int write_record(TABLE *table,COPY_INFO *info) } key_copy((byte*) key,table,key_nr,0); if ((error=(table->file->index_read_idx(table->record[1],key_nr, - (byte*) key,0, + (byte*) key, + table->key_info[key_nr].key_length, HA_READ_KEY_EXACT)))) goto err; } From c7b405fb6519f56b12dd35bd7080ead0af9ac0d8 Mon Sep 17 00:00:00 2001 From: "tim@cane.mysql.fi" <> Date: Fri, 22 Dec 2000 16:31:57 +0200 Subject: [PATCH 3/3] Fatfinger fix: SLAVE_MASTER_INF -> INFO. --- mysql-test/mysql-test-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 63ed0f53bcd..a0f897a49d9 100755 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -277,7 +277,7 @@ start_slave() { [ x$SKIP_SLAVE = x1 ] && return [ x$SLAVE_RUNNING = 1 ] && return - if [ -z "$SLAVE_MASTER_INF" ] ; then + if [ -z "$SLAVE_MASTER_INFO" ] ; then master_info="--master-user=root \ --master-connect-retry=1 \ --master-host=127.0.0.1 \