aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/geo_ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt/geo_ops.c')
-rw-r--r--src/backend/utils/adt/geo_ops.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index dfb71a2f4ed..e24d75ff24d 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -4596,8 +4596,8 @@ poly_path(PG_FUNCTION_ARGS)
/* circle_in - convert a string to internal form.
*
* External format: (center and radius of circle)
- * "((f8,f8)<f8>)"
- * also supports quick entry style "(f8,f8,f8)"
+ * "<(f8,f8),f8>"
+ * also supports quick entry style "f8,f8,f8"
*/
Datum
circle_in(PG_FUNCTION_ARGS)
@@ -4613,16 +4613,19 @@ circle_in(PG_FUNCTION_ARGS)
s = str;
while (isspace((unsigned char) *s))
s++;
- if ((*s == LDELIM_C) || (*s == LDELIM))
+ if (*s == LDELIM_C)
+ depth++, s++;
+ else if (*s == LDELIM)
{
- depth++;
+ /* If there are two left parens, consume the first one */
cp = (s + 1);
while (isspace((unsigned char) *cp))
cp++;
if (*cp == LDELIM)
- s = cp;
+ depth++, s = cp;
}
+ /* pair_decode will consume parens around the pair, if any */
if (!pair_decode(s, &circle->center.x, &circle->center.y, &s))
ereport(ERROR,
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),