Skip to content

Commit 0af0834

Browse files
committed
Add tests for compression methods
Signed-off-by: Ildus Kurbangaliev <i.kurbangaliev@gmail.com>
1 parent 608bae3 commit 0af0834

23 files changed

+1512
-468
lines changed

contrib/test_decoding/expected/ddl.out

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -438,12 +438,12 @@ CREATE TABLE replication_metadata (
438438
WITH (user_catalog_table = true)
439439
;
440440
\d+ replication_metadata
441-
Table "public.replication_metadata"
442-
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
443-
----------+---------+-----------+----------+--------------------------------------------------+----------+--------------+-------------
444-
id | integer | | not null | nextval('replication_metadata_id_seq'::regclass) | plain | |
445-
relation | name | | not null | | plain | |
446-
options | text[] | | | | extended | |
441+
Table "public.replication_metadata"
442+
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
443+
----------+---------+-----------+----------+--------------------------------------------------+----------+-------------+--------------+-------------
444+
id | integer | | not null | nextval('replication_metadata_id_seq'::regclass) | plain | | |
445+
relation | name | | not null | | plain | | |
446+
options | text[] | | | | extended | pglz | |
447447
Indexes:
448448
"replication_metadata_pkey" PRIMARY KEY, btree (id)
449449
Options: user_catalog_table=true
@@ -452,25 +452,25 @@ INSERT INTO replication_metadata(relation, options)
452452
VALUES ('foo', ARRAY['a', 'b']);
453453
ALTER TABLE replication_metadata RESET (user_catalog_table);
454454
\d+ replication_metadata
455-
Table "public.replication_metadata"
456-
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
457-
----------+---------+-----------+----------+--------------------------------------------------+----------+--------------+-------------
458-
id | integer | | not null | nextval('replication_metadata_id_seq'::regclass) | plain | |
459-
relation | name | | not null | | plain | |
460-
options | text[] | | | | extended | |
455+
Table "public.replication_metadata"
456+
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
457+
----------+---------+-----------+----------+--------------------------------------------------+----------+-------------+--------------+-------------
458+
id | integer | | not null | nextval('replication_metadata_id_seq'::regclass) | plain | | |
459+
relation | name | | not null | | plain | | |
460+
options | text[] | | | | extended | pglz | |
461461
Indexes:
462462
"replication_metadata_pkey" PRIMARY KEY, btree (id)
463463

464464
INSERT INTO replication_metadata(relation, options)
465465
VALUES ('bar', ARRAY['a', 'b']);
466466
ALTER TABLE replication_metadata SET (user_catalog_table = true);
467467
\d+ replication_metadata
468-
Table "public.replication_metadata"
469-
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
470-
----------+---------+-----------+----------+--------------------------------------------------+----------+--------------+-------------
471-
id | integer | | not null | nextval('replication_metadata_id_seq'::regclass) | plain | |
472-
relation | name | | not null | | plain | |
473-
options | text[] | | | | extended | |
468+
Table "public.replication_metadata"
469+
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
470+
----------+---------+-----------+----------+--------------------------------------------------+----------+-------------+--------------+-------------
471+
id | integer | | not null | nextval('replication_metadata_id_seq'::regclass) | plain | | |
472+
relation | name | | not null | | plain | | |
473+
options | text[] | | | | extended | pglz | |
474474
Indexes:
475475
"replication_metadata_pkey" PRIMARY KEY, btree (id)
476476
Options: user_catalog_table=true
@@ -483,13 +483,13 @@ ALTER TABLE replication_metadata ALTER COLUMN rewritemeornot TYPE text;
483483
ERROR: cannot rewrite table "replication_metadata" used as a catalog table
484484
ALTER TABLE replication_metadata SET (user_catalog_table = false);
485485
\d+ replication_metadata
486-
Table "public.replication_metadata"
487-
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
488-
----------------+---------+-----------+----------+--------------------------------------------------+----------+--------------+-------------
489-
id | integer | | not null | nextval('replication_metadata_id_seq'::regclass) | plain | |
490-
relation | name | | not null | | plain | |
491-
options | text[] | | | | extended | |
492-
rewritemeornot | integer | | | | plain | |
486+
Table "public.replication_metadata"
487+
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
488+
----------------+---------+-----------+----------+--------------------------------------------------+----------+-------------+--------------+-------------
489+
id | integer | | not null | nextval('replication_metadata_id_seq'::regclass) | plain | | |
490+
relation | name | | not null | | plain | | |
491+
options | text[] | | | | extended | pglz | |
492+
rewritemeornot | integer | | | | plain | | |
493493
Indexes:
494494
"replication_metadata_pkey" PRIMARY KEY, btree (id)
495495
Options: user_catalog_table=false

src/backend/access/compression/cm_zlib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ zlib_cmcompress(CompressionAmOptions *cmoptions, const struct varlena *value)
182182
}
183183

184184
pfree(tmp);
185-
#endif
186185
return NULL;
187186
}
188187

@@ -231,6 +230,7 @@ zlib_cmdecompress(CompressionAmOptions *cmoptions, const struct varlena *value)
231230
pfree(zp);
232231
return result;
233232
}
233+
#endif
234234

235235
Datum
236236
zlibhandler(PG_FUNCTION_ARGS)

src/test/regress/expected/copy2.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@ begin
464464
end $$ language plpgsql immutable;
465465
alter table check_con_tbl add check (check_con_function(check_con_tbl.*));
466466
\d+ check_con_tbl
467-
Table "public.check_con_tbl"
468-
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
469-
--------+---------+-----------+----------+---------+---------+--------------+-------------
470-
f1 | integer | | | | plain | |
467+
Table "public.check_con_tbl"
468+
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
469+
--------+---------+-----------+----------+---------+---------+-------------+--------------+-------------
470+
f1 | integer | | | | plain | | |
471471
Check constraints:
472472
"check_con_tbl_check" CHECK (check_con_function(check_con_tbl.*))
473473

0 commit comments

Comments
 (0)