MDEV-3856 Import of a large polygon fails/hangs.

The Gis_point::init_from_wkt called the String::realloc(),
        and this call is quite slow in the DEBUG mode. Which makes
        loading the huge polygon hang forever.
        Fixed by using the String::realloc(size, inc_size) version instead
        as it's done for other spatial features.
This commit is contained in:
Alexey Botchkov 2013-10-09 17:30:50 +05:00
parent c8693bea40
commit ae82601035

View File

@ -480,7 +480,7 @@ bool Gis_point::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
double x, y;
if (trs->get_next_number(&x) || trs->get_next_number(&y) ||
wkb->reserve(POINT_DATA_SIZE))
wkb->reserve(POINT_DATA_SIZE, 512))
return 1;
wkb->q_append(x);
wkb->q_append(y);