Add regression test for minmax-multi macaddr8 type
authorTomas Vondra <tomas.vondra@postgresql.org>
Sun, 4 Apr 2021 17:26:48 +0000 (19:26 +0200)
committerTomas Vondra <tomas.vondra@postgresql.org>
Sun, 4 Apr 2021 17:26:55 +0000 (19:26 +0200)
The regression test for BRIN minmax-multi opclasses tested almost all
supported data types, with the exception of macaddr8. So this adds it.

src/test/regress/expected/brin_multi.out
src/test/regress/sql/brin_multi.sql

index 0a7e4b80600b8525e60805b771db477d48e7ef3d..d3d693e4649427b270828bfa47ea707a0615f1a0 100644 (file)
@@ -7,6 +7,7 @@ CREATE TABLE brintest_multi (
    float4col real,
    float8col double precision,
    macaddrcol macaddr,
+   macaddr8col macaddr8,
    inetcol inet,
    cidrcol cidr,
    datecol date,
@@ -28,6 +29,7 @@ INSERT INTO brintest_multi SELECT
    (four + 1.0)/(hundred+1),
    odd::float8 / (tenthous + 1),
    format('%s:00:%s:00:%s:00', to_hex(odd), to_hex(even), to_hex(hundred))::macaddr,
+   substr(md5(unique1::text), 1, 16)::macaddr8,
    inet '10.2.3.4/24' + tenthous,
    cidr '10.2.3/24' + tenthous,
    date '1995-08-15' + tenthous,
@@ -69,6 +71,7 @@ CREATE INDEX brinidx_multi ON brintest_multi USING brin (
    float4col float4_minmax_multi_ops,
    float8col float8_minmax_multi_ops,
    macaddrcol macaddr_minmax_multi_ops,
+   macaddr8col macaddr8_minmax_multi_ops,
    inetcol inet_minmax_multi_ops,
    cidrcol inet_minmax_multi_ops,
    datecol date_minmax_multi_ops,
@@ -91,6 +94,7 @@ CREATE INDEX brinidx_multi ON brintest_multi USING brin (
    float4col float4_minmax_multi_ops,
    float8col float8_minmax_multi_ops,
    macaddrcol macaddr_minmax_multi_ops,
+   macaddr8col macaddr8_minmax_multi_ops,
    inetcol inet_minmax_multi_ops,
    cidrcol inet_minmax_multi_ops,
    datecol date_minmax_multi_ops,
@@ -172,6 +176,10 @@ INSERT INTO brinopers_multi VALUES
     '{>, >=, =, <=, <}',
     '{00:00:01:00:00:00, 00:00:01:00:00:00, 2c:00:2d:00:16:00, ff:fe:00:00:00:00, ff:fe:00:00:00:00}',
     '{99, 100, 2, 100, 100}'),
+   ('macaddr8col', 'macaddr8',
+    '{>, >=, =, <=, <}',
+    '{b1:d1:0e:7b:af:a4:42:12, d9:35:91:bd:f7:86:0e:1e, 72:8f:20:6c:2a:01:bf:57, 23:e8:46:63:86:07:ad:cb, 13:16:8e:6a:2e:6c:84:b4}',
+    '{33, 15, 1, 13, 6}'),
    ('inetcol', 'inet',
     '{=, <, <=, >, >=}',
     '{10.2.14.231/24, 255.255.255.255, 255.255.255.255, 0.0.0.0, 0.0.0.0}',
@@ -319,6 +327,7 @@ INSERT INTO brintest_multi SELECT
    (four + 1.0)/(hundred+1),
    odd::float8 / (tenthous + 1),
    format('%s:00:%s:00:%s:00', to_hex(odd), to_hex(even), to_hex(hundred))::macaddr,
+   substr(md5(unique1::text), 1, 16)::macaddr8,
    inet '10.2.3.4' + tenthous,
    cidr '10.2.3/24' + tenthous,
    date '1995-08-15' + tenthous,
index f5ffcaea33e57e0471e68086660d2570a4b0bdac..70b751068b06bf84a41a97448638c7bbcecb96d2 100644 (file)
@@ -7,6 +7,7 @@ CREATE TABLE brintest_multi (
    float4col real,
    float8col double precision,
    macaddrcol macaddr,
+   macaddr8col macaddr8,
    inetcol inet,
    cidrcol cidr,
    datecol date,
@@ -29,6 +30,7 @@ INSERT INTO brintest_multi SELECT
    (four + 1.0)/(hundred+1),
    odd::float8 / (tenthous + 1),
    format('%s:00:%s:00:%s:00', to_hex(odd), to_hex(even), to_hex(hundred))::macaddr,
+   substr(md5(unique1::text), 1, 16)::macaddr8,
    inet '10.2.3.4/24' + tenthous,
    cidr '10.2.3/24' + tenthous,
    date '1995-08-15' + tenthous,
@@ -69,6 +71,7 @@ CREATE INDEX brinidx_multi ON brintest_multi USING brin (
    float4col float4_minmax_multi_ops,
    float8col float8_minmax_multi_ops,
    macaddrcol macaddr_minmax_multi_ops,
+   macaddr8col macaddr8_minmax_multi_ops,
    inetcol inet_minmax_multi_ops,
    cidrcol inet_minmax_multi_ops,
    datecol date_minmax_multi_ops,
@@ -93,6 +96,7 @@ CREATE INDEX brinidx_multi ON brintest_multi USING brin (
    float4col float4_minmax_multi_ops,
    float8col float8_minmax_multi_ops,
    macaddrcol macaddr_minmax_multi_ops,
+   macaddr8col macaddr8_minmax_multi_ops,
    inetcol inet_minmax_multi_ops,
    cidrcol inet_minmax_multi_ops,
    datecol date_minmax_multi_ops,
@@ -176,6 +180,10 @@ INSERT INTO brinopers_multi VALUES
     '{>, >=, =, <=, <}',
     '{00:00:01:00:00:00, 00:00:01:00:00:00, 2c:00:2d:00:16:00, ff:fe:00:00:00:00, ff:fe:00:00:00:00}',
     '{99, 100, 2, 100, 100}'),
+   ('macaddr8col', 'macaddr8',
+    '{>, >=, =, <=, <}',
+    '{b1:d1:0e:7b:af:a4:42:12, d9:35:91:bd:f7:86:0e:1e, 72:8f:20:6c:2a:01:bf:57, 23:e8:46:63:86:07:ad:cb, 13:16:8e:6a:2e:6c:84:b4}',
+    '{33, 15, 1, 13, 6}'),
    ('inetcol', 'inet',
     '{=, <, <=, >, >=}',
     '{10.2.14.231/24, 255.255.255.255, 255.255.255.255, 0.0.0.0, 0.0.0.0}',
@@ -326,6 +334,7 @@ INSERT INTO brintest_multi SELECT
    (four + 1.0)/(hundred+1),
    odd::float8 / (tenthous + 1),
    format('%s:00:%s:00:%s:00', to_hex(odd), to_hex(even), to_hex(hundred))::macaddr,
+   substr(md5(unique1::text), 1, 16)::macaddr8,
    inet '10.2.3.4' + tenthous,
    cidr '10.2.3/24' + tenthous,
    date '1995-08-15' + tenthous,