diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/access/index/indexam.c | 5 | ||||
-rw-r--r-- | src/backend/access/transam/xlog.c | 17 | ||||
-rw-r--r-- | src/backend/bootstrap/bootstrap.c | 2 | ||||
-rw-r--r-- | src/backend/catalog/genbki.pl | 2 | ||||
-rw-r--r-- | src/backend/commands/analyze.c | 2 | ||||
-rw-r--r-- | src/backend/utils/fmgr/dfmgr.c | 9 | ||||
-rw-r--r-- | src/backend/utils/fmgr/fmgr.c | 19 | ||||
-rw-r--r-- | src/backend/utils/misc/pg_controldata.c | 17 |
8 files changed, 11 insertions, 62 deletions
diff --git a/src/backend/access/index/indexam.c b/src/backend/access/index/indexam.c index 9dfa0ddfbb6..4af418287d2 100644 --- a/src/backend/access/index/indexam.c +++ b/src/backend/access/index/indexam.c @@ -879,11 +879,6 @@ index_store_float8_orderby_distances(IndexScanDesc scan, Oid *orderByTypes, else if (orderByTypes[i] == FLOAT4OID) { /* 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) { scan->xs_orderbyvals[i] = Float4GetDatum((float4) distances[i].value); diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 3b766e66b9e..5f0ee50092c 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -4516,7 +4516,6 @@ WriteControlFile(void) ControlFile->toast_max_chunk_size = TOAST_MAX_CHUNK_SIZE; ControlFile->loblksize = LOBLKSIZE; - ControlFile->float4ByVal = FLOAT4PASSBYVAL; ControlFile->float8ByVal = FLOAT8PASSBYVAL; /* Contents are protected with a CRC */ @@ -4720,22 +4719,6 @@ ReadControlFile(void) ControlFile->loblksize, (int) LOBLKSIZE), 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 if (ControlFile->float8ByVal != true) ereport(FATAL, diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index 9238fbe98d7..8ea033610d6 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -111,7 +111,7 @@ static const struct typinfo TypInfo[] = { F_INT2IN, F_INT2OUT}, {"int4", INT4OID, 0, 4, true, 'i', 'p', InvalidOid, F_INT4IN, F_INT4OUT}, - {"float4", FLOAT4OID, 0, 4, FLOAT4PASSBYVAL, 'i', 'p', InvalidOid, + {"float4", FLOAT4OID, 0, 4, true, 'i', 'p', InvalidOid, F_FLOAT4IN, F_FLOAT4OUT}, {"name", NAMEOID, CHAROID, NAMEDATALEN, false, 'c', 'p', C_COLLATION_OID, F_NAMEIN, F_NAMEOUT}, diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl index 201d12d358c..6eff045bd9a 100644 --- a/src/backend/catalog/genbki.pl +++ b/src/backend/catalog/genbki.pl @@ -890,7 +890,7 @@ sub morph_row_for_schemapg } # 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. elsif ($atttype eq 'bool') { diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 7accb950eb1..71372ceb161 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -1496,7 +1496,7 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) /* XXX knows more than it should about type float4: */ arry = construct_array(numdatums, nnum, FLOAT4OID, - sizeof(float4), FLOAT4PASSBYVAL, 'i'); + sizeof(float4), true, 'i'); values[i++] = PointerGetDatum(arry); /* stanumbersN */ } else diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c index c8d2cef35ff..37992ffd448 100644 --- a/src/backend/utils/fmgr/dfmgr.c +++ b/src/backend/utils/fmgr/dfmgr.c @@ -365,15 +365,6 @@ incompatible_module_error(const char *libname, 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 (details.len) diff --git a/src/backend/utils/fmgr/fmgr.c b/src/backend/utils/fmgr/fmgr.c index 099ebd779ba..2ce7a866c90 100644 --- a/src/backend/utils/fmgr/fmgr.c +++ b/src/backend/utils/fmgr/fmgr.c @@ -1683,7 +1683,7 @@ OidSendFunctionCall(Oid functionId, Datum val) /*------------------------------------------------------------------------- * 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 * at compile time even if pass-by-val is possible.) * @@ -1703,21 +1703,6 @@ Int64GetDatum(int64 X) *retval = X; 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 Float8GetDatum(float8 X) @@ -1727,7 +1712,7 @@ Float8GetDatum(float8 X) *retval = X; return PointerGetDatum(retval); } -#endif +#endif /* USE_FLOAT8_BYVAL */ /*------------------------------------------------------------------------- diff --git a/src/backend/utils/misc/pg_controldata.c b/src/backend/utils/misc/pg_controldata.c index 3d0916fea70..7007d6503f8 100644 --- a/src/backend/utils/misc/pg_controldata.c +++ b/src/backend/utils/misc/pg_controldata.c @@ -264,8 +264,8 @@ pg_control_recovery(PG_FUNCTION_ARGS) Datum pg_control_init(PG_FUNCTION_ARGS) { - Datum values[12]; - bool nulls[12]; + Datum values[11]; + bool nulls[11]; TupleDesc tupdesc; HeapTuple htup; ControlFileData *ControlFile; @@ -294,11 +294,9 @@ pg_control_init(PG_FUNCTION_ARGS) INT4OID, -1, 0); TupleDescInitEntry(tupdesc, (AttrNumber) 9, "large_object_chunk_size", INT4OID, -1, 0); - TupleDescInitEntry(tupdesc, (AttrNumber) 10, "float4_pass_by_value", + TupleDescInitEntry(tupdesc, (AttrNumber) 10, "float8_pass_by_value", BOOLOID, -1, 0); - TupleDescInitEntry(tupdesc, (AttrNumber) 11, "float8_pass_by_value", - BOOLOID, -1, 0); - TupleDescInitEntry(tupdesc, (AttrNumber) 12, "data_page_checksum_version", + TupleDescInitEntry(tupdesc, (AttrNumber) 11, "data_page_checksum_version", INT4OID, -1, 0); tupdesc = BlessTupleDesc(tupdesc); @@ -335,15 +333,12 @@ pg_control_init(PG_FUNCTION_ARGS) values[8] = Int32GetDatum(ControlFile->loblksize); nulls[8] = false; - values[9] = BoolGetDatum(ControlFile->float4ByVal); + values[9] = BoolGetDatum(ControlFile->float8ByVal); nulls[9] = false; - values[10] = BoolGetDatum(ControlFile->float8ByVal); + values[10] = Int32GetDatum(ControlFile->data_checksum_version); nulls[10] = false; - values[11] = Int32GetDatum(ControlFile->data_checksum_version); - nulls[11] = false; - htup = heap_form_tuple(tupdesc, values, nulls); PG_RETURN_DATUM(HeapTupleGetDatum(htup)); |