mirror of
https://github.com/postgres/postgres.git
synced 2025-06-06 00:02:36 -04:00
Temporarily revert "Move pg_lzcompress.c to src/common."
This reverts commit 60838df922345b26a616e49ac9fab808a35d1f85. That change needs a bit more thought to be workable. In view of the potentially machine-dependent stuff that went in today, we need all of the buildfarm to be testing those other changes.
This commit is contained in:
parent
d72731a704
commit
966115c305
@ -37,7 +37,7 @@
|
|||||||
#include "catalog/catalog.h"
|
#include "catalog/catalog.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "utils/fmgroids.h"
|
#include "utils/fmgroids.h"
|
||||||
#include "common/pg_lzcompress.h"
|
#include "utils/pg_lzcompress.h"
|
||||||
#include "utils/rel.h"
|
#include "utils/rel.h"
|
||||||
#include "utils/typcache.h"
|
#include "utils/typcache.h"
|
||||||
#include "utils/tqual.h"
|
#include "utils/tqual.h"
|
||||||
@ -142,8 +142,7 @@ heap_tuple_untoast_attr(struct varlena * attr)
|
|||||||
|
|
||||||
attr = (struct varlena *) palloc(PGLZ_RAW_SIZE(tmp) + VARHDRSZ);
|
attr = (struct varlena *) palloc(PGLZ_RAW_SIZE(tmp) + VARHDRSZ);
|
||||||
SET_VARSIZE(attr, PGLZ_RAW_SIZE(tmp) + VARHDRSZ);
|
SET_VARSIZE(attr, PGLZ_RAW_SIZE(tmp) + VARHDRSZ);
|
||||||
if (!pglz_decompress(tmp, VARDATA(attr)))
|
pglz_decompress(tmp, VARDATA(attr));
|
||||||
elog(ERROR, "compressed data is corrupted");
|
|
||||||
pfree(tmp);
|
pfree(tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -168,8 +167,7 @@ heap_tuple_untoast_attr(struct varlena * attr)
|
|||||||
|
|
||||||
attr = (struct varlena *) palloc(PGLZ_RAW_SIZE(tmp) + VARHDRSZ);
|
attr = (struct varlena *) palloc(PGLZ_RAW_SIZE(tmp) + VARHDRSZ);
|
||||||
SET_VARSIZE(attr, PGLZ_RAW_SIZE(tmp) + VARHDRSZ);
|
SET_VARSIZE(attr, PGLZ_RAW_SIZE(tmp) + VARHDRSZ);
|
||||||
if (!pglz_decompress(tmp, VARDATA(attr)))
|
pglz_decompress(tmp, VARDATA(attr));
|
||||||
elog(ERROR, "compressed data is corrupted");
|
|
||||||
}
|
}
|
||||||
else if (VARATT_IS_SHORT(attr))
|
else if (VARATT_IS_SHORT(attr))
|
||||||
{
|
{
|
||||||
@ -241,8 +239,7 @@ heap_tuple_untoast_attr_slice(struct varlena * attr,
|
|||||||
|
|
||||||
preslice = (struct varlena *) palloc(size);
|
preslice = (struct varlena *) palloc(size);
|
||||||
SET_VARSIZE(preslice, size);
|
SET_VARSIZE(preslice, size);
|
||||||
if (!pglz_decompress(tmp, VARDATA(preslice)))
|
pglz_decompress(tmp, VARDATA(preslice));
|
||||||
elog(ERROR, "compressed data is corrupted");
|
|
||||||
|
|
||||||
if (tmp != (PGLZ_Header *) attr)
|
if (tmp != (PGLZ_Header *) attr)
|
||||||
pfree(tmp);
|
pfree(tmp);
|
||||||
|
@ -25,8 +25,8 @@ OBJS = acl.o arrayfuncs.o array_selfuncs.o array_typanalyze.o \
|
|||||||
jsonfuncs.o like.o lockfuncs.o mac.o misc.o nabstime.o name.o \
|
jsonfuncs.o like.o lockfuncs.o mac.o misc.o nabstime.o name.o \
|
||||||
network.o network_gist.o network_selfuncs.o \
|
network.o network_gist.o network_selfuncs.o \
|
||||||
numeric.o numutils.o oid.o oracle_compat.o \
|
numeric.o numutils.o oid.o oracle_compat.o \
|
||||||
orderedsetaggs.o pg_locale.o pg_lsn.o pgstatfuncs.o \
|
orderedsetaggs.o pg_lzcompress.o pg_locale.o pg_lsn.o \
|
||||||
pseudotypes.o quote.o rangetypes.o rangetypes_gist.o \
|
pgstatfuncs.o pseudotypes.o quote.o rangetypes.o rangetypes_gist.o \
|
||||||
rangetypes_selfuncs.o rangetypes_spgist.o rangetypes_typanalyze.o \
|
rangetypes_selfuncs.o rangetypes_spgist.o rangetypes_typanalyze.o \
|
||||||
regexp.o regproc.o ri_triggers.o rowtypes.o ruleutils.o \
|
regexp.o regproc.o ri_triggers.o rowtypes.o ruleutils.o \
|
||||||
selfuncs.o tid.o timestamp.o trigfuncs.o \
|
selfuncs.o tid.o timestamp.o trigfuncs.o \
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* FALSE if not; in the latter case the contents of dest
|
* FALSE if not; in the latter case the contents of dest
|
||||||
* are undefined.
|
* are undefined.
|
||||||
*
|
*
|
||||||
* bool
|
* void
|
||||||
* pglz_decompress(const PGLZ_Header *source, char *dest)
|
* pglz_decompress(const PGLZ_Header *source, char *dest)
|
||||||
*
|
*
|
||||||
* source is the compressed input.
|
* source is the compressed input.
|
||||||
@ -40,10 +40,6 @@
|
|||||||
* The data is written to buff exactly as it was handed
|
* The data is written to buff exactly as it was handed
|
||||||
* to pglz_compress(). No terminating zero byte is added.
|
* to pglz_compress(). No terminating zero byte is added.
|
||||||
*
|
*
|
||||||
* The return value is TRUE if decompression succeeded,
|
|
||||||
* FALSE if not; in the latter case the contents of dest
|
|
||||||
* are undefined.
|
|
||||||
*
|
|
||||||
* The decompression algorithm and internal data format:
|
* The decompression algorithm and internal data format:
|
||||||
*
|
*
|
||||||
* PGLZ_Header is defined as
|
* PGLZ_Header is defined as
|
||||||
@ -173,14 +169,14 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1999-2014, PostgreSQL Global Development Group
|
* Copyright (c) 1999-2014, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* src/common/pg_lzcompress.c
|
* src/backend/utils/adt/pg_lzcompress.c
|
||||||
* ----------
|
* ----------
|
||||||
*/
|
*/
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include "common/pg_lzcompress.h"
|
#include "utils/pg_lzcompress.h"
|
||||||
|
|
||||||
|
|
||||||
/* ----------
|
/* ----------
|
||||||
@ -496,8 +492,7 @@ pglz_find_match(int16 *hstart, const char *input, const char *end,
|
|||||||
/* ----------
|
/* ----------
|
||||||
* pglz_compress -
|
* pglz_compress -
|
||||||
*
|
*
|
||||||
* Compresses source into dest using strategy. Returns false if a failure
|
* Compresses source into dest using strategy.
|
||||||
* occurred, true in case of success.
|
|
||||||
* ----------
|
* ----------
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
@ -683,11 +678,10 @@ pglz_compress(const char *source, int32 slen, PGLZ_Header *dest,
|
|||||||
/* ----------
|
/* ----------
|
||||||
* pglz_decompress -
|
* pglz_decompress -
|
||||||
*
|
*
|
||||||
* Decompresses source into dest. Returns false if a failure
|
* Decompresses source into dest.
|
||||||
* occurred, true in case of success.
|
|
||||||
* ----------
|
* ----------
|
||||||
*/
|
*/
|
||||||
bool
|
void
|
||||||
pglz_decompress(const PGLZ_Header *source, char *dest)
|
pglz_decompress(const PGLZ_Header *source, char *dest)
|
||||||
{
|
{
|
||||||
const unsigned char *sp;
|
const unsigned char *sp;
|
||||||
@ -777,10 +771,9 @@ pglz_decompress(const PGLZ_Header *source, char *dest)
|
|||||||
* Check we decompressed the right amount.
|
* Check we decompressed the right amount.
|
||||||
*/
|
*/
|
||||||
if (dp != destend || sp != srcend)
|
if (dp != destend || sp != srcend)
|
||||||
return false;
|
elog(ERROR, "compressed data is corrupt");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* That's it.
|
* That's it.
|
||||||
*/
|
*/
|
||||||
return true;
|
|
||||||
}
|
}
|
@ -23,8 +23,7 @@ include $(top_builddir)/src/Makefile.global
|
|||||||
override CPPFLAGS := -DFRONTEND $(CPPFLAGS)
|
override CPPFLAGS := -DFRONTEND $(CPPFLAGS)
|
||||||
LIBS += $(PTHREAD_LIBS)
|
LIBS += $(PTHREAD_LIBS)
|
||||||
|
|
||||||
OBJS_COMMON = exec.o pg_lzcompress.o pgfnames.o psprintf.o relpath.o \
|
OBJS_COMMON = exec.o pgfnames.o psprintf.o relpath.o rmtree.o username.o wait_error.o
|
||||||
rmtree.o username.o wait_error.o
|
|
||||||
|
|
||||||
OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o
|
OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Definitions for the builtin LZ compressor
|
* Definitions for the builtin LZ compressor
|
||||||
*
|
*
|
||||||
* src/include/common/pg_lzcompress.h
|
* src/include/utils/pg_lzcompress.h
|
||||||
* ----------
|
* ----------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -107,6 +107,6 @@ extern const PGLZ_Strategy *const PGLZ_strategy_always;
|
|||||||
*/
|
*/
|
||||||
extern bool pglz_compress(const char *source, int32 slen, PGLZ_Header *dest,
|
extern bool pglz_compress(const char *source, int32 slen, PGLZ_Header *dest,
|
||||||
const PGLZ_Strategy *strategy);
|
const PGLZ_Strategy *strategy);
|
||||||
extern bool pglz_decompress(const PGLZ_Header *source, char *dest);
|
extern void pglz_decompress(const PGLZ_Header *source, char *dest);
|
||||||
|
|
||||||
#endif /* _PG_LZCOMPRESS_H_ */
|
#endif /* _PG_LZCOMPRESS_H_ */
|
@ -76,8 +76,7 @@ sub mkvcbuild
|
|||||||
push(@pgportfiles, 'rint.c') if ($vsVersion < '12.00');
|
push(@pgportfiles, 'rint.c') if ($vsVersion < '12.00');
|
||||||
|
|
||||||
our @pgcommonallfiles = qw(
|
our @pgcommonallfiles = qw(
|
||||||
exec.c pg_lzcompress.c pgfnames.c psprintf.c relpath.c rmtree.c
|
exec.c pgfnames.c psprintf.c relpath.c rmtree.c username.c wait_error.c);
|
||||||
username.c wait_error.c);
|
|
||||||
|
|
||||||
our @pgcommonfrontendfiles = (@pgcommonallfiles, qw(fe_memutils.c));
|
our @pgcommonfrontendfiles = (@pgcommonallfiles, qw(fe_memutils.c));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user