Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
test_cfs
========
 
Test module for the Compressed File Store (CFS) codec and page-level
compression/decompression API.
 
This extension exposes a single SQL-callable function:
 
  cfs_run_tests(OUT test_name text, OUT result text, OUT detail text)
    RETURNS SETOF record
 
It exercises the CFS codec subsystem and returns one row per test case:
 
  - raw_codec_roundtrip         - RAW pass-through compress/decompress
  - lz4_codec_roundtrip         - LZ4 round-trip (skipped if not compiled in)
  - zstd_codec_roundtrip        - Zstd round-trip (skipped if not compiled in)
  - compress_page_lz4           - CfsCompressPage/CfsDecompressPage with LZ4
  - incompressible_raw_fallback - incompressible data stored as RAW
  - crc_corruption_detection    - header CRC mismatch is detected
  - scratch_and_alignment       - scratch size and alignment macros
 
The "result" column is "ok", "skip" (codec not compiled in) or "fail".
A "skip" is never a failure; the regression test asserts zero failures.
 
Building
--------
 
The module is built as part of the test suite.  When the server is built
with LZ4/Zstd (--with-lz4 / --with-zstd) the corresponding codecs are
exercised; otherwise those cases are skipped gracefully.
 
Running
-------
 
  make installcheck-world      # or, from a configured tree:
 
  CREATE EXTENSION test_cfs;
  SELECT * FROM cfs_run_tests() ORDER BY test_name;