mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-30 15:11:16 +02:00
Remove configure --disable-float4-byval
This build option was only useful to maintain compatibility for version-0 functions, but those are no longer supported, so this option can be removed. float4 is now always pass-by-value; the pass-by-reference code path is completely removed. Discussion: https://www.postgresql.org/message-id/flat/f3e1e576-2749-bbd7-2d57-3f9dcf75255a@2ndquadrant.com
This commit is contained in:
parent
43a54a3bcc
commit
2e4db241bf
42
configure
vendored
42
configure
vendored
@ -866,7 +866,6 @@ with_system_tzdata
|
|||||||
with_zlib
|
with_zlib
|
||||||
with_gnu_ld
|
with_gnu_ld
|
||||||
enable_largefile
|
enable_largefile
|
||||||
enable_float4_byval
|
|
||||||
enable_float8_byval
|
enable_float8_byval
|
||||||
'
|
'
|
||||||
ac_precious_vars='build_alias
|
ac_precious_vars='build_alias
|
||||||
@ -1525,7 +1524,6 @@ Optional Features:
|
|||||||
--enable-cassert enable assertion checks (for debugging)
|
--enable-cassert enable assertion checks (for debugging)
|
||||||
--disable-thread-safety disable thread-safety in client libraries
|
--disable-thread-safety disable thread-safety in client libraries
|
||||||
--disable-largefile omit support for large files
|
--disable-largefile omit support for large files
|
||||||
--disable-float4-byval disable float4 passed by value
|
|
||||||
--disable-float8-byval disable float8 passed by value
|
--disable-float8-byval disable float8 passed by value
|
||||||
|
|
||||||
Optional Packages:
|
Optional Packages:
|
||||||
@ -16747,46 +16745,6 @@ _ACEOF
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Decide whether float4 is passed by value: user-selectable, enabled by default
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float4 passed by value" >&5
|
|
||||||
$as_echo_n "checking whether to build with float4 passed by value... " >&6; }
|
|
||||||
|
|
||||||
|
|
||||||
# Check whether --enable-float4-byval was given.
|
|
||||||
if test "${enable_float4_byval+set}" = set; then :
|
|
||||||
enableval=$enable_float4_byval;
|
|
||||||
case $enableval in
|
|
||||||
yes)
|
|
||||||
|
|
||||||
$as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
|
|
||||||
|
|
||||||
float4passbyval=true
|
|
||||||
;;
|
|
||||||
no)
|
|
||||||
float4passbyval=false
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
as_fn_error $? "no argument expected for --enable-float4-byval option" "$LINENO" 5
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
else
|
|
||||||
enable_float4_byval=yes
|
|
||||||
|
|
||||||
$as_echo "#define USE_FLOAT4_BYVAL 1" >>confdefs.h
|
|
||||||
|
|
||||||
float4passbyval=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float4_byval" >&5
|
|
||||||
$as_echo "$enable_float4_byval" >&6; }
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
|
||||||
#define FLOAT4PASSBYVAL $float4passbyval
|
|
||||||
_ACEOF
|
|
||||||
|
|
||||||
|
|
||||||
# Decide whether float8 is passed by value.
|
# Decide whether float8 is passed by value.
|
||||||
# Note: this setting also controls int8 and related types such as timestamp.
|
# Note: this setting also controls int8 and related types such as timestamp.
|
||||||
# If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
|
# If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
|
||||||
|
10
configure.in
10
configure.in
@ -1941,16 +1941,6 @@ AC_CHECK_SIZEOF([void *])
|
|||||||
AC_CHECK_SIZEOF([size_t])
|
AC_CHECK_SIZEOF([size_t])
|
||||||
AC_CHECK_SIZEOF([long])
|
AC_CHECK_SIZEOF([long])
|
||||||
|
|
||||||
# Decide whether float4 is passed by value: user-selectable, enabled by default
|
|
||||||
AC_MSG_CHECKING([whether to build with float4 passed by value])
|
|
||||||
PGAC_ARG_BOOL(enable, float4-byval, yes, [disable float4 passed by value],
|
|
||||||
[AC_DEFINE([USE_FLOAT4_BYVAL], 1,
|
|
||||||
[Define to 1 if you want float4 values to be passed by value. (--enable-float4-byval)])
|
|
||||||
float4passbyval=true],
|
|
||||||
[float4passbyval=false])
|
|
||||||
AC_MSG_RESULT([$enable_float4_byval])
|
|
||||||
AC_DEFINE_UNQUOTED([FLOAT4PASSBYVAL], [$float4passbyval], [float4 values are passed by value if 'true', by reference if 'false'])
|
|
||||||
|
|
||||||
# Decide whether float8 is passed by value.
|
# Decide whether float8 is passed by value.
|
||||||
# Note: this setting also controls int8 and related types such as timestamp.
|
# Note: this setting also controls int8 and related types such as timestamp.
|
||||||
# If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
|
# If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
|
||||||
|
@ -19964,11 +19964,6 @@ SELECT collation for ('foo' COLLATE "de_DE");
|
|||||||
<entry><type>integer</type></entry>
|
<entry><type>integer</type></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
|
||||||
<entry><literal>float4_pass_by_value</literal></entry>
|
|
||||||
<entry><type>boolean</type></entry>
|
|
||||||
</row>
|
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>float8_pass_by_value</literal></entry>
|
<entry><literal>float8_pass_by_value</literal></entry>
|
||||||
<entry><type>boolean</type></entry>
|
<entry><type>boolean</type></entry>
|
||||||
|
@ -1204,18 +1204,6 @@ build-postgresql:
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>--disable-float4-byval</option></term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Disable passing float4 values <quote>by value</quote>, causing them
|
|
||||||
to be passed <quote>by reference</quote> instead. This option costs
|
|
||||||
performance, but may be needed for compatibility with very old
|
|
||||||
user-defined functions written in C.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>--disable-float8-byval</option></term>
|
<term><option>--disable-float8-byval</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@ -879,11 +879,6 @@ index_store_float8_orderby_distances(IndexScanDesc scan, Oid *orderByTypes,
|
|||||||
else if (orderByTypes[i] == FLOAT4OID)
|
else if (orderByTypes[i] == FLOAT4OID)
|
||||||
{
|
{
|
||||||
/* convert distance function's result to ORDER BY type */
|
/* convert distance function's result to ORDER BY type */
|
||||||
#ifndef USE_FLOAT4_BYVAL
|
|
||||||
/* must free any old value to avoid memory leakage */
|
|
||||||
if (!scan->xs_orderbynulls[i])
|
|
||||||
pfree(DatumGetPointer(scan->xs_orderbyvals[i]));
|
|
||||||
#endif
|
|
||||||
if (distances && !distances[i].isnull)
|
if (distances && !distances[i].isnull)
|
||||||
{
|
{
|
||||||
scan->xs_orderbyvals[i] = Float4GetDatum((float4) distances[i].value);
|
scan->xs_orderbyvals[i] = Float4GetDatum((float4) distances[i].value);
|
||||||
|
@ -4516,7 +4516,6 @@ WriteControlFile(void)
|
|||||||
ControlFile->toast_max_chunk_size = TOAST_MAX_CHUNK_SIZE;
|
ControlFile->toast_max_chunk_size = TOAST_MAX_CHUNK_SIZE;
|
||||||
ControlFile->loblksize = LOBLKSIZE;
|
ControlFile->loblksize = LOBLKSIZE;
|
||||||
|
|
||||||
ControlFile->float4ByVal = FLOAT4PASSBYVAL;
|
|
||||||
ControlFile->float8ByVal = FLOAT8PASSBYVAL;
|
ControlFile->float8ByVal = FLOAT8PASSBYVAL;
|
||||||
|
|
||||||
/* Contents are protected with a CRC */
|
/* Contents are protected with a CRC */
|
||||||
@ -4720,22 +4719,6 @@ ReadControlFile(void)
|
|||||||
ControlFile->loblksize, (int) LOBLKSIZE),
|
ControlFile->loblksize, (int) LOBLKSIZE),
|
||||||
errhint("It looks like you need to recompile or initdb.")));
|
errhint("It looks like you need to recompile or initdb.")));
|
||||||
|
|
||||||
#ifdef USE_FLOAT4_BYVAL
|
|
||||||
if (ControlFile->float4ByVal != true)
|
|
||||||
ereport(FATAL,
|
|
||||||
(errmsg("database files are incompatible with server"),
|
|
||||||
errdetail("The database cluster was initialized without USE_FLOAT4_BYVAL"
|
|
||||||
" but the server was compiled with USE_FLOAT4_BYVAL."),
|
|
||||||
errhint("It looks like you need to recompile or initdb.")));
|
|
||||||
#else
|
|
||||||
if (ControlFile->float4ByVal != false)
|
|
||||||
ereport(FATAL,
|
|
||||||
(errmsg("database files are incompatible with server"),
|
|
||||||
errdetail("The database cluster was initialized with USE_FLOAT4_BYVAL"
|
|
||||||
" but the server was compiled without USE_FLOAT4_BYVAL."),
|
|
||||||
errhint("It looks like you need to recompile or initdb.")));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_FLOAT8_BYVAL
|
#ifdef USE_FLOAT8_BYVAL
|
||||||
if (ControlFile->float8ByVal != true)
|
if (ControlFile->float8ByVal != true)
|
||||||
ereport(FATAL,
|
ereport(FATAL,
|
||||||
|
@ -111,7 +111,7 @@ static const struct typinfo TypInfo[] = {
|
|||||||
F_INT2IN, F_INT2OUT},
|
F_INT2IN, F_INT2OUT},
|
||||||
{"int4", INT4OID, 0, 4, true, 'i', 'p', InvalidOid,
|
{"int4", INT4OID, 0, 4, true, 'i', 'p', InvalidOid,
|
||||||
F_INT4IN, F_INT4OUT},
|
F_INT4IN, F_INT4OUT},
|
||||||
{"float4", FLOAT4OID, 0, 4, FLOAT4PASSBYVAL, 'i', 'p', InvalidOid,
|
{"float4", FLOAT4OID, 0, 4, true, 'i', 'p', InvalidOid,
|
||||||
F_FLOAT4IN, F_FLOAT4OUT},
|
F_FLOAT4IN, F_FLOAT4OUT},
|
||||||
{"name", NAMEOID, CHAROID, NAMEDATALEN, false, 'c', 'p', C_COLLATION_OID,
|
{"name", NAMEOID, CHAROID, NAMEDATALEN, false, 'c', 'p', C_COLLATION_OID,
|
||||||
F_NAMEIN, F_NAMEOUT},
|
F_NAMEIN, F_NAMEOUT},
|
||||||
|
@ -890,7 +890,7 @@ sub morph_row_for_schemapg
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Expand booleans from 'f'/'t' to 'false'/'true'.
|
# Expand booleans from 'f'/'t' to 'false'/'true'.
|
||||||
# Some values might be other macros (eg FLOAT4PASSBYVAL),
|
# Some values might be other macros (eg FLOAT8PASSBYVAL),
|
||||||
# don't change.
|
# don't change.
|
||||||
elsif ($atttype eq 'bool')
|
elsif ($atttype eq 'bool')
|
||||||
{
|
{
|
||||||
|
@ -1496,7 +1496,7 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats)
|
|||||||
/* XXX knows more than it should about type float4: */
|
/* XXX knows more than it should about type float4: */
|
||||||
arry = construct_array(numdatums, nnum,
|
arry = construct_array(numdatums, nnum,
|
||||||
FLOAT4OID,
|
FLOAT4OID,
|
||||||
sizeof(float4), FLOAT4PASSBYVAL, 'i');
|
sizeof(float4), true, 'i');
|
||||||
values[i++] = PointerGetDatum(arry); /* stanumbersN */
|
values[i++] = PointerGetDatum(arry); /* stanumbersN */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -365,15 +365,6 @@ incompatible_module_error(const char *libname,
|
|||||||
magic_data.namedatalen,
|
magic_data.namedatalen,
|
||||||
module_magic_data->namedatalen);
|
module_magic_data->namedatalen);
|
||||||
}
|
}
|
||||||
if (module_magic_data->float4byval != magic_data.float4byval)
|
|
||||||
{
|
|
||||||
if (details.len)
|
|
||||||
appendStringInfoChar(&details, '\n');
|
|
||||||
appendStringInfo(&details,
|
|
||||||
_("Server has FLOAT4PASSBYVAL = %s, library has %s."),
|
|
||||||
magic_data.float4byval ? "true" : "false",
|
|
||||||
module_magic_data->float4byval ? "true" : "false");
|
|
||||||
}
|
|
||||||
if (module_magic_data->float8byval != magic_data.float8byval)
|
if (module_magic_data->float8byval != magic_data.float8byval)
|
||||||
{
|
{
|
||||||
if (details.len)
|
if (details.len)
|
||||||
|
@ -1683,7 +1683,7 @@ OidSendFunctionCall(Oid functionId, Datum val)
|
|||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
* Support routines for standard maybe-pass-by-reference datatypes
|
* Support routines for standard maybe-pass-by-reference datatypes
|
||||||
*
|
*
|
||||||
* int8, float4, and float8 can be passed by value if Datum is wide enough.
|
* int8 and float8 can be passed by value if Datum is wide enough.
|
||||||
* (For backwards-compatibility reasons, we allow pass-by-ref to be chosen
|
* (For backwards-compatibility reasons, we allow pass-by-ref to be chosen
|
||||||
* at compile time even if pass-by-val is possible.)
|
* at compile time even if pass-by-val is possible.)
|
||||||
*
|
*
|
||||||
@ -1703,21 +1703,6 @@ Int64GetDatum(int64 X)
|
|||||||
*retval = X;
|
*retval = X;
|
||||||
return PointerGetDatum(retval);
|
return PointerGetDatum(retval);
|
||||||
}
|
}
|
||||||
#endif /* USE_FLOAT8_BYVAL */
|
|
||||||
|
|
||||||
#ifndef USE_FLOAT4_BYVAL
|
|
||||||
|
|
||||||
Datum
|
|
||||||
Float4GetDatum(float4 X)
|
|
||||||
{
|
|
||||||
float4 *retval = (float4 *) palloc(sizeof(float4));
|
|
||||||
|
|
||||||
*retval = X;
|
|
||||||
return PointerGetDatum(retval);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef USE_FLOAT8_BYVAL
|
|
||||||
|
|
||||||
Datum
|
Datum
|
||||||
Float8GetDatum(float8 X)
|
Float8GetDatum(float8 X)
|
||||||
@ -1727,7 +1712,7 @@ Float8GetDatum(float8 X)
|
|||||||
*retval = X;
|
*retval = X;
|
||||||
return PointerGetDatum(retval);
|
return PointerGetDatum(retval);
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* USE_FLOAT8_BYVAL */
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
|
@ -264,8 +264,8 @@ pg_control_recovery(PG_FUNCTION_ARGS)
|
|||||||
Datum
|
Datum
|
||||||
pg_control_init(PG_FUNCTION_ARGS)
|
pg_control_init(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
Datum values[12];
|
Datum values[11];
|
||||||
bool nulls[12];
|
bool nulls[11];
|
||||||
TupleDesc tupdesc;
|
TupleDesc tupdesc;
|
||||||
HeapTuple htup;
|
HeapTuple htup;
|
||||||
ControlFileData *ControlFile;
|
ControlFileData *ControlFile;
|
||||||
@ -294,11 +294,9 @@ pg_control_init(PG_FUNCTION_ARGS)
|
|||||||
INT4OID, -1, 0);
|
INT4OID, -1, 0);
|
||||||
TupleDescInitEntry(tupdesc, (AttrNumber) 9, "large_object_chunk_size",
|
TupleDescInitEntry(tupdesc, (AttrNumber) 9, "large_object_chunk_size",
|
||||||
INT4OID, -1, 0);
|
INT4OID, -1, 0);
|
||||||
TupleDescInitEntry(tupdesc, (AttrNumber) 10, "float4_pass_by_value",
|
TupleDescInitEntry(tupdesc, (AttrNumber) 10, "float8_pass_by_value",
|
||||||
BOOLOID, -1, 0);
|
BOOLOID, -1, 0);
|
||||||
TupleDescInitEntry(tupdesc, (AttrNumber) 11, "float8_pass_by_value",
|
TupleDescInitEntry(tupdesc, (AttrNumber) 11, "data_page_checksum_version",
|
||||||
BOOLOID, -1, 0);
|
|
||||||
TupleDescInitEntry(tupdesc, (AttrNumber) 12, "data_page_checksum_version",
|
|
||||||
INT4OID, -1, 0);
|
INT4OID, -1, 0);
|
||||||
tupdesc = BlessTupleDesc(tupdesc);
|
tupdesc = BlessTupleDesc(tupdesc);
|
||||||
|
|
||||||
@ -335,15 +333,12 @@ pg_control_init(PG_FUNCTION_ARGS)
|
|||||||
values[8] = Int32GetDatum(ControlFile->loblksize);
|
values[8] = Int32GetDatum(ControlFile->loblksize);
|
||||||
nulls[8] = false;
|
nulls[8] = false;
|
||||||
|
|
||||||
values[9] = BoolGetDatum(ControlFile->float4ByVal);
|
values[9] = BoolGetDatum(ControlFile->float8ByVal);
|
||||||
nulls[9] = false;
|
nulls[9] = false;
|
||||||
|
|
||||||
values[10] = BoolGetDatum(ControlFile->float8ByVal);
|
values[10] = Int32GetDatum(ControlFile->data_checksum_version);
|
||||||
nulls[10] = false;
|
nulls[10] = false;
|
||||||
|
|
||||||
values[11] = Int32GetDatum(ControlFile->data_checksum_version);
|
|
||||||
nulls[11] = false;
|
|
||||||
|
|
||||||
htup = heap_form_tuple(tupdesc, values, nulls);
|
htup = heap_form_tuple(tupdesc, values, nulls);
|
||||||
|
|
||||||
PG_RETURN_DATUM(HeapTupleGetDatum(htup));
|
PG_RETURN_DATUM(HeapTupleGetDatum(htup));
|
||||||
|
@ -1399,9 +1399,6 @@ bootstrap_template1(void)
|
|||||||
bki_lines = replace_token(bki_lines, "ALIGNOF_POINTER",
|
bki_lines = replace_token(bki_lines, "ALIGNOF_POINTER",
|
||||||
(sizeof(Pointer) == 4) ? "i" : "d");
|
(sizeof(Pointer) == 4) ? "i" : "d");
|
||||||
|
|
||||||
bki_lines = replace_token(bki_lines, "FLOAT4PASSBYVAL",
|
|
||||||
FLOAT4PASSBYVAL ? "true" : "false");
|
|
||||||
|
|
||||||
bki_lines = replace_token(bki_lines, "FLOAT8PASSBYVAL",
|
bki_lines = replace_token(bki_lines, "FLOAT8PASSBYVAL",
|
||||||
FLOAT8PASSBYVAL ? "true" : "false");
|
FLOAT8PASSBYVAL ? "true" : "false");
|
||||||
|
|
||||||
|
@ -327,8 +327,6 @@ main(int argc, char *argv[])
|
|||||||
/* This is no longer configurable, but users may still expect to see it: */
|
/* This is no longer configurable, but users may still expect to see it: */
|
||||||
printf(_("Date/time type storage: %s\n"),
|
printf(_("Date/time type storage: %s\n"),
|
||||||
_("64-bit integers"));
|
_("64-bit integers"));
|
||||||
printf(_("Float4 argument passing: %s\n"),
|
|
||||||
(ControlFile->float4ByVal ? _("by value") : _("by reference")));
|
|
||||||
printf(_("Float8 argument passing: %s\n"),
|
printf(_("Float8 argument passing: %s\n"),
|
||||||
(ControlFile->float8ByVal ? _("by value") : _("by reference")));
|
(ControlFile->float8ByVal ? _("by value") : _("by reference")));
|
||||||
printf(_("Data page checksum version: %u\n"),
|
printf(_("Data page checksum version: %u\n"),
|
||||||
|
@ -722,7 +722,6 @@ GuessControlValues(void)
|
|||||||
ControlFile.indexMaxKeys = INDEX_MAX_KEYS;
|
ControlFile.indexMaxKeys = INDEX_MAX_KEYS;
|
||||||
ControlFile.toast_max_chunk_size = TOAST_MAX_CHUNK_SIZE;
|
ControlFile.toast_max_chunk_size = TOAST_MAX_CHUNK_SIZE;
|
||||||
ControlFile.loblksize = LOBLKSIZE;
|
ControlFile.loblksize = LOBLKSIZE;
|
||||||
ControlFile.float4ByVal = FLOAT4PASSBYVAL;
|
|
||||||
ControlFile.float8ByVal = FLOAT8PASSBYVAL;
|
ControlFile.float8ByVal = FLOAT8PASSBYVAL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -801,8 +800,6 @@ PrintControlValues(bool guessed)
|
|||||||
/* This is no longer configurable, but users may still expect to see it: */
|
/* This is no longer configurable, but users may still expect to see it: */
|
||||||
printf(_("Date/time type storage: %s\n"),
|
printf(_("Date/time type storage: %s\n"),
|
||||||
_("64-bit integers"));
|
_("64-bit integers"));
|
||||||
printf(_("Float4 argument passing: %s\n"),
|
|
||||||
(ControlFile.float4ByVal ? _("by value") : _("by reference")));
|
|
||||||
printf(_("Float8 argument passing: %s\n"),
|
printf(_("Float8 argument passing: %s\n"),
|
||||||
(ControlFile.float8ByVal ? _("by value") : _("by reference")));
|
(ControlFile.float8ByVal ? _("by value") : _("by reference")));
|
||||||
printf(_("Data page checksum version: %u\n"),
|
printf(_("Data page checksum version: %u\n"),
|
||||||
|
@ -53,6 +53,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* yyyymmddN */
|
/* yyyymmddN */
|
||||||
#define CATALOG_VERSION_NO 201911211
|
#define CATALOG_VERSION_NO 201911212
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Version identifier for this pg_control format */
|
/* Version identifier for this pg_control format */
|
||||||
#define PG_CONTROL_VERSION 1201
|
#define PG_CONTROL_VERSION 1300
|
||||||
|
|
||||||
/* Nonce key length, see below */
|
/* Nonce key length, see below */
|
||||||
#define MOCK_AUTH_NONCE_LEN 32
|
#define MOCK_AUTH_NONCE_LEN 32
|
||||||
@ -214,8 +214,6 @@ typedef struct ControlFileData
|
|||||||
uint32 toast_max_chunk_size; /* chunk size in TOAST tables */
|
uint32 toast_max_chunk_size; /* chunk size in TOAST tables */
|
||||||
uint32 loblksize; /* chunk size in pg_largeobject */
|
uint32 loblksize; /* chunk size in pg_largeobject */
|
||||||
|
|
||||||
/* flags indicating pass-by-value status of various types */
|
|
||||||
bool float4ByVal; /* float4 pass-by-value? */
|
|
||||||
bool float8ByVal; /* float8, int8, etc pass-by-value? */
|
bool float8ByVal; /* float8, int8, etc pass-by-value? */
|
||||||
|
|
||||||
/* Are data pages protected by checksums? Zero if no checksum version */
|
/* Are data pages protected by checksums? Zero if no checksum version */
|
||||||
|
@ -10660,9 +10660,9 @@
|
|||||||
descr => 'pg_controldata init state information as a function',
|
descr => 'pg_controldata init state information as a function',
|
||||||
proname => 'pg_control_init', provolatile => 'v', prorettype => 'record',
|
proname => 'pg_control_init', provolatile => 'v', prorettype => 'record',
|
||||||
proargtypes => '',
|
proargtypes => '',
|
||||||
proallargtypes => '{int4,int4,int4,int4,int4,int4,int4,int4,int4,bool,bool,int4}',
|
proallargtypes => '{int4,int4,int4,int4,int4,int4,int4,int4,int4,bool,int4}',
|
||||||
proargmodes => '{o,o,o,o,o,o,o,o,o,o,o,o}',
|
proargmodes => '{o,o,o,o,o,o,o,o,o,o,o}',
|
||||||
proargnames => '{max_data_alignment,database_block_size,blocks_per_segment,wal_block_size,bytes_per_wal_segment,max_identifier_length,max_index_columns,max_toast_chunk_size,large_object_chunk_size,float4_pass_by_value,float8_pass_by_value,data_page_checksum_version}',
|
proargnames => '{max_data_alignment,database_block_size,blocks_per_segment,wal_block_size,bytes_per_wal_segment,max_identifier_length,max_index_columns,max_toast_chunk_size,large_object_chunk_size,float8_pass_by_value,data_page_checksum_version}',
|
||||||
prosrc => 'pg_control_init' },
|
prosrc => 'pg_control_init' },
|
||||||
|
|
||||||
# collation management functions
|
# collation management functions
|
||||||
|
@ -215,7 +215,7 @@
|
|||||||
|
|
||||||
{ oid => '700', array_type_oid => '1021',
|
{ oid => '700', array_type_oid => '1021',
|
||||||
descr => 'single-precision floating point number, 4-byte storage',
|
descr => 'single-precision floating point number, 4-byte storage',
|
||||||
typname => 'float4', typlen => '4', typbyval => 'FLOAT4PASSBYVAL',
|
typname => 'float4', typlen => '4', typbyval => 't',
|
||||||
typcategory => 'N', typinput => 'float4in', typoutput => 'float4out',
|
typcategory => 'N', typinput => 'float4in', typoutput => 'float4out',
|
||||||
typreceive => 'float4recv', typsend => 'float4send', typalign => 'i' },
|
typreceive => 'float4recv', typsend => 'float4send', typalign => 'i' },
|
||||||
{ oid => '701', array_type_oid => '1022',
|
{ oid => '701', array_type_oid => '1022',
|
||||||
|
@ -446,7 +446,6 @@ typedef struct
|
|||||||
int funcmaxargs; /* FUNC_MAX_ARGS */
|
int funcmaxargs; /* FUNC_MAX_ARGS */
|
||||||
int indexmaxkeys; /* INDEX_MAX_KEYS */
|
int indexmaxkeys; /* INDEX_MAX_KEYS */
|
||||||
int namedatalen; /* NAMEDATALEN */
|
int namedatalen; /* NAMEDATALEN */
|
||||||
int float4byval; /* FLOAT4PASSBYVAL */
|
|
||||||
int float8byval; /* FLOAT8PASSBYVAL */
|
int float8byval; /* FLOAT8PASSBYVAL */
|
||||||
} Pg_magic_struct;
|
} Pg_magic_struct;
|
||||||
|
|
||||||
@ -458,7 +457,6 @@ typedef struct
|
|||||||
FUNC_MAX_ARGS, \
|
FUNC_MAX_ARGS, \
|
||||||
INDEX_MAX_KEYS, \
|
INDEX_MAX_KEYS, \
|
||||||
NAMEDATALEN, \
|
NAMEDATALEN, \
|
||||||
FLOAT4PASSBYVAL, \
|
|
||||||
FLOAT8PASSBYVAL \
|
FLOAT8PASSBYVAL \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,9 +70,6 @@
|
|||||||
MSVC and with C++ compilers. */
|
MSVC and with C++ compilers. */
|
||||||
#undef FLEXIBLE_ARRAY_MEMBER
|
#undef FLEXIBLE_ARRAY_MEMBER
|
||||||
|
|
||||||
/* float4 values are passed by value if 'true', by reference if 'false' */
|
|
||||||
#undef FLOAT4PASSBYVAL
|
|
||||||
|
|
||||||
/* float8, int8, and related values are passed by value if 'true', by
|
/* float8, int8, and related values are passed by value if 'true', by
|
||||||
reference if 'false' */
|
reference if 'false' */
|
||||||
#undef FLOAT8PASSBYVAL
|
#undef FLOAT8PASSBYVAL
|
||||||
@ -901,10 +898,6 @@
|
|||||||
/* Define to use /dev/urandom for random number generation */
|
/* Define to use /dev/urandom for random number generation */
|
||||||
#undef USE_DEV_URANDOM
|
#undef USE_DEV_URANDOM
|
||||||
|
|
||||||
/* Define to 1 if you want float4 values to be passed by value.
|
|
||||||
(--enable-float4-byval) */
|
|
||||||
#undef USE_FLOAT4_BYVAL
|
|
||||||
|
|
||||||
/* Define to 1 if you want float8, int8, etc values to be passed by value.
|
/* Define to 1 if you want float8, int8, etc values to be passed by value.
|
||||||
(--enable-float8-byval) */
|
(--enable-float8-byval) */
|
||||||
#undef USE_FLOAT8_BYVAL
|
#undef USE_FLOAT8_BYVAL
|
||||||
|
@ -659,11 +659,7 @@ extern Datum Int64GetDatum(int64 X);
|
|||||||
/*
|
/*
|
||||||
* DatumGetFloat4
|
* DatumGetFloat4
|
||||||
* Returns 4-byte floating point value of a datum.
|
* Returns 4-byte floating point value of a datum.
|
||||||
*
|
|
||||||
* Note: this macro hides whether float4 is pass by value or by reference.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef USE_FLOAT4_BYVAL
|
|
||||||
static inline float4
|
static inline float4
|
||||||
DatumGetFloat4(Datum X)
|
DatumGetFloat4(Datum X)
|
||||||
{
|
{
|
||||||
@ -676,18 +672,11 @@ DatumGetFloat4(Datum X)
|
|||||||
myunion.value = DatumGetInt32(X);
|
myunion.value = DatumGetInt32(X);
|
||||||
return myunion.retval;
|
return myunion.retval;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define DatumGetFloat4(X) (* ((float4 *) DatumGetPointer(X)))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Float4GetDatum
|
* Float4GetDatum
|
||||||
* Returns datum representation for a 4-byte floating point number.
|
* Returns datum representation for a 4-byte floating point number.
|
||||||
*
|
|
||||||
* Note: if float4 is pass by reference, this function returns a reference
|
|
||||||
* to palloc'd space.
|
|
||||||
*/
|
*/
|
||||||
#ifdef USE_FLOAT4_BYVAL
|
|
||||||
static inline Datum
|
static inline Datum
|
||||||
Float4GetDatum(float4 X)
|
Float4GetDatum(float4 X)
|
||||||
{
|
{
|
||||||
@ -700,9 +689,6 @@ Float4GetDatum(float4 X)
|
|||||||
myunion.value = X;
|
myunion.value = X;
|
||||||
return Int32GetDatum(myunion.retval);
|
return Int32GetDatum(myunion.retval);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
extern Datum Float4GetDatum(float4 X);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DatumGetFloat8
|
* DatumGetFloat8
|
||||||
@ -757,10 +743,9 @@ extern Datum Float8GetDatum(float8 X);
|
|||||||
/*
|
/*
|
||||||
* Int64GetDatumFast
|
* Int64GetDatumFast
|
||||||
* Float8GetDatumFast
|
* Float8GetDatumFast
|
||||||
* Float4GetDatumFast
|
|
||||||
*
|
*
|
||||||
* These macros are intended to allow writing code that does not depend on
|
* These macros are intended to allow writing code that does not depend on
|
||||||
* whether int64, float8, float4 are pass-by-reference types, while not
|
* whether int64 and float8 are pass-by-reference types, while not
|
||||||
* sacrificing performance when they are. The argument must be a variable
|
* sacrificing performance when they are. The argument must be a variable
|
||||||
* that will exist and have the same value for as long as the Datum is needed.
|
* that will exist and have the same value for as long as the Datum is needed.
|
||||||
* In the pass-by-ref case, the address of the variable is taken to use as
|
* In the pass-by-ref case, the address of the variable is taken to use as
|
||||||
@ -776,10 +761,4 @@ extern Datum Float8GetDatum(float8 X);
|
|||||||
#define Float8GetDatumFast(X) PointerGetDatum(&(X))
|
#define Float8GetDatumFast(X) PointerGetDatum(&(X))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_FLOAT4_BYVAL
|
|
||||||
#define Float4GetDatumFast(X) Float4GetDatum(X)
|
|
||||||
#else
|
|
||||||
#define Float4GetDatumFast(X) PointerGetDatum(&(X))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* POSTGRES_H */
|
#endif /* POSTGRES_H */
|
||||||
|
@ -31,8 +31,6 @@ sub _new
|
|||||||
$self->DeterminePlatform();
|
$self->DeterminePlatform();
|
||||||
my $bits = $self->{platform} eq 'Win32' ? 32 : 64;
|
my $bits = $self->{platform} eq 'Win32' ? 32 : 64;
|
||||||
|
|
||||||
$options->{float4byval} = 1
|
|
||||||
unless exists $options->{float4byval};
|
|
||||||
$options->{float8byval} = ($bits == 64)
|
$options->{float8byval} = ($bits == 64)
|
||||||
unless exists $options->{float8byval};
|
unless exists $options->{float8byval};
|
||||||
die "float8byval not permitted on 32 bit platforms"
|
die "float8byval not permitted on 32 bit platforms"
|
||||||
@ -209,15 +207,6 @@ sub GenerateFiles
|
|||||||
print $o "#define XLOG_BLCKSZ ",
|
print $o "#define XLOG_BLCKSZ ",
|
||||||
1024 * $self->{options}->{wal_blocksize}, "\n";
|
1024 * $self->{options}->{wal_blocksize}, "\n";
|
||||||
|
|
||||||
if ($self->{options}->{float4byval})
|
|
||||||
{
|
|
||||||
print $o "#define USE_FLOAT4_BYVAL 1\n";
|
|
||||||
print $o "#define FLOAT4PASSBYVAL true\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $o "#define FLOAT4PASSBYVAL false\n";
|
|
||||||
}
|
|
||||||
if ($self->{options}->{float8byval})
|
if ($self->{options}->{float8byval})
|
||||||
{
|
{
|
||||||
print $o "#define USE_FLOAT8_BYVAL 1\n";
|
print $o "#define USE_FLOAT8_BYVAL 1\n";
|
||||||
|
@ -4,7 +4,6 @@ use warnings;
|
|||||||
|
|
||||||
our $config = {
|
our $config = {
|
||||||
asserts => 0, # --enable-cassert
|
asserts => 0, # --enable-cassert
|
||||||
# float4byval=>1, # --disable-float4-byval, on by default
|
|
||||||
|
|
||||||
# float8byval=> $platformbits == 64, # --disable-float8-byval,
|
# float8byval=> $platformbits == 64, # --disable-float8-byval,
|
||||||
# off by default on 32 bit platforms, on by default on 64 bit platforms
|
# off by default on 32 bit platforms, on by default on 64 bit platforms
|
||||||
|
Loading…
Reference in New Issue
Block a user