summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorSreeharsha Ramanavarapu <sreeharsha.ramanavarapu@oracle.com>2015-03-23 08:49:26 +0530
committerSreeharsha Ramanavarapu <sreeharsha.ramanavarapu@oracle.com>2015-03-23 08:49:26 +0530
commitb7bdea944d6336a810608d183ecb9c8f2100cd05 (patch)
treeefd7d0d3f20bc8a3af2473493a7b87067e0390d4 /storage/myisam
parent120907c0a2efbafb2f42b95f0ee7e6b8afea467d (diff)
downloadmariadb-git-b7bdea944d6336a810608d183ecb9c8f2100cd05.tar.gz
Bug# 19573096: LOADING CORRUPTED GEOMETRY DATA INTO A
MYISAM TABLE CAUSES THE SERVER TO CRASH Issue: ----- During index maintanence, R-tree node might need a split. In some cases the square of mbr could be calculated to infinite (as in this case) or to NaN. This is currently not handled. This is specific to MyISAM. SOLUTION: --------- If the calculated value in "mbr_join_square" is infinite or NaN, set it to max double value. Initialization of output parameters of "pick_seeds" is required if calculation is infinite (or negative infinite). Similar to the fix made for INNODB as part of Bug#19533996.
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/rt_split.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/storage/myisam/rt_split.c b/storage/myisam/rt_split.c
index 955a69c6588..d37084f79b8 100644
--- a/storage/myisam/rt_split.c
+++ b/storage/myisam/rt_split.c
@@ -68,6 +68,10 @@ static double mbr_join_square(const double *a, const double *b, int n_dim)
b += 2;
}while (a != end);
+ /* Check for infinity or NaN */
+ if (my_isinf(square) || isnan(square))
+ square = DBL_MAX;
+
return square;
}
@@ -102,6 +106,9 @@ static void pick_seeds(SplitStruct *node, int n_entries,
double max_d = -DBL_MAX;
double d;
+ *seed_a = node;
+ *seed_b = node + 1;
+
for (cur1 = node; cur1 < lim1; ++cur1)
{
for (cur2=cur1 + 1; cur2 < lim2; ++cur2)