PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "common/hashfn.h"
#include "lib/hyperloglog.h"
#include "libpq/pqformat.h"
#include "port/pg_bswap.h"
#include "utils/fmgrprotos.h"
#include "utils/guc.h"
#include "utils/inet.h"
#include "utils/sortsupport.h"
Go to the source code of this file.
Data Structures | |
struct | macaddr_sortsupport_state |
Macros | |
#define | hibits(addr) ((unsigned long)(((addr)->a<<16)|((addr)->b<<8)|((addr)->c))) |
#define | lobits(addr) ((unsigned long)(((addr)->d<<16)|((addr)->e<<8)|((addr)->f))) |
Functions | |
static int | macaddr_cmp_internal (macaddr *a1, macaddr *a2) |
static int | macaddr_fast_cmp (Datum x, Datum y, SortSupport ssup) |
static bool | macaddr_abbrev_abort (int memtupcount, SortSupport ssup) |
static Datum | macaddr_abbrev_convert (Datum original, SortSupport ssup) |
Datum | macaddr_in (PG_FUNCTION_ARGS) |
Datum | macaddr_out (PG_FUNCTION_ARGS) |
Datum | macaddr_recv (PG_FUNCTION_ARGS) |
Datum | macaddr_send (PG_FUNCTION_ARGS) |
Datum | macaddr_cmp (PG_FUNCTION_ARGS) |
Datum | macaddr_lt (PG_FUNCTION_ARGS) |
Datum | macaddr_le (PG_FUNCTION_ARGS) |
Datum | macaddr_eq (PG_FUNCTION_ARGS) |
Datum | macaddr_ge (PG_FUNCTION_ARGS) |
Datum | macaddr_gt (PG_FUNCTION_ARGS) |
Datum | macaddr_ne (PG_FUNCTION_ARGS) |
Datum | hashmacaddr (PG_FUNCTION_ARGS) |
Datum | hashmacaddrextended (PG_FUNCTION_ARGS) |
Datum | macaddr_not (PG_FUNCTION_ARGS) |
Datum | macaddr_and (PG_FUNCTION_ARGS) |
Datum | macaddr_or (PG_FUNCTION_ARGS) |
Datum | macaddr_trunc (PG_FUNCTION_ARGS) |
Datum | macaddr_sortsupport (PG_FUNCTION_ARGS) |
#define lobits | ( | addr | ) | ((unsigned long)(((addr)->d<<16)|((addr)->e<<8)|((addr)->f))) |
Datum hashmacaddr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 267 of file mac.c.
References hash_any(), sort-test::key, and PG_GETARG_MACADDR_P.
Datum hashmacaddrextended | ( | PG_FUNCTION_ARGS | ) |
Definition at line 275 of file mac.c.
References hash_any_extended(), sort-test::key, PG_GETARG_INT64, and PG_GETARG_MACADDR_P.
|
static |
Definition at line 415 of file mac.c.
References macaddr_sortsupport_state::abbr_card, elog, estimateHyperLogLog(), macaddr_sortsupport_state::estimating, macaddr_sortsupport_state::input_count, INT64_FORMAT, LOG, SortSupportData::ssup_extra, and trace_sort.
Referenced by macaddr_sortsupport().
|
static |
Definition at line 477 of file mac.c.
References macaddr_sortsupport_state::abbr_card, addHyperLogLog(), DatumGetMacaddrP(), DatumGetUInt32(), macaddr_sortsupport_state::estimating, hash_uint32(), macaddr_sortsupport_state::input_count, res, SIZEOF_DATUM, and SortSupportData::ssup_extra.
Referenced by macaddr_sortsupport().
Datum macaddr_and | ( | PG_FUNCTION_ARGS | ) |
Definition at line 303 of file mac.c.
References macaddr::a, macaddr::b, macaddr::c, macaddr::d, macaddr::e, macaddr::f, palloc(), PG_GETARG_MACADDR_P, and PG_RETURN_MACADDR_P.
Datum macaddr_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 197 of file mac.c.
References a1, a2, macaddr_cmp_internal(), PG_GETARG_MACADDR_P, and PG_RETURN_INT32.
Referenced by gbt_macadkey_cmp().
Definition at line 182 of file mac.c.
References a1, a2, hibits, and lobits.
Referenced by macaddr_cmp(), macaddr_eq(), macaddr_fast_cmp(), macaddr_ge(), macaddr_gt(), macaddr_le(), macaddr_lt(), and macaddr_ne().
Datum macaddr_eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 228 of file mac.c.
References a1, a2, macaddr_cmp_internal(), PG_GETARG_MACADDR_P, and PG_RETURN_BOOL.
Referenced by gbt_macadeq().
|
static |
Definition at line 400 of file mac.c.
References DatumGetMacaddrP(), macaddr_cmp_internal(), x, and y.
Referenced by macaddr_sortsupport().
Datum macaddr_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 237 of file mac.c.
References a1, a2, macaddr_cmp_internal(), PG_GETARG_MACADDR_P, and PG_RETURN_BOOL.
Referenced by gbt_macadge().
Datum macaddr_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 246 of file mac.c.
References a1, a2, macaddr_cmp_internal(), PG_GETARG_MACADDR_P, and PG_RETURN_BOOL.
Referenced by gbt_macadgt().
Datum macaddr_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 55 of file mac.c.
References a, macaddr::a, b, macaddr::b, macaddr::c, macaddr::d, macaddr::e, ereturn, errcode(), errmsg(), macaddr::f, palloc(), PG_GETARG_CSTRING, PG_RETURN_MACADDR_P, and str.
Datum macaddr_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 219 of file mac.c.
References a1, a2, macaddr_cmp_internal(), PG_GETARG_MACADDR_P, and PG_RETURN_BOOL.
Referenced by gbt_macadle().
Datum macaddr_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 210 of file mac.c.
References a1, a2, macaddr_cmp_internal(), PG_GETARG_MACADDR_P, and PG_RETURN_BOOL.
Referenced by gbt_macadlt().
Datum macaddr_ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 255 of file mac.c.
References a1, a2, macaddr_cmp_internal(), PG_GETARG_MACADDR_P, and PG_RETURN_BOOL.
Datum macaddr_not | ( | PG_FUNCTION_ARGS | ) |
Definition at line 287 of file mac.c.
References macaddr::a, macaddr::b, macaddr::c, macaddr::d, macaddr::e, macaddr::f, palloc(), PG_GETARG_MACADDR_P, and PG_RETURN_MACADDR_P.
Datum macaddr_or | ( | PG_FUNCTION_ARGS | ) |
Definition at line 320 of file mac.c.
References macaddr::a, macaddr::b, macaddr::c, macaddr::d, macaddr::e, macaddr::f, palloc(), PG_GETARG_MACADDR_P, and PG_RETURN_MACADDR_P.
Datum macaddr_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 121 of file mac.c.
References macaddr::a, macaddr::b, macaddr::c, macaddr::d, macaddr::e, macaddr::f, palloc(), PG_GETARG_MACADDR_P, PG_RETURN_CSTRING, and snprintf.
Datum macaddr_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 140 of file mac.c.
References macaddr::a, macaddr::b, buf, macaddr::c, macaddr::d, macaddr::e, macaddr::f, palloc(), PG_GETARG_POINTER, PG_RETURN_MACADDR_P, and pq_getmsgbyte().
Datum macaddr_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 161 of file mac.c.
References macaddr::a, macaddr::b, buf, macaddr::c, macaddr::d, macaddr::e, macaddr::f, PG_GETARG_MACADDR_P, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), and pq_sendbyte().
Datum macaddr_sortsupport | ( | PG_FUNCTION_ARGS | ) |
Definition at line 363 of file mac.c.
References macaddr_sortsupport_state::abbr_card, SortSupportData::abbrev_abort, SortSupportData::abbrev_converter, SortSupportData::abbrev_full_comparator, SortSupportData::abbreviate, SortSupportData::comparator, macaddr_sortsupport_state::estimating, initHyperLogLog(), macaddr_sortsupport_state::input_count, macaddr_abbrev_abort(), macaddr_abbrev_convert(), macaddr_fast_cmp(), MemoryContextSwitchTo(), palloc(), PG_GETARG_POINTER, PG_RETURN_VOID, SortSupportData::ssup_cxt, ssup_datum_unsigned_cmp(), and SortSupportData::ssup_extra.
Datum macaddr_trunc | ( | PG_FUNCTION_ARGS | ) |
Definition at line 341 of file mac.c.
References macaddr::a, macaddr::b, macaddr::c, macaddr::d, macaddr::e, macaddr::f, palloc(), PG_GETARG_MACADDR_P, and PG_RETURN_MACADDR_P.