Commit 54e887b2 authored by Chaithra Gopalareddy's avatar Chaithra Gopalareddy

Bug#23280059: ITEM_ROW::ILLEGAL_METHOD_CALL(CONST CHAR*):

	      ASSERTION `0' FAILED ON SELECT AREA

Problem:
Optimizer tries to get the points to calculate area without
checking the return value of uint4korr for 0 "points". As a
result server exits.

Solution:
Check the return value from uint4korr().
parent 09784e24
/* /*
Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -849,6 +849,8 @@ int Gis_polygon::area(double *ar, const char **end_of_data) const ...@@ -849,6 +849,8 @@ int Gis_polygon::area(double *ar, const char **end_of_data) const
if (no_data(data, 4)) if (no_data(data, 4))
return 1; return 1;
n_points= uint4korr(data); n_points= uint4korr(data);
if (n_points == 0)
return 1;
if (not_enough_points(data, n_points)) if (not_enough_points(data, n_points))
return 1; return 1;
get_point(&prev_x, &prev_y, data+4); get_point(&prev_x, &prev_y, data+4);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment