From ae826010351ab69a056034769124f3dac67a3de7 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Wed, 9 Oct 2013 17:30:50 +0500 Subject: 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. --- sql/spatial.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/spatial.cc b/sql/spatial.cc index 32a2012a49d..1d4051487ae 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -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); -- cgit v1.2.1