Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
69545373
Commit
69545373
authored
Oct 27, 1998
by
Thomas G. Lockhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new inet/cidr regression test.
All regression tests pass on Linux/i686 with the current source tree.
parent
0ebb2380
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
138 additions
and
1 deletion
+138
-1
src/test/regress/expected/inet.out
src/test/regress/expected/inet.out
+100
-0
src/test/regress/output/misc.source
src/test/regress/output/misc.source
+2
-1
src/test/regress/sql/inet.sql
src/test/regress/sql/inet.sql
+35
-0
src/test/regress/sql/tests
src/test/regress/sql/tests
+1
-0
No files found.
src/test/regress/expected/inet.out
0 → 100644
View file @
69545373
QUERY: DROP TABLE INET_TBL;
ERROR: Relation inet_tbl Does Not Exist!
QUERY: CREATE TABLE INET_TBL (c cidr, i inet);
QUERY: INSERT INTO INET_TBL (c, i) VALUES ('192.168.1', '192.168.1.226/24');
QUERY: INSERT INTO INET_TBL (c, i) VALUES ('192.168.1.2/24', '192.168.1.226');
QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10', '10.1.2.3/8');
QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10.0.0.0', '10.1.2.3/8');
QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10.1.2.3', '10.1.2.3/32');
QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10.1.2', '10.1.2.3/24');
QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10.1', '10.1.2.3/16');
QUERY: INSERT INTO INET_TBL (c, i) VALUES ('10', '10.1.2.3/8');
QUERY: SELECT '' as eight, c as cidr, i as inet FROM INET_TBL;
eight|cidr |inet
-----+------------+----------------
|192.168.1/24|192.168.1.226/24
|192.168.1/24|192.168.1.226
|10/8 |10.1.2.3/8
|10.0.0.0/32 |10.1.2.3/8
|10.1.2.3/32 |10.1.2.3
|10.1.2/24 |10.1.2.3/24
|10.1/16 |10.1.2.3/16
|10/8 |10.1.2.3/8
(8 rows)
QUERY: SELECT '' as eight, i as inet, host(i) FROM INET_TBL;
eight|inet | host
-----+----------------+-------------
|192.168.1.226/24|192.168.1.226
|192.168.1.226 |192.168.1.226
|10.1.2.3/8 | 10.1.2.3
|10.1.2.3/8 | 10.1.2.3
|10.1.2.3 | 10.1.2.3
|10.1.2.3/24 | 10.1.2.3
|10.1.2.3/16 | 10.1.2.3
|10.1.2.3/8 | 10.1.2.3
(8 rows)
QUERY: SELECT '' as eight, c as cidr, broadcast(c),
i as inet, broadcast(i) FROM INET_TBL;
eight|cidr | broadcast|inet | broadcast
-----+------------+---------------+----------------+---------------
|192.168.1/24| 192.168.1.255|192.168.1.226/24| 192.168.1.255
|192.168.1/24| 192.168.1.255|192.168.1.226 |255.255.255.255
|10/8 | 10.255.255.255|10.1.2.3/8 | 10.255.255.255
|10.0.0.0/32 |255.255.255.255|10.1.2.3/8 | 10.255.255.255
|10.1.2.3/32 |255.255.255.255|10.1.2.3 |255.255.255.255
|10.1.2/24 | 10.1.2.255|10.1.2.3/24 | 10.1.2.255
|10.1/16 | 10.1.255.255|10.1.2.3/16 | 10.1.255.255
|10/8 | 10.255.255.255|10.1.2.3/8 | 10.255.255.255
(8 rows)
QUERY: SELECT '' as eight, c as cidr, network(c) as "network(cidr)",
i as inet, network(i) as "network(inet)" FROM INET_TBL;
eight|cidr |network(cidr)|inet |network(inet)
-----+------------+-------------+----------------+-------------
|192.168.1/24| 0.1.168.192|192.168.1.226/24| 0.1.168.192
|192.168.1/24| 0.1.168.192|192.168.1.226 |226.1.168.192
|10/8 | 0.0.0.10|10.1.2.3/8 | 0.0.0.10
|10.0.0.0/32 | 0.0.0.10|10.1.2.3/8 | 0.0.0.10
|10.1.2.3/32 | 3.2.1.10|10.1.2.3 | 3.2.1.10
|10.1.2/24 | 0.2.1.10|10.1.2.3/24 | 0.2.1.10
|10.1/16 | 0.0.1.10|10.1.2.3/16 | 0.0.1.10
|10/8 | 0.0.0.10|10.1.2.3/8 | 0.0.0.10
(8 rows)
QUERY: SELECT '' as eight, c as cidr, masklen(c) as "masklen(cidr)",
i as inet, masklen(i) as "masklen(inet)" FROM INET_TBL;
eight|cidr |masklen(cidr)|inet |masklen(inet)
-----+------------+-------------+----------------+-------------
|192.168.1/24| 24|192.168.1.226/24| 24
|192.168.1/24| 24|192.168.1.226 | 32
|10/8 | 8|10.1.2.3/8 | 8
|10.0.0.0/32 | 32|10.1.2.3/8 | 8
|10.1.2.3/32 | 32|10.1.2.3 | 32
|10.1.2/24 | 24|10.1.2.3/24 | 24
|10.1/16 | 16|10.1.2.3/16 | 16
|10/8 | 8|10.1.2.3/8 | 8
(8 rows)
QUERY: SELECT '' as two, c as cidr, masklen(c) as "masklen(cidr)",
i as inet, masklen(i) as "masklen(inet)" FROM INET_TBL
WHERE masklen(c) <= 8;
two|cidr|masklen(cidr)|inet |masklen(inet)
---+----+-------------+----------+-------------
|10/8| 8|10.1.2.3/8| 8
|10/8| 8|10.1.2.3/8| 8
(2 rows)
QUERY: SELECT '' as six, c as cidr, i as inet FROM INET_TBL
WHERE c = i;
six|cidr |inet
---+------------+----------------
|192.168.1/24|192.168.1.226/24
|10/8 |10.1.2.3/8
|10.1.2.3/32 |10.1.2.3
|10.1.2/24 |10.1.2.3/24
|10.1/16 |10.1.2.3/16
|10/8 |10.1.2.3/8
(6 rows)
src/test/regress/output/misc.source
View file @
69545373
...
...
@@ -481,6 +481,7 @@ hash_txt_heap
hobbies_r
iexit
ihighway
inet_tbl
insert_seq
insert_tbl
int2_tbl
...
...
@@ -513,5 +514,5 @@ tinterval_tbl
toyemp
varchar_tbl
xacttest
(7
1
rows)
(7
2
rows)
src/test/regress/sql/inet.sql
0 → 100644
View file @
69545373
-- INET regression tests
--
-- prepare the table...
DROP
TABLE
INET_TBL
;
CREATE
TABLE
INET_TBL
(
c
cidr
,
i
inet
);
INSERT
INTO
INET_TBL
(
c
,
i
)
VALUES
(
'192.168.1'
,
'192.168.1.226/24'
);
INSERT
INTO
INET_TBL
(
c
,
i
)
VALUES
(
'192.168.1.2/24'
,
'192.168.1.226'
);
INSERT
INTO
INET_TBL
(
c
,
i
)
VALUES
(
'10'
,
'10.1.2.3/8'
);
INSERT
INTO
INET_TBL
(
c
,
i
)
VALUES
(
'10.0.0.0'
,
'10.1.2.3/8'
);
INSERT
INTO
INET_TBL
(
c
,
i
)
VALUES
(
'10.1.2.3'
,
'10.1.2.3/32'
);
INSERT
INTO
INET_TBL
(
c
,
i
)
VALUES
(
'10.1.2'
,
'10.1.2.3/24'
);
INSERT
INTO
INET_TBL
(
c
,
i
)
VALUES
(
'10.1'
,
'10.1.2.3/16'
);
INSERT
INTO
INET_TBL
(
c
,
i
)
VALUES
(
'10'
,
'10.1.2.3/8'
);
SELECT
''
as
eight
,
c
as
cidr
,
i
as
inet
FROM
INET_TBL
;
-- now test some support functions
SELECT
''
as
eight
,
i
as
inet
,
host
(
i
)
FROM
INET_TBL
;
SELECT
''
as
eight
,
c
as
cidr
,
broadcast
(
c
),
i
as
inet
,
broadcast
(
i
)
FROM
INET_TBL
;
SELECT
''
as
eight
,
c
as
cidr
,
network
(
c
)
as
"network(cidr)"
,
i
as
inet
,
network
(
i
)
as
"network(inet)"
FROM
INET_TBL
;
SELECT
''
as
eight
,
c
as
cidr
,
masklen
(
c
)
as
"masklen(cidr)"
,
i
as
inet
,
masklen
(
i
)
as
"masklen(inet)"
FROM
INET_TBL
;
SELECT
''
as
two
,
c
as
cidr
,
masklen
(
c
)
as
"masklen(cidr)"
,
i
as
inet
,
masklen
(
i
)
as
"masklen(inet)"
FROM
INET_TBL
WHERE
masklen
(
c
)
<=
8
;
SELECT
''
as
six
,
c
as
cidr
,
i
as
inet
FROM
INET_TBL
WHERE
c
=
i
;
src/test/regress/sql/tests
View file @
69545373
...
...
@@ -24,6 +24,7 @@ reltime
abstime
tinterval
horology
inet
comments
create_function_1
create_type
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment