Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
4aa0e645
Commit
4aa0e645
authored
26 years ago
by
Thomas G. Lockhart
Browse files
Options
Downloads
Patches
Plain Diff
First tests using JOIN syntax.
parent
348ab948
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/test/regress/expected/join.out
+94
-0
94 additions, 0 deletions
src/test/regress/expected/join.out
src/test/regress/sql/join.sql
+87
-0
87 additions, 0 deletions
src/test/regress/sql/join.sql
src/test/regress/sql/tests
+1
-0
1 addition, 0 deletions
src/test/regress/sql/tests
with
182 additions
and
0 deletions
src/test/regress/expected/join.out
0 → 100644
+
94
−
0
View file @
4aa0e645
QUERY: CREATE TABLE JOIN_TBL (
i integer,
j integer,
x text
);
QUERY: CREATE TABLE JOIN2_TBL (
i integer,
k integer
);
QUERY: INSERT INTO JOIN_TBL VALUES (1, 3, 'one');
QUERY: INSERT INTO JOIN_TBL VALUES (2, 2, 'two');
QUERY: INSERT INTO JOIN_TBL VALUES (3, 1, 'three');
QUERY: INSERT INTO JOIN_TBL VALUES (4, 0, 'four');
QUERY: INSERT INTO JOIN2_TBL VALUES (1, -1);
QUERY: INSERT INTO JOIN2_TBL VALUES (2, 2);
QUERY: INSERT INTO JOIN2_TBL VALUES (3, -3);
QUERY: INSERT INTO JOIN2_TBL VALUES (2, 4);
QUERY: SELECT '' AS "xxx", *
FROM JOIN_TBL CROSS JOIN JOIN2_TBL;
xxx|i|j|x |i| k
---+-+-+-----+-+--
|1|3|one |1|-1
|2|2|two |1|-1
|3|1|three|1|-1
|4|0|four |1|-1
|1|3|one |2| 2
|2|2|two |2| 2
|3|1|three|2| 2
|4|0|four |2| 2
|1|3|one |3|-3
|2|2|two |3|-3
|3|1|three|3|-3
|4|0|four |3|-3
|1|3|one |2| 4
|2|2|two |2| 4
|3|1|three|2| 4
|4|0|four |2| 4
(16 rows)
QUERY: SELECT '' AS "xxx", *
FROM JOIN_TBL NATURAL JOIN JOIN2_TBL;
ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", *
FROM JOIN_TBL INNER JOIN JOIN2_TBL USING (i);
ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", *
FROM JOIN_TBL JOIN JOIN2_TBL ON (JOIN_TBL.i = JOIN2_TBL.i);
ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", *
FROM JOIN_TBL JOIN JOIN2_TBL ON (JOIN_TBL.i = JOIN2_TBL.k);
ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", *
FROM JOIN_TBL CROSS JOIN JOIN2_TBL;
xxx|i|j|x |i| k
---+-+-+-----+-+--
|1|3|one |1|-1
|2|2|two |1|-1
|3|1|three|1|-1
|4|0|four |1|-1
|1|3|one |2| 2
|2|2|two |2| 2
|3|1|three|2| 2
|4|0|four |2| 2
|1|3|one |3|-3
|2|2|two |3|-3
|3|1|three|3|-3
|4|0|four |3|-3
|1|3|one |2| 4
|2|2|two |2| 4
|3|1|three|2| 4
|4|0|four |2| 4
(16 rows)
QUERY: SELECT '' AS "xxx", *
FROM JOIN_TBL JOIN JOIN2_TBL ON (JOIN_TBL.i <= JOIN2_TBL.k);
ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", *
FROM JOIN_TBL OUTER JOIN JOIN2_TBL USING (i);
NOTICE: OUTER JOIN not yet implemented
ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", *
FROM JOIN_TBL LEFT OUTER JOIN JOIN2_TBL USING (i);
NOTICE: LEFT OUTER JOIN not yet implemented
ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", *
FROM JOIN_TBL RIGHT OUTER JOIN JOIN2_TBL USING (i);
NOTICE: RIGHT OUTER JOIN not yet implemented
ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", *
FROM JOIN_TBL FULL OUTER JOIN JOIN2_TBL USING (i);
NOTICE: FULL OUTER JOIN not yet implemented
ERROR: JOIN expressions are not yet implemented
QUERY: DROP TABLE JOIN_TBL;
QUERY: DROP TABLE JOIN2_TBL;
This diff is collapsed.
Click to expand it.
src/test/regress/sql/join.sql
0 → 100644
+
87
−
0
View file @
4aa0e645
--
-- join.sql
--
-- Test join clauses
--
CREATE
TABLE
JOIN_TBL
(
i
integer
,
j
integer
,
x
text
);
CREATE
TABLE
JOIN2_TBL
(
i
integer
,
k
integer
);
INSERT
INTO
JOIN_TBL
VALUES
(
1
,
3
,
'one'
);
INSERT
INTO
JOIN_TBL
VALUES
(
2
,
2
,
'two'
);
INSERT
INTO
JOIN_TBL
VALUES
(
3
,
1
,
'three'
);
INSERT
INTO
JOIN_TBL
VALUES
(
4
,
0
,
'four'
);
INSERT
INTO
JOIN2_TBL
VALUES
(
1
,
-
1
);
INSERT
INTO
JOIN2_TBL
VALUES
(
2
,
2
);
INSERT
INTO
JOIN2_TBL
VALUES
(
3
,
-
3
);
INSERT
INTO
JOIN2_TBL
VALUES
(
2
,
4
);
--
-- Inner joins (equi-joins)
--
SELECT
''
AS
"xxx"
,
*
FROM
JOIN_TBL
CROSS
JOIN
JOIN2_TBL
;
SELECT
''
AS
"xxx"
,
*
FROM
JOIN_TBL
NATURAL
JOIN
JOIN2_TBL
;
SELECT
''
AS
"xxx"
,
*
FROM
JOIN_TBL
INNER
JOIN
JOIN2_TBL
USING
(
i
);
SELECT
''
AS
"xxx"
,
*
FROM
JOIN_TBL
JOIN
JOIN2_TBL
ON
(
JOIN_TBL
.
i
=
JOIN2_TBL
.
i
);
SELECT
''
AS
"xxx"
,
*
FROM
JOIN_TBL
JOIN
JOIN2_TBL
ON
(
JOIN_TBL
.
i
=
JOIN2_TBL
.
k
);
SELECT
''
AS
"xxx"
,
*
FROM
JOIN_TBL
CROSS
JOIN
JOIN2_TBL
;
--
-- Non-equi-joins
--
SELECT
''
AS
"xxx"
,
*
FROM
JOIN_TBL
JOIN
JOIN2_TBL
ON
(
JOIN_TBL
.
i
<=
JOIN2_TBL
.
k
);
--
-- Outer joins
--
SELECT
''
AS
"xxx"
,
*
FROM
JOIN_TBL
OUTER
JOIN
JOIN2_TBL
USING
(
i
);
SELECT
''
AS
"xxx"
,
*
FROM
JOIN_TBL
LEFT
OUTER
JOIN
JOIN2_TBL
USING
(
i
);
SELECT
''
AS
"xxx"
,
*
FROM
JOIN_TBL
RIGHT
OUTER
JOIN
JOIN2_TBL
USING
(
i
);
SELECT
''
AS
"xxx"
,
*
FROM
JOIN_TBL
FULL
OUTER
JOIN
JOIN2_TBL
USING
(
i
);
--
-- More complicated constructs
--
--
-- Clean up
--
DROP
TABLE
JOIN_TBL
;
DROP
TABLE
JOIN2_TBL
;
This diff is collapsed.
Click to expand it.
src/test/regress/sql/tests
+
1
−
0
View file @
4aa0e645
...
@@ -50,6 +50,7 @@ select_having
...
@@ -50,6 +50,7 @@ select_having
subselect
subselect
union
union
case
case
join
aggregates
aggregates
transactions
transactions
random
random
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment