Skip to content

YQL-17567: Patch regression PG tests to workaround INSERTs without column list, which is unsupported atm #1185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ydb/library/yql/tests/postgresql/cases/boolean.err
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ FROM booltbl3 ORDER BY o;
CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
</sql-statement>
<sql-statement>
INSERT INTO booltbl4 VALUES (false, true, null);
INSERT INTO booltbl4 (isfalse, istrue, isnul) VALUES (false, true, null);
</sql-statement>
<sql-statement>
\pset null '(null)'
Expand Down
38 changes: 37 additions & 1 deletion ydb/library/yql/tests/postgresql/cases/boolean.out
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ INSERT INTO BOOLTBL3 (d, b, o) VALUES ('null', null, 3);
-- correct. Use a table as source to prevent constant simplification
-- to interfer.
CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
INSERT INTO booltbl4 VALUES (false, true, null);
INSERT INTO booltbl4 (isfalse, istrue, isnul) VALUES (false, true, null);
\pset null '(null)'
-- AND expression need to return null if there's any nulls and not all
-- of the value are true
Expand All @@ -325,6 +325,24 @@ SELECT isnul AND istrue AND istrue FROM booltbl4;
(null)
(1 row)

SELECT isfalse AND isnul AND istrue FROM booltbl4;
?column?
----------
f
(1 row)

SELECT istrue AND isfalse AND isnul FROM booltbl4;
?column?
----------
f
(1 row)

SELECT isnul AND istrue AND isfalse FROM booltbl4;
?column?
----------
f
(1 row)

-- OR expression need to return null if there's any nulls and none
-- of the value is true
SELECT isfalse OR isnul OR isfalse FROM booltbl4;
Expand All @@ -345,6 +363,24 @@ SELECT isnul OR isfalse OR isfalse FROM booltbl4;
(null)
(1 row)

SELECT isfalse OR isnul OR istrue FROM booltbl4;
?column?
----------
t
(1 row)

SELECT istrue OR isfalse OR isnul FROM booltbl4;
?column?
----------
t
(1 row)

SELECT isnul OR istrue OR isfalse FROM booltbl4;
?column?
----------
t
(1 row)

--
-- Clean up
-- Many tables are retained by the regression test, but these do not seem
Expand Down
8 changes: 7 additions & 1 deletion ydb/library/yql/tests/postgresql/cases/boolean.sql
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,24 @@ INSERT INTO BOOLTBL3 (d, b, o) VALUES ('null', null, 3);
-- correct. Use a table as source to prevent constant simplification
-- to interfer.
CREATE TABLE booltbl4(isfalse bool, istrue bool, isnul bool);
INSERT INTO booltbl4 VALUES (false, true, null);
INSERT INTO booltbl4 (isfalse, istrue, isnul) VALUES (false, true, null);
\pset null '(null)'
-- AND expression need to return null if there's any nulls and not all
-- of the value are true
SELECT istrue AND isnul AND istrue FROM booltbl4;
SELECT istrue AND istrue AND isnul FROM booltbl4;
SELECT isnul AND istrue AND istrue FROM booltbl4;
SELECT isfalse AND isnul AND istrue FROM booltbl4;
SELECT istrue AND isfalse AND isnul FROM booltbl4;
SELECT isnul AND istrue AND isfalse FROM booltbl4;
-- OR expression need to return null if there's any nulls and none
-- of the value is true
SELECT isfalse OR isnul OR isfalse FROM booltbl4;
SELECT isfalse OR isfalse OR isnul FROM booltbl4;
SELECT isnul OR isfalse OR isfalse FROM booltbl4;
SELECT isfalse OR isnul OR istrue FROM booltbl4;
SELECT istrue OR isfalse OR isnul FROM booltbl4;
SELECT isnul OR istrue OR isfalse FROM booltbl4;
--
-- Clean up
-- Many tables are retained by the regression test, but these do not seem
Expand Down
30 changes: 24 additions & 6 deletions ydb/library/yql/tests/postgresql/cases/int8.err
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
CREATE TABLE INT8_TBL(q1 int8, q2 int8);
</sql-statement>
<sql-statement>
INSERT INTO INT8_TBL VALUES(' 123 ',' 456');
INSERT INTO INT8_TBL (q1, q2) VALUES(' 123 ',' 456');
</sql-statement>
<sql-statement>
INSERT INTO INT8_TBL VALUES('123 ','4567890123456789');
INSERT INTO INT8_TBL (q1, q2) VALUES('123 ','4567890123456789');
</sql-statement>
<sql-statement>
INSERT INTO INT8_TBL VALUES('4567890123456789','123');
INSERT INTO INT8_TBL (q1, q2) VALUES('4567890123456789','123');
</sql-statement>
<sql-statement>
INSERT INTO INT8_TBL VALUES(+4567890123456789,'4567890123456789');
INSERT INTO INT8_TBL (q1, q2) VALUES(+4567890123456789,'4567890123456789');
</sql-statement>
<sql-statement>
INSERT INTO INT8_TBL VALUES('+4567890123456789','-4567890123456789');
INSERT INTO INT8_TBL (q1, q2) VALUES('+4567890123456789','-4567890123456789');
</sql-statement>
<sql-statement>
-- bad inputs
Expand Down Expand Up @@ -215,6 +215,15 @@ SELECT q1, q2, q1 - q2 AS minus FROM INT8_TBL;
<sql-statement>
SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
</sql-statement>
-stdin-:<main>: Fatal: Execution

-stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
^
-stdin-:<main>:1:1: Fatal: ERROR: bigint out of range

SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL;
^
<sql-statement>
SELECT q1, q2, q1 * q2 AS multiply FROM INT8_TBL
WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);
Expand Down Expand Up @@ -684,6 +693,15 @@ SELECT CAST('922337203685477580700.0'::float8 AS int8);
<sql-statement>
SELECT CAST(q1 AS oid) FROM INT8_TBL;
</sql-statement>
-stdin-:<main>: Fatal: Execution

-stdin-:<main>:1:1: Fatal: Execution of node: YtMap!
SELECT CAST(q1 AS oid) FROM INT8_TBL;
^
-stdin-:<main>:1:1: Fatal: ERROR: OID out of range

SELECT CAST(q1 AS oid) FROM INT8_TBL;
^
<sql-statement>
SELECT oid::int8 FROM pg_class WHERE relname = 'pg_class';
</sql-statement>
Expand Down Expand Up @@ -717,6 +735,6 @@ SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::in
<sql-statement>
SELECT * FROM generate_series('+4567890123456789'::int8, '+4567890123456799'::int8, 2);
</sql-statement>
pgrun: /-S/ydbwork/ydb/contrib/libs/llvm12/lib/IR/LegacyPassManager.cpp:588: void llvm::PMTopLevelManager::setLastUser(ArrayRef<Pass *>, Pass *): Assertion `AnalysisPass && "Expected analysis pass to exist."' failed.
pgrun: /-S/ydbwork/ydb/ydb/contrib/libs/llvm12/lib/IR/LegacyPassManager.cpp:588: void llvm::PMTopLevelManager::setLastUser(ArrayRef<Pass *>, Pass *): Assertion `AnalysisPass && "Expected analysis pass to exist."' failed.
pthread_kill at ./nptl/./nptl/pthread_kill.c:43:17
?? at ??:0:0
Loading