Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  compression_pglz.sql

  Sprache: SQL
 

--
-- Tests for PGLZ compression
--

-- directory paths and dlsuffix are passed to us in environment variables
\getenv libdir PG_LIBDIR
\getenv dlsuffix PG_DLSUFFIX

\set regresslib :libdir '/regress' :dlsuffix

CREATE FUNCTION test_pglz_compress(bytea)
  RETURNS bytea
  AS :'regresslib' LANGUAGE C STRICT;
CREATE FUNCTION test_pglz_decompress(bytea, int4, bool)
  RETURNS bytea
  AS :'regresslib' LANGUAGE C STRICT;

-- Round-trip with pglz: compress then decompress.
SELECT test_pglz_decompress(test_pglz_compress(
    decode(repeat('abcd'100), 'escape')), 400false) =
    decode(repeat('abcd'100), 'escape'AS roundtrip_ok;
SELECT test_pglz_decompress(test_pglz_compress(
    decode(repeat('abcd'100), 'escape')), 400true) =
    decode(repeat('abcd'100), 'escape'AS roundtrip_ok;

-- Decompression with rawsize too large, fails to fill the destination
-- buffer.
SELECT test_pglz_decompress(test_pglz_compress(
    decode(repeat('abcd'100), 'escape')), 500true);

-- Decompression with rawsize too small, fails with source not fully
-- consumed.
SELECT test_pglz_decompress(test_pglz_compress(
    decode(repeat('abcd'100), 'escape')), 100true);

-- Corrupted compressed data.  Set control bit with read of a match tag,
-- no data follows.
SELECT length(test_pglz_decompress('\x01'::bytea, 1024false)) AS ctrl_only_len;
SELECT test_pglz_decompress('\x01'::bytea, 1024true);

-- Corrupted compressed data.  Set control bit with read of a match tag,
-- 1 byte follows.
SELECT test_pglz_decompress('\x01ff'::bytea, 1024false);
SELECT test_pglz_decompress('\x01ff'::bytea, 1024true);

-- Corrupted compressed data.  Set control bit with match tag where length
-- nibble is 3 bytes (extended length), no data follows.
SELECT test_pglz_decompress('\x010f01'::bytea, 1024false);
SELECT test_pglz_decompress('\x010f01'::bytea, 1024true);

-- Clean up
DROP FUNCTION test_pglz_compress;
DROP FUNCTION test_pglz_decompress;

Messung V0.5 in Prozent
C=90 H=95 G=92

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-08-08) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002