summaryrefslogtreecommitdiff
path: root/storage/myisammrg
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2010-07-02 19:21:07 +0400
committerKonstantin Osipov <kostja@sun.com>2010-07-02 19:21:07 +0400
commit0e9b910d6b7442a42f2aea0a0043327fff44b267 (patch)
tree95a71247e440a3906787d5e6df3a8e6ef72051a7 /storage/myisammrg
parent4e2a2bc93e0da353aa1a3dcc9259f4d31a5aab54 (diff)
downloadmariadb-git-0e9b910d6b7442a42f2aea0a0043327fff44b267.tar.gz
A test case for Bug#50788 "main.merge fails on HPUX",
and a backport of relevant changes from the 6.0 version of the fix done by Ingo Struewing. The bug itself was fixed by the patch for Bug#54811. MyISAMMRG engine would try to use MMAP on its children even on platforms that don't support it and even if myisam_use_mmap option was off. This lead to an infinite hang in INSERT ... SELECT into a MyISAMMRG table when the destination MyISAM table was also selected from. A bug in duplicate detection fixed by 54811 was essential to the hang - when a duplicate is detected, the optimizer disables the use of memory mapped files, and it wasn't the case. The patch below is also to not turn on MMAP on children tables if myisam_use_mmap is off. A test case is added to cover MyISAMMRG and myisam_use_mmap option.
Diffstat (limited to 'storage/myisammrg')
-rw-r--r--storage/myisammrg/ha_myisammrg.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 67b81225b13..1681f062117 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -1322,6 +1322,8 @@ int ha_myisammrg::extra(enum ha_extra_function operation)
if (operation == HA_EXTRA_FORCE_REOPEN ||
operation == HA_EXTRA_PREPARE_FOR_DROP)
return 0;
+ if (operation == HA_EXTRA_MMAP && !opt_myisam_use_mmap)
+ return 0;
return myrg_extra(file,operation,0);
}