diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 13:44:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 13:44:03 +0000 |
commit | 293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch) | |
tree | fc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /src/test/regress/expected/line.out | |
parent | Initial commit. (diff) | |
download | postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip |
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/regress/expected/line.out')
-rw-r--r-- | src/test/regress/expected/line.out | 148 |
1 files changed, 148 insertions, 0 deletions
diff --git a/src/test/regress/expected/line.out b/src/test/regress/expected/line.out new file mode 100644 index 0000000..e7d4332 --- /dev/null +++ b/src/test/regress/expected/line.out @@ -0,0 +1,148 @@ +-- +-- 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 ('{}'); +ERROR: invalid input syntax for type line: "{}" +LINE 1: INSERT INTO LINE_TBL VALUES ('{}'); + ^ +INSERT INTO LINE_TBL VALUES ('{0'); +ERROR: invalid input syntax for type line: "{0" +LINE 1: INSERT INTO LINE_TBL VALUES ('{0'); + ^ +INSERT INTO LINE_TBL VALUES ('{0,0}'); +ERROR: invalid input syntax for type line: "{0,0}" +LINE 1: INSERT INTO LINE_TBL VALUES ('{0,0}'); + ^ +INSERT INTO LINE_TBL VALUES ('{0,0,1'); +ERROR: invalid input syntax for type line: "{0,0,1" +LINE 1: INSERT INTO LINE_TBL VALUES ('{0,0,1'); + ^ +INSERT INTO LINE_TBL VALUES ('{0,0,1}'); +ERROR: invalid line specification: A and B cannot both be zero +LINE 1: INSERT INTO LINE_TBL VALUES ('{0,0,1}'); + ^ +INSERT INTO LINE_TBL VALUES ('{0,0,1} x'); +ERROR: invalid input syntax for type line: "{0,0,1} x" +LINE 1: INSERT INTO LINE_TBL VALUES ('{0,0,1} x'); + ^ +INSERT INTO LINE_TBL VALUES ('(3asdf,2 ,3,4r2)'); +ERROR: invalid input syntax for type line: "(3asdf,2 ,3,4r2)" +LINE 1: INSERT INTO LINE_TBL VALUES ('(3asdf,2 ,3,4r2)'); + ^ +INSERT INTO LINE_TBL VALUES ('[1,2,3, 4'); +ERROR: invalid input syntax for type line: "[1,2,3, 4" +LINE 1: INSERT INTO LINE_TBL VALUES ('[1,2,3, 4'); + ^ +INSERT INTO LINE_TBL VALUES ('[(,2),(3,4)]'); +ERROR: invalid input syntax for type line: "[(,2),(3,4)]" +LINE 1: INSERT INTO LINE_TBL VALUES ('[(,2),(3,4)]'); + ^ +INSERT INTO LINE_TBL VALUES ('[(1,2),(3,4)'); +ERROR: invalid input syntax for type line: "[(1,2),(3,4)" +LINE 1: INSERT INTO LINE_TBL VALUES ('[(1,2),(3,4)'); + ^ +INSERT INTO LINE_TBL VALUES ('[(1,2),(1,2)]'); +ERROR: invalid line specification: must be two distinct points +LINE 1: INSERT INTO LINE_TBL VALUES ('[(1,2),(1,2)]'); + ^ +INSERT INTO LINE_TBL VALUES (line(point '(1,0)', point '(1,0)')); +ERROR: invalid line specification: must be two distinct points +select * from LINE_TBL; + s +------------------------------------------------ + {0,-1,5} + {1,0,5} + {0,3,0} + {1,-1,0} + {-0.4,-1,-6} + {-0.0001846153846153846,-1,15.384615384615387} + {3,NaN,5} + {NaN,NaN,NaN} + {0,-1,3} + {-1,0,3} +(10 rows) + +select '{nan, 1, nan}'::line = '{nan, 1, nan}'::line as true, + '{nan, 1, nan}'::line = '{nan, 2, nan}'::line as false; + true | false +------+------- + t | f +(1 row) + +-- test non-error-throwing API for some core types +SELECT pg_input_is_valid('{1, 1}', 'line'); + pg_input_is_valid +------------------- + f +(1 row) + +SELECT * FROM pg_input_error_info('{1, 1}', 'line'); + message | detail | hint | sql_error_code +----------------------------------------------+--------+------+---------------- + invalid input syntax for type line: "{1, 1}" | | | 22P02 +(1 row) + +SELECT pg_input_is_valid('{0, 0, 0}', 'line'); + pg_input_is_valid +------------------- + f +(1 row) + +SELECT * FROM pg_input_error_info('{0, 0, 0}', 'line'); + message | detail | hint | sql_error_code +---------------------------------------------------------+--------+------+---------------- + invalid line specification: A and B cannot both be zero | | | 22P02 +(1 row) + +SELECT pg_input_is_valid('{1, 1, a}', 'line'); + pg_input_is_valid +------------------- + f +(1 row) + +SELECT * FROM pg_input_error_info('{1, 1, a}', 'line'); + message | detail | hint | sql_error_code +-------------------------------------------------+--------+------+---------------- + invalid input syntax for type line: "{1, 1, a}" | | | 22P02 +(1 row) + +SELECT pg_input_is_valid('{1, 1, 1e400}', 'line'); + pg_input_is_valid +------------------- + f +(1 row) + +SELECT * FROM pg_input_error_info('{1, 1, 1e400}', 'line'); + message | detail | hint | sql_error_code +---------------------------------------------------+--------+------+---------------- + "1e400" is out of range for type double precision | | | 22003 +(1 row) + +SELECT pg_input_is_valid('(1, 1), (1, 1e400)', 'line'); + pg_input_is_valid +------------------- + f +(1 row) + +SELECT * FROM pg_input_error_info('(1, 1), (1, 1e400)', 'line'); + message | detail | hint | sql_error_code +---------------------------------------------------+--------+------+---------------- + "1e400" is out of range for type double precision | | | 22003 +(1 row) + |