CREATE TABLE t3 (c int) ENGINE = MYISAM; --echo don't need to keep track of insert statements --disable_query_log let $input= 4000; while ($input) { eval INSERT INTO t3 VALUES($input); dec $input; } --enable_query_log CREATE TABLE t4 (c int) ENGINE = MYISAM; --echo don't need to keep track of insert statements --disable_query_log let $input= 4000; while ($input) { eval INSERT INTO t4 VALUES($input*2); dec $input; } --enable_query_log --echo merge t3, t4 = success #Merging into new table t6 --exec $MYISAMPACK --join=$MYSQLTEST_VARDIR/master-data/test/t6 $MYSQLTEST_VARDIR/master-data/test/t3 $MYSQLTEST_VARDIR/master-data/test/t4 --echo ==++== HACK to make merge work -- need to copy existing .FRM file for merged table --copy_file $MYSQLTEST_VARDIR/master-data/test/t4.FRM $MYSQLTEST_VARDIR/master-data/test/t6.FRM SELECT MAX(c), MIN(c) FROM t6; --echo Check that it worked SELECT * FROM t6 WHERE c < 10; #Verify t6 is read-only #INSERT INTO t6 VALUES(8001); #Verify source tables are not packed / read-only SELECT MAX(c), MIN(c) FROM t4; INSERT INTO t4 VALUES(8001);