diff options
| author | Tom Lane | 2006-01-26 02:35:51 +0000 |
|---|---|---|
| committer | Tom Lane | 2006-01-26 02:35:51 +0000 |
| commit | 8d8bf127605d0a87b22bb07e630a075506ca5e1e (patch) | |
| tree | 3ad06ce423081f23df826753da0dc7f998e58822 /src/test | |
| parent | 5997386a0a38f3ded28ce6eb2c2b4f110b377e46 (diff) | |
Clean up the INET-vs-CIDR situation. Get rid of the internal is_cidr flag
and rely exclusively on the SQL type system to tell the difference between
the types. Prevent creation of invalid CIDR values via casting from INET
or set_masklen() --- both of these operations now silently zero any bits
to the right of the netmask. Remove duplicate CIDR comparison operators,
letting the type rely on the INET operators instead.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/opr_sanity.out | 5 | ||||
| -rw-r--r-- | src/test/regress/sql/opr_sanity.sql | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out index aad7a10ed0..f367d0a552 100644 --- a/src/test/regress/expected/opr_sanity.out +++ b/src/test/regress/expected/opr_sanity.out @@ -274,6 +274,8 @@ WHERE c.castfunc = p.oid AND -- also binary compatible. This is legal, but usually not intended. -- As of 7.4, this finds the casts from text and varchar to bpchar, because -- those are binary-compatible while the reverse way goes through rtrim(). +-- As of 8.2, this finds the cast from cidr to inet, because that is a +-- trivial binary coercion while the other way goes through inet_to_cidr(). SELECT * FROM pg_cast c WHERE c.castfunc = 0 AND @@ -285,7 +287,8 @@ WHERE c.castfunc = 0 AND ------------+------------+----------+------------- 25 | 1042 | 0 | i 1043 | 1042 | 0 | i -(2 rows) + 650 | 869 | 0 | i +(3 rows) -- **************** pg_operator **************** -- Look for illegal values in pg_operator fields. diff --git a/src/test/regress/sql/opr_sanity.sql b/src/test/regress/sql/opr_sanity.sql index ea5bc5b436..0528e3657c 100644 --- a/src/test/regress/sql/opr_sanity.sql +++ b/src/test/regress/sql/opr_sanity.sql @@ -223,6 +223,9 @@ WHERE c.castfunc = p.oid AND -- As of 7.4, this finds the casts from text and varchar to bpchar, because -- those are binary-compatible while the reverse way goes through rtrim(). +-- As of 8.2, this finds the cast from cidr to inet, because that is a +-- trivial binary coercion while the other way goes through inet_to_cidr(). + SELECT * FROM pg_cast c WHERE c.castfunc = 0 AND |
