Skip to content

Commit d2a5d97

Browse files
author
Sreeharsha Ramanavarapu
committed
Bug# 19573096: LOADING CORRUPTED GEOMETRY DATA INTO A
MYISAM TABLE CAUSES THE SERVER TO CRASH Backport to mysql-5.1
1 parent e65f3f6 commit d2a5d97

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

storage/myisam/rt_split.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
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)
7070
b += 2;
7171
}while (a != end);
7272

73+
/* Check for infinity or NaN */
74+
if (my_isinf(square) || isnan(square))
75+
square = DBL_MAX;
76+
7377
return square;
7478
}
7579

@@ -104,6 +108,9 @@ static void pick_seeds(SplitStruct *node, int n_entries,
104108
double max_d = -DBL_MAX;
105109
double d;
106110

111+
*seed_a = node;
112+
*seed_b = node + 1;
113+
107114
for (cur1 = node; cur1 < lim1; ++cur1)
108115
{
109116
for (cur2=cur1 + 1; cur2 < lim2; ++cur2)

0 commit comments

Comments
 (0)