From d2a5d9716a675ea3e54aee807ba4f1f90eacc2eb Mon Sep 17 00:00:00 2001 From: Sreeharsha Ramanavarapu Date: Fri, 10 Apr 2015 08:45:57 +0530 Subject: [PATCH] Bug# 19573096: LOADING CORRUPTED GEOMETRY DATA INTO A MYISAM TABLE CAUSES THE SERVER TO CRASH Backport to mysql-5.1 --- storage/myisam/rt_split.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/storage/myisam/rt_split.c b/storage/myisam/rt_split.c index 60f6a199778..bd31621e0e0 100644 --- a/storage/myisam/rt_split.c +++ b/storage/myisam/rt_split.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -70,6 +70,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; } @@ -104,6 +108,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)