1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Fix circle_in to accept "(x,y),r" as it's advertised to do.

Our documentation describes four allowed input syntaxes for circles,
but the regression tests tried only three ... with predictable
consequences.  Remarkably, this has been wrong since the circle
datatype was added in 1997, but nobody noticed till now.

David Zhang, with some help from me

Discussion: https://postgr.es/m/332c47fa-d951-7574-b5cc-a8f7f7201202@highgo.ca
This commit is contained in:
Tom Lane
2020-04-07 20:50:02 -04:00
parent 6e6b74a206
commit 35d1eefb29
3 changed files with 16 additions and 13 deletions

View File

@ -6,10 +6,10 @@
SET extra_float_digits = -1;
CREATE TABLE CIRCLE_TBL (f1 circle);
INSERT INTO CIRCLE_TBL VALUES ('<(5,1),3>');
INSERT INTO CIRCLE_TBL VALUES ('<(1,2),100>');
INSERT INTO CIRCLE_TBL VALUES ('1,3,5');
INSERT INTO CIRCLE_TBL VALUES ('((1,2),3)');
INSERT INTO CIRCLE_TBL VALUES ('<(100,200),10>');
INSERT INTO CIRCLE_TBL VALUES ('((1,2),100)');
INSERT INTO CIRCLE_TBL VALUES (' 1 , 3 , 5 ');
INSERT INTO CIRCLE_TBL VALUES (' ( ( 1 , 2 ) , 3 ) ');
INSERT INTO CIRCLE_TBL VALUES (' ( 100 , 200 ) , 10 ');
INSERT INTO CIRCLE_TBL VALUES (' < ( 100 , 1 ) , 115 > ');
INSERT INTO CIRCLE_TBL VALUES ('<(3,5),0>'); -- Zero radius
INSERT INTO CIRCLE_TBL VALUES ('<(3,5),NaN>'); -- NaN radius

View File

@ -10,13 +10,13 @@ CREATE TABLE CIRCLE_TBL (f1 circle);
INSERT INTO CIRCLE_TBL VALUES ('<(5,1),3>');
INSERT INTO CIRCLE_TBL VALUES ('<(1,2),100>');
INSERT INTO CIRCLE_TBL VALUES ('((1,2),100)');
INSERT INTO CIRCLE_TBL VALUES ('1,3,5');
INSERT INTO CIRCLE_TBL VALUES (' 1 , 3 , 5 ');
INSERT INTO CIRCLE_TBL VALUES ('((1,2),3)');
INSERT INTO CIRCLE_TBL VALUES (' ( ( 1 , 2 ) , 3 ) ');
INSERT INTO CIRCLE_TBL VALUES ('<(100,200),10>');
INSERT INTO CIRCLE_TBL VALUES (' ( 100 , 200 ) , 10 ');
INSERT INTO CIRCLE_TBL VALUES (' < ( 100 , 1 ) , 115 > ');