Skip to content

Commit

Permalink
YQL-16026: Remove PG tests char.sql and varchar.sql from ignored (ydb…
Browse files Browse the repository at this point in the history
…-platform#1178)

* Added char and varchar to the tests that are built

* Added tests & results for char & varchar

* Updated .err files

* Updated regression tests' status
  • Loading branch information
marsaly79 authored Jan 20, 2024
1 parent 5eab99d commit dbe5bdc
Show file tree
Hide file tree
Showing 17 changed files with 860 additions and 177 deletions.
101 changes: 101 additions & 0 deletions ydb/library/yql/tests/postgresql/cases/char.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<sql-statement>
--
-- CHAR
--
-- fixed-length by value
-- internally passed by value if <= 4 bytes in storage
SELECT char 'c' = char 'c' AS true;
</sql-statement>
<sql-statement>
--
-- Build a table for testing
--
CREATE TABLE CHAR_TBL(f1 char);
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('a');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('A');
</sql-statement>
<sql-statement>
-- any of the following three input formats are acceptable
INSERT INTO CHAR_TBL (f1) VALUES ('1');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES (2);
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('3');
</sql-statement>
<sql-statement>
-- zero-length char
INSERT INTO CHAR_TBL (f1) VALUES ('');
</sql-statement>
<sql-statement>
-- try char's of greater than 1 length
INSERT INTO CHAR_TBL (f1) VALUES ('cd');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('c ');
</sql-statement>
<sql-statement>
SELECT * FROM CHAR_TBL;
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 <> 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 = 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 < 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 <= 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 > 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 >= 'a';
</sql-statement>
<sql-statement>
DROP TABLE CHAR_TBL;
</sql-statement>
<sql-statement>
--
-- Now test longer arrays of char
--
CREATE TABLE CHAR_TBL(f1 char(4));
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('a');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('ab');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('abcde');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
</sql-statement>
<sql-statement>
SELECT * FROM CHAR_TBL;
</sql-statement>
101 changes: 101 additions & 0 deletions ydb/library/yql/tests/postgresql/cases/char.err.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<sql-statement>
--
-- CHAR
--
-- fixed-length by value
-- internally passed by value if <= 4 bytes in storage
SELECT char 'c' = char 'c' AS true;
</sql-statement>
<sql-statement>
--
-- Build a table for testing
--
CREATE TABLE CHAR_TBL(f1 char);
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('a');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('A');
</sql-statement>
<sql-statement>
-- any of the following three input formats are acceptable
INSERT INTO CHAR_TBL (f1) VALUES ('1');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES (2);
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('3');
</sql-statement>
<sql-statement>
-- zero-length char
INSERT INTO CHAR_TBL (f1) VALUES ('');
</sql-statement>
<sql-statement>
-- try char's of greater than 1 length
INSERT INTO CHAR_TBL (f1) VALUES ('cd');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('c ');
</sql-statement>
<sql-statement>
SELECT * FROM CHAR_TBL;
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 <> 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 = 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 < 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 <= 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 > 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 >= 'a';
</sql-statement>
<sql-statement>
DROP TABLE CHAR_TBL;
</sql-statement>
<sql-statement>
--
-- Now test longer arrays of char
--
CREATE TABLE CHAR_TBL(f1 char(4));
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('a');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('ab');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('abcde');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
</sql-statement>
<sql-statement>
SELECT * FROM CHAR_TBL;
</sql-statement>
101 changes: 101 additions & 0 deletions ydb/library/yql/tests/postgresql/cases/char.err.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<sql-statement>
--
-- CHAR
--
-- fixed-length by value
-- internally passed by value if <= 4 bytes in storage
SELECT char 'c' = char 'c' AS true;
</sql-statement>
<sql-statement>
--
-- Build a table for testing
--
CREATE TABLE CHAR_TBL(f1 char);
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('a');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('A');
</sql-statement>
<sql-statement>
-- any of the following three input formats are acceptable
INSERT INTO CHAR_TBL (f1) VALUES ('1');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES (2);
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('3');
</sql-statement>
<sql-statement>
-- zero-length char
INSERT INTO CHAR_TBL (f1) VALUES ('');
</sql-statement>
<sql-statement>
-- try char's of greater than 1 length
INSERT INTO CHAR_TBL (f1) VALUES ('cd');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('c ');
</sql-statement>
<sql-statement>
SELECT * FROM CHAR_TBL;
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 <> 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 = 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 < 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 <= 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 > 'a';
</sql-statement>
<sql-statement>
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 >= 'a';
</sql-statement>
<sql-statement>
DROP TABLE CHAR_TBL;
</sql-statement>
<sql-statement>
--
-- Now test longer arrays of char
--
CREATE TABLE CHAR_TBL(f1 char(4));
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('a');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('ab');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('abcde');
</sql-statement>
<sql-statement>
INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
</sql-statement>
<sql-statement>
SELECT * FROM CHAR_TBL;
</sql-statement>
26 changes: 26 additions & 0 deletions ydb/library/yql/tests/postgresql/cases/char.out
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,29 @@ SELECT char 'c' = char 'c' AS true;
-- Build a table for testing
--
CREATE TABLE CHAR_TBL(f1 char);
INSERT INTO CHAR_TBL (f1) VALUES ('a');
INSERT INTO CHAR_TBL (f1) VALUES ('A');
-- any of the following three input formats are acceptable
INSERT INTO CHAR_TBL (f1) VALUES ('1');
INSERT INTO CHAR_TBL (f1) VALUES (2);
INSERT INTO CHAR_TBL (f1) VALUES ('3');
-- zero-length char
INSERT INTO CHAR_TBL (f1) VALUES ('');
INSERT INTO CHAR_TBL (f1) VALUES ('c ');
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 = 'a';
f1
----
a
(1 row)

DROP TABLE CHAR_TBL;
--
-- Now test longer arrays of char
--
CREATE TABLE CHAR_TBL(f1 char(4));
INSERT INTO CHAR_TBL (f1) VALUES ('a');
INSERT INTO CHAR_TBL (f1) VALUES ('ab');
INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
25 changes: 21 additions & 4 deletions ydb/library/yql/tests/postgresql/cases/char.sql
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
--
-- CHAR
--

-- fixed-length by value
-- internally passed by value if <= 4 bytes in storage

SELECT char 'c' = char 'c' AS true;

--
-- Build a table for testing
--

CREATE TABLE CHAR_TBL(f1 char);
INSERT INTO CHAR_TBL (f1) VALUES ('a');
INSERT INTO CHAR_TBL (f1) VALUES ('A');
-- any of the following three input formats are acceptable
INSERT INTO CHAR_TBL (f1) VALUES ('1');
INSERT INTO CHAR_TBL (f1) VALUES (2);
INSERT INTO CHAR_TBL (f1) VALUES ('3');
-- zero-length char
INSERT INTO CHAR_TBL (f1) VALUES ('');
INSERT INTO CHAR_TBL (f1) VALUES ('c ');
SELECT c.*
FROM CHAR_TBL c
WHERE c.f1 = 'a';
DROP TABLE CHAR_TBL;
--
-- Now test longer arrays of char
--
CREATE TABLE CHAR_TBL(f1 char(4));
INSERT INTO CHAR_TBL (f1) VALUES ('a');
INSERT INTO CHAR_TBL (f1) VALUES ('ab');
INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
5 changes: 3 additions & 2 deletions ydb/library/yql/tests/postgresql/cases/json.err
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,9 @@ SELECT repeat('[', 10000)::json;
-stdin-:<main>:1:1: Fatal: Execution of node: Result
SELECT repeat('[', 10000)::json;
^
-stdin-:<main>:1:1: Fatal: ERROR: stack depth limit exceeded
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
-stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
DETAIL: The input string ended unexpectedly.
CONTEXT: JSON data, line 1: ...[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

SELECT repeat('[', 10000)::json;
^
Expand Down
5 changes: 3 additions & 2 deletions ydb/library/yql/tests/postgresql/cases/jsonb.err
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,9 @@ SELECT repeat('[', 10000)::jsonb;
-stdin-:<main>:1:1: Fatal: Execution of node: Result
SELECT repeat('[', 10000)::jsonb;
^
-stdin-:<main>:1:1: Fatal: ERROR: stack depth limit exceeded
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
-stdin-:<main>:1:1: Fatal: ERROR: invalid input syntax for type json
DETAIL: The input string ended unexpectedly.
CONTEXT: JSON data, line 1: ...[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

SELECT repeat('[', 10000)::jsonb;
^
Expand Down
Loading

0 comments on commit dbe5bdc

Please sign in to comment.