Description:
I hit this bug while testing WL#8313 (changing binlog_format default to ROW):
$ ./mtr --mem main.merge
Logging: /home/.../mysql-test-run.pl --mem main.merge
MySQL Version 5.7.7
Checking supported features...
- SSL connections supported
- binaries are debug compiled
Collecting tests...
Checking leftover processes...
Removing old var directory...
Creating var directory '/home/.../mysql-5.7/debug/mysql-test/var'...
- symlinking 'var' to '/dev/shm/var_auto_pWhg'
Installing system database...
==============================================================================
TEST RESULT TIME (ms) or COMMENT
--------------------------------------------------------------------------
worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
main.merge [ fail ]
Test ended at 2015-02-20 09:15:29
CURRENT_TEST: main.merge
mysqltest: At line 2316: query 'CREATE TABLE m2 LIKE m1' failed: 2013: Lost connection to MySQL server during query
Notice that this issue might be related with Bug#72074, but it doesn't require replication nor binlog enabled to be reproduced.
How to repeat:
Set binlog_format to ROW at the top of the test case:
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index e72b903..e865d17 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -1,6 +1,7 @@
#
# Test of MERGE TABLES
#
+SET binlog_format=ROW;
# MERGE tables require MyISAM tables
--source include/have_myisam.inc
And run:
./mtr --mem main.merge
Suggested fix:
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 528b945..6c86da5 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -1584,6 +1584,10 @@ void ha_myisammrg::append_create_info(String *packet)
*/
if (file->open_tables == file->end_table)
return;
+
+ if (children_l == NULL)
+ return;
+
packet->append(STRING_WITH_LEN(" UNION=("));
current_db= table->s->db.str;