PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <math.h>
#include <signal.h>
#include "access/detoast.h"
#include "access/htup_details.h"
#include "catalog/namespace.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_type.h"
#include "commands/sequence.h"
#include "commands/trigger.h"
#include "executor/executor.h"
#include "executor/spi.h"
#include "funcapi.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "nodes/supportnodes.h"
#include "optimizer/optimizer.h"
#include "optimizer/plancat.h"
#include "parser/parse_coerce.h"
#include "port/atomics.h"
#include "storage/spin.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/geo_decls.h"
#include "utils/memutils.h"
#include "utils/rel.h"
#include "utils/typcache.h"
Go to the source code of this file.
Data Structures | |
struct | WIDGET |
Macros | |
#define | EXPECT_TRUE(expr) |
#define | EXPECT_EQ_U32(result_expr, expected_expr) |
#define | EXPECT_EQ_U64(result_expr, expected_expr) |
#define | LDELIM '(' |
#define | RDELIM ')' |
#define | DELIM ',' |
#define | NARGS 3 |
#define | TTDUMMY_INFINITY 999999 |
Variables | |
PG_MODULE_MAGIC | |
static SPIPlanPtr | splan = NULL |
static bool | ttoff = false |
#define EXPECT_EQ_U32 | ( | result_expr, | |
expected_expr | |||
) |
#define EXPECT_EQ_U64 | ( | result_expr, | |
expected_expr | |||
) |
#define EXPECT_TRUE | ( | expr | ) |
Datum binary_coercible | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1152 of file regress.c.
References IsBinaryCoercible(), PG_GETARG_OID, and PG_RETURN_BOOL.
Datum get_environ | ( | PG_FUNCTION_ARGS | ) |
Definition at line 648 of file regress.c.
References construct_array_builtin(), CStringGetTextDatum, environ, i, palloc(), and PG_RETURN_POINTER.
Datum int44in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 499 of file regress.c.
References i, palloc(), PG_GETARG_CSTRING, and PG_RETURN_POINTER.
Datum int44out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 523 of file regress.c.
References palloc(), PG_GETARG_POINTER, PG_RETURN_CSTRING, and snprintf.
Datum interpt_pp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 88 of file regress.c.
References DatumGetBool(), DirectFunctionCall2, i, j, lseg_interpt(), lseg_intersect(), LsegPGetDatum(), PATH::npts, PATH::p, p2, PG_GETARG_PATH_P, PG_RETURN_DATUM, PG_RETURN_NULL, and regress_lseg_construct().
Datum make_tuple_indirect | ( | PG_FUNCTION_ARGS | ) |
Definition at line 549 of file regress.c.
References attlen, attstorage, DatumGetPointer(), detoast_external_attr(), heap_deform_tuple(), heap_form_tuple(), HeapTupleHeaderGetDatumLength, HeapTupleHeaderGetTypeId, HeapTupleHeaderGetTypMod, i, INDIRECT_POINTER_SIZE, InvalidOid, ItemPointerSetInvalid(), lookup_rowtype_tupdesc(), MemoryContextSwitchTo(), TupleDescData::natts, palloc(), palloc0(), pfree(), PG_GETARG_HEAPTUPLEHEADER, PG_RETURN_POINTER, varatt_indirect::pointer, PointerGetDatum(), ReleaseTupleDesc, SET_VARTAG_EXTERNAL, HeapTupleData::t_data, HeapTupleData::t_len, HeapTupleData::t_self, HeapTupleData::t_tableOid, TopTransactionContext, TupleDescAttr, values, VARATT_IS_EXTERNAL_INDIRECT, VARATT_IS_EXTERNAL_ONDISK, VARDATA_EXTERNAL, VARSIZE_ANY, and VARTAG_INDIRECT.
Datum overpaid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 140 of file regress.c.
References DatumGetInt32(), GetAttributeByName(), PG_GETARG_HEAPTUPLEHEADER, PG_RETURN_BOOL, and PG_RETURN_NULL.
PG_FUNCTION_INFO_V1 | ( | binary_coercible | ) |
PG_FUNCTION_INFO_V1 | ( | get_environ | ) |
PG_FUNCTION_INFO_V1 | ( | int44in | ) |
PG_FUNCTION_INFO_V1 | ( | int44out | ) |
PG_FUNCTION_INFO_V1 | ( | interpt_pp | ) |
PG_FUNCTION_INFO_V1 | ( | make_tuple_indirect | ) |
PG_FUNCTION_INFO_V1 | ( | overpaid | ) |
PG_FUNCTION_INFO_V1 | ( | pt_in_widget | ) |
PG_FUNCTION_INFO_V1 | ( | regress_setenv | ) |
PG_FUNCTION_INFO_V1 | ( | reverse_name | ) |
PG_FUNCTION_INFO_V1 | ( | set_ttdummy | ) |
PG_FUNCTION_INFO_V1 | ( | test_atomic_ops | ) |
PG_FUNCTION_INFO_V1 | ( | test_canonicalize_path | ) |
PG_FUNCTION_INFO_V1 | ( | test_enc_conversion | ) |
PG_FUNCTION_INFO_V1 | ( | test_fdw_handler | ) |
PG_FUNCTION_INFO_V1 | ( | test_opclass_options_func | ) |
PG_FUNCTION_INFO_V1 | ( | test_support_func | ) |
PG_FUNCTION_INFO_V1 | ( | trigger_return_old | ) |
PG_FUNCTION_INFO_V1 | ( | ttdummy | ) |
PG_FUNCTION_INFO_V1 | ( | wait_pid | ) |
PG_FUNCTION_INFO_V1 | ( | widget_in | ) |
PG_FUNCTION_INFO_V1 | ( | widget_out | ) |
Datum pt_in_widget | ( | PG_FUNCTION_ARGS | ) |
Definition at line 215 of file regress.c.
References WIDGET::center, DatumGetFloat8(), DirectFunctionCall2, PG_GETARG_POINT_P, PG_GETARG_POINTER, PG_RETURN_BOOL, point_distance(), and PointPGetDatum().
Datum regress_setenv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 671 of file regress.c.
References elog, ERROR, PG_GETARG_TEXT_PP, PG_RETURN_VOID, setenv, superuser(), and text_to_cstring().
Datum reverse_name | ( | PG_FUNCTION_ARGS | ) |
Definition at line 231 of file regress.c.
References i, len, NAMEDATALEN, palloc0(), PG_GETARG_CSTRING, and PG_RETURN_CSTRING.
Datum set_ttdummy | ( | PG_FUNCTION_ARGS | ) |
|
static |
Definition at line 709 of file regress.c.
References EXPECT_TRUE, flag(), pg_atomic_clear_flag(), pg_atomic_init_flag(), pg_atomic_test_set_flag(), and pg_atomic_unlocked_test_flag().
Referenced by test_atomic_ops().
Datum test_atomic_ops | ( | PG_FUNCTION_ARGS | ) |
Definition at line 914 of file regress.c.
References PG_RETURN_BOOL, test_atomic_flag(), test_atomic_uint32(), test_atomic_uint64(), and test_spinlock().
|
static |
Definition at line 725 of file regress.c.
References elog, ERROR, EXPECT_EQ_U32, EXPECT_TRUE, i, pg_atomic_add_fetch_u32(), pg_atomic_compare_exchange_u32(), pg_atomic_exchange_u32(), pg_atomic_fetch_add_u32(), pg_atomic_fetch_and_u32(), pg_atomic_fetch_or_u32(), pg_atomic_fetch_sub_u32(), pg_atomic_init_u32(), pg_atomic_read_u32(), pg_atomic_sub_fetch_u32(), pg_atomic_write_u32(), PG_INT16_MAX, and PG_INT16_MIN.
Referenced by test_atomic_ops().
|
static |
Definition at line 797 of file regress.c.
References elog, ERROR, EXPECT_EQ_U64, EXPECT_TRUE, i, pg_atomic_add_fetch_u64(), pg_atomic_compare_exchange_u64(), pg_atomic_exchange_u64(), pg_atomic_fetch_add_u64(), pg_atomic_fetch_and_u64(), pg_atomic_fetch_or_u64(), pg_atomic_fetch_sub_u64(), pg_atomic_init_u64(), pg_atomic_read_u64(), pg_atomic_sub_fetch_u64(), and pg_atomic_write_u64().
Referenced by test_atomic_ops().
Datum test_canonicalize_path | ( | PG_FUNCTION_ARGS | ) |
Definition at line 539 of file regress.c.
References canonicalize_path(), cstring_to_text(), PG_GETARG_TEXT_PP, PG_RETURN_TEXT_P, and text_to_cstring().
Datum test_enc_conversion | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1035 of file regress.c.
References Assert, BlessTupleDesc(), CurrentMemoryContext, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, FindDefaultConversionProc(), get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), Int32GetDatum(), MAX_CONVERSION_GROWTH, MaxAllocSize, MemoryContextAlloc(), NameStr, OidIsValid, palloc(), pfree(), pg_char_to_encoding, pg_do_encoding_conversion_buf(), pg_encoding_to_char, pg_encoding_verifymbstr(), PG_GETARG_BOOL, PG_GETARG_BYTEA_PP, PG_GETARG_NAME, PG_RETURN_DATUM, PointerGetDatum(), report_invalid_encoding(), SET_VARSIZE, TYPEFUNC_COMPOSITE, values, VARDATA, VARDATA_ANY, VARHDRSZ, and VARSIZE_ANY_EXHDR.
Datum test_fdw_handler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 933 of file regress.c.
References elog, ERROR, and PG_RETURN_NULL.
Datum test_opclass_options_func | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1014 of file regress.c.
References PG_RETURN_NULL.
|
static |
Definition at line 850 of file regress.c.
References elog, ERROR, S_INIT_LOCK, S_LOCK, s_lock(), S_UNLOCK, SpinLockAcquire, SpinLockInit, SpinLockRelease, TAS, and TAS_SPIN.
Referenced by test_atomic_ops().
Datum test_support_func | ( | PG_FUNCTION_ARGS | ) |
Definition at line 941 of file regress.c.
References generate_unaccent_rules::args, SupportRequestSelectivity::args, cpu_operator_cost, DatumGetInt32(), SupportRequestSelectivity::inputcollid, SupportRequestSelectivity::is_join, IsA, join_selectivity(), SupportRequestSelectivity::jointype, linitial, lsecond, SupportRequestRows::node, SupportRequestCost::per_tuple, PG_GETARG_POINTER, PG_RETURN_POINTER, restriction_selectivity(), SupportRequestSelectivity::root, SupportRequestRows::rows, s1, SupportRequestSelectivity::selectivity, SupportRequestSelectivity::sjinfo, SupportRequestCost::startup, and SupportRequestSelectivity::varRelid.
Datum trigger_return_old | ( | PG_FUNCTION_ARGS | ) |
Definition at line 252 of file regress.c.
References CALLED_AS_TRIGGER, elog, ERROR, if(), PointerGetDatum(), and TriggerData::tg_trigtuple.
Datum ttdummy | ( | PG_FUNCTION_ARGS | ) |
Definition at line 273 of file regress.c.
References generate_unaccent_rules::args, attnum, CALLED_AS_TRIGGER, CStringGetTextDatum, DatumGetInt64(), DirectFunctionCall1, elog, ereport, errcode(), errmsg(), ERROR, i, if(), Int32GetDatum(), nextval(), palloc(), pfree(), PointerGetDatum(), relname, SPI_connect(), SPI_execp(), SPI_finish(), SPI_fnumber(), SPI_getbinval(), SPI_getrelname(), SPI_gettypeid(), SPI_keepplan(), SPI_modifytuple(), SPI_prepare(), SPI_result, SPI_result_code_string(), splan, sprintf, TriggerData::tg_event, TriggerData::tg_newtuple, TriggerData::tg_relation, TriggerData::tg_trigger, TriggerData::tg_trigtuple, TRIGGER_FIRED_BEFORE, TRIGGER_FIRED_BY_INSERT, TRIGGER_FIRED_BY_UPDATE, TRIGGER_FIRED_FOR_ROW, TTDUMMY_INFINITY, and ttoff.
Datum wait_pid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 689 of file regress.c.
References CHECK_FOR_INTERRUPTS, elog, ERROR, kill, PG_GETARG_INT32, PG_RETURN_VOID, pg_usleep(), and superuser().
Datum widget_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 169 of file regress.c.
References WIDGET::center, DELIM, ereport, errcode(), errmsg(), ERROR, i, LDELIM, NARGS, palloc(), PG_GETARG_CSTRING, PG_RETURN_POINTER, WIDGET::radius, RDELIM, str, Point::x, and Point::y.
Datum widget_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 203 of file regress.c.
References WIDGET::center, PG_GETARG_POINTER, PG_RETURN_CSTRING, psprintf(), WIDGET::radius, str, Point::x, and Point::y.
|
static |
Definition at line 267 of file regress.c.
Referenced by build_subplan(), create_gating_plan(), ExecReScan(), find_nonnullable_rels_walker(), find_nonnullable_vars_walker(), get_rule_expr(), set_plan_refs(), SS_process_ctes(), and ttdummy().
|
static |
Definition at line 268 of file regress.c.
Referenced by set_ttdummy(), and ttdummy().