summaryrefslogtreecommitdiffstats
path: root/src/test/regress/sql/line.sql
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:15:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:15:05 +0000
commit46651ce6fe013220ed397add242004d764fc0153 (patch)
tree6e5299f990f88e60174a1d3ae6e48eedd2688b2b /src/test/regress/sql/line.sql
parentInitial commit. (diff)
downloadpostgresql-14-upstream.tar.xz
postgresql-14-upstream.zip
Adding upstream version 14.5.upstream/14.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/regress/sql/line.sql')
-rw-r--r--src/test/regress/sql/line.sql42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/test/regress/sql/line.sql b/src/test/regress/sql/line.sql
new file mode 100644
index 0000000..f589ffe
--- /dev/null
+++ b/src/test/regress/sql/line.sql
@@ -0,0 +1,42 @@
+--
+-- LINE
+-- Infinite lines
+--
+
+--DROP TABLE LINE_TBL;
+CREATE TABLE LINE_TBL (s line);
+
+INSERT INTO LINE_TBL VALUES ('{0,-1,5}'); -- A == 0
+INSERT INTO LINE_TBL VALUES ('{1,0,5}'); -- B == 0
+INSERT INTO LINE_TBL VALUES ('{0,3,0}'); -- A == C == 0
+INSERT INTO LINE_TBL VALUES (' (0,0), (6,6)');
+INSERT INTO LINE_TBL VALUES ('10,-10 ,-5,-4');
+INSERT INTO LINE_TBL VALUES ('[-1e6,2e2,3e5, -4e1]');
+
+INSERT INTO LINE_TBL VALUES ('{3,NaN,5}');
+INSERT INTO LINE_TBL VALUES ('{NaN,NaN,NaN}');
+
+-- horizontal
+INSERT INTO LINE_TBL VALUES ('[(1,3),(2,3)]');
+-- vertical
+INSERT INTO LINE_TBL VALUES (line(point '(3,1)', point '(3,2)'));
+
+-- bad values for parser testing
+INSERT INTO LINE_TBL VALUES ('{}');
+INSERT INTO LINE_TBL VALUES ('{0');
+INSERT INTO LINE_TBL VALUES ('{0,0}');
+INSERT INTO LINE_TBL VALUES ('{0,0,1');
+INSERT INTO LINE_TBL VALUES ('{0,0,1}');
+INSERT INTO LINE_TBL VALUES ('{0,0,1} x');
+INSERT INTO LINE_TBL VALUES ('(3asdf,2 ,3,4r2)');
+INSERT INTO LINE_TBL VALUES ('[1,2,3, 4');
+INSERT INTO LINE_TBL VALUES ('[(,2),(3,4)]');
+INSERT INTO LINE_TBL VALUES ('[(1,2),(3,4)');
+INSERT INTO LINE_TBL VALUES ('[(1,2),(1,2)]');
+
+INSERT INTO LINE_TBL VALUES (line(point '(1,0)', point '(1,0)'));
+
+select * from LINE_TBL;
+
+select '{nan, 1, nan}'::line = '{nan, 1, nan}'::line as true,
+ '{nan, 1, nan}'::line = '{nan, 2, nan}'::line as false;