diff --git a/mysql-test/r/myisampack.result b/mysql-test/r/myisampack.result index 3f94669108f..1efde35ba9f 100644 --- a/mysql-test/r/myisampack.result +++ b/mysql-test/r/myisampack.result @@ -91,12 +91,14 @@ CREATE TABLE t1(a INT); INSERT INTO t1 VALUES(20); CREATE TABLE t2(a INT); INSERT INTO t2 VALUES(40); +FLUSH TABLE t1,t2; #If the myisampack --join operation is successful, we have table t3(.frm) #so we should be able to query about the table from server. SELECT COUNT(a) FROM t3; COUNT(a) 1024 # ===== myisampack.2 ===== +FLUSH TABLE t3; #Tests the myisampack join operation with an existing destination .frm file, #the command should return correct exit status(0) and #we should be able to query the table. diff --git a/mysql-test/t/myisampack.test b/mysql-test/t/myisampack.test index 38197980c6f..6f1ac24a507 100644 --- a/mysql-test/t/myisampack.test +++ b/mysql-test/t/myisampack.test @@ -124,7 +124,7 @@ let $i=9; --disable_query_log while ($i) { - INSERT INTO t1 SELECT ROUND(a * RAND() * 10) from t1; + INSERT INTO t1 SELECT a from t1; dec $i; } --enable_query_log @@ -136,11 +136,12 @@ let $i=9; --disable_query_log while ($i) { - INSERT INTO t2 SELECT ROUND(a * RAND() * 10) from t2; + INSERT INTO t2 SELECT a from t2; dec $i; } --enable_query_log +FLUSH TABLE t1,t2; --exec $MYISAMPACK --join=$MYSQLD_DATADIR/test/t3 $MYSQLD_DATADIR/test/t1 $MYSQLD_DATADIR/test/t2 2>&1 --echo #If the myisampack --join operation is successful, we have table t3(.frm) @@ -153,6 +154,7 @@ SELECT COUNT(a) FROM t3; # It should finish the join operation successfully ############################################################################# --echo # ===== myisampack.2 ===== +FLUSH TABLE t3; --remove_file $MYSQLD_DATADIR/test/t3.MYI --remove_file $MYSQLD_DATADIR/test/t3.MYD --exec $MYISAMPACK --join=$MYSQLD_DATADIR/test/t3 $MYSQLD_DATADIR/test/t1 $MYSQLD_DATADIR/test/t2 2>&1 diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index 7cd84b642e4..fec6d32133e 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -781,7 +781,6 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) static int create_dest_frm(char *source_table, char *dest_table) { char source_name[FN_REFLEN], dest_name[FN_REFLEN]; - int error; DBUG_ENTER("create_dest_frm");