|
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/catalog.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/functions.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 "postmaster/postmaster.h"#include "storage/spin.h"#include "tcop/tcopprot.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 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 1117 of file regress.c.
References IsBinaryCoercible(), PG_GETARG_OID, and PG_RETURN_BOOL.
| Datum get_environ | ( | PG_FUNCTION_ARGS | ) |
Definition at line 435 of file regress.c.
References construct_array_builtin(), CStringGetTextDatum, environ, i, palloc(), and PG_RETURN_POINTER.
| Datum int44in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 286 of file regress.c.
References i, palloc(), PG_GETARG_CSTRING, and PG_RETURN_POINTER.
| Datum int44out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 310 of file regress.c.
References palloc(), PG_GETARG_POINTER, PG_RETURN_CSTRING, and snprintf.
| Datum interpt_pp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 95 of file regress.c.
References DatumGetBool(), DirectFunctionCall2, i, j, lseg_interpt(), lseg_intersect(), LsegPGetDatum(), PATH::npts, PATH::p, PG_GETARG_PATH_P, PG_RETURN_DATUM, PG_RETURN_NULL, and regress_lseg_construct().
| Datum is_catalog_text_unique_index_oid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 730 of file regress.c.
References BoolGetDatum(), IsCatalogTextUniqueIndexOid(), and PG_GETARG_OID.
| Datum make_tuple_indirect | ( | PG_FUNCTION_ARGS | ) |
Definition at line 336 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 147 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 | ( | is_catalog_text_unique_index_oid | ) |
| 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 | ( | test_atomic_ops | ) |
| PG_FUNCTION_INFO_V1 | ( | test_canonicalize_path | ) |
| PG_FUNCTION_INFO_V1 | ( | test_enc_conversion | ) |
| PG_FUNCTION_INFO_V1 | ( | test_enc_setup | ) |
| PG_FUNCTION_INFO_V1 | ( | test_fdw_handler | ) |
| PG_FUNCTION_INFO_V1 | ( | test_inline_in_from_support_func | ) |
| PG_FUNCTION_INFO_V1 | ( | test_opclass_options_func | ) |
| PG_FUNCTION_INFO_V1 | ( | test_relpath | ) |
| PG_FUNCTION_INFO_V1 | ( | test_support_func | ) |
| PG_FUNCTION_INFO_V1 | ( | trigger_return_old | ) |
| PG_FUNCTION_INFO_V1 | ( | wait_pid | ) |
| PG_FUNCTION_INFO_V1 | ( | widget_in | ) |
| PG_FUNCTION_INFO_V1 | ( | widget_out | ) |
| PG_MODULE_MAGIC_EXT | ( | . | name = "regress", |
| . | version = PG_VERSION |
||
| ) |
| Datum pt_in_widget | ( | PG_FUNCTION_ARGS | ) |
Definition at line 222 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 460 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 238 of file regress.c.
References i, len, NAMEDATALEN, palloc0(), PG_GETARG_CSTRING, and PG_RETURN_CSTRING.
|
static |
Definition at line 498 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 703 of file regress.c.
References PG_RETURN_BOOL, test_atomic_flag(), test_atomic_uint32(), test_atomic_uint64(), and test_spinlock().
|
static |
Definition at line 514 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 586 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 326 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 1000 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_enc_setup | ( | PG_FUNCTION_ARGS | ) |
Definition at line 937 of file regress.c.
References _PG_LAST_ENCODING_, buf, elog, i, len, name, pg_enc2name_tbl, pg_encoding_max_length(), pg_encoding_mblen(), pg_encoding_set_invalid(), pg_encoding_verifymbstr(), PG_RETURN_VOID, strnlen(), and WARNING.
| Datum test_fdw_handler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 722 of file regress.c.
References elog, ERROR, and PG_RETURN_NULL.
| Datum test_inline_in_from_support_func | ( | PG_FUNCTION_ARGS | ) |
Definition at line 810 of file regress.c.
References appendStringInfo(), FuncExpr::args, StringInfoData::data, ereport, errmsg(), RangeTblFunction::funcexpr, if(), initStringInfo(), IsA, linitial, list_length(), lsecond, lthird, pg_analyze_and_rewrite_withcb(), PG_GETARG_POINTER, pg_parse_query(), PG_RETURN_POINTER, prepare_sql_fn_parse_info(), SupportRequestInlineInFrom::proc, querytree(), quote_identifier(), SupportRequestInlineInFrom::rtfunc, sql_fn_parser_setup(), TextDatumGetCString, and WARNING.
| Datum test_opclass_options_func | ( | PG_FUNCTION_ARGS | ) |
Definition at line 929 of file regress.c.
References PG_RETURN_NULL.
| Datum test_relpath | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1130 of file regress.c.
References elog, GetRelationPath(), INIT_FORKNUM, MAX_BACKENDS, OID_MAX, PG_RETURN_VOID, PROCNUMBER_CHARS, REL_PATH_STR_MAXLEN, RelPathStr::str, and WARNING.
|
static |
Definition at line 639 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 737 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 259 of file regress.c.
References CALLED_AS_TRIGGER, elog, ERROR, if(), PointerGetDatum(), and TriggerData::tg_trigtuple.
| Datum wait_pid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 478 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 176 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 210 of file regress.c.
References WIDGET::center, PG_GETARG_POINTER, PG_RETURN_CSTRING, psprintf(), WIDGET::radius, str, Point::x, and Point::y.