Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ include $(PGXS)
SHLIB_LINK += -lstdc++
SQLPP ?= cpp -undef -w -P -imacros $(shell $(PG_CONFIG) --includedir-server)/pg_config.h

src/hll.o: override CFLAGS += -std=c99
src/hll.o: override CFLAGS += -std=c11

%.sql: update/%.sql
$(SQLPP) $^ > $@
7 changes: 3 additions & 4 deletions expected/card_op.out
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ SELECT #hll_empty(11,5,256,1);
0
(1 row)

\set VERBOSITY terse
-- # gets evaluated first so || hll_union(double, bigint) fails
SELECT #hll_empty(11,5,256,1) || hll_hash_integer(1,0);
ERROR: operator does not exist: double precision || hll_hashval
LINE 1: SELECT #hll_empty(11,5,256,1) || hll_hash_integer(1,0);
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
ERROR: operator does not exist: double precision || hll_hashval at character 31
\set VERBOSITY default
SELECT #(hll_empty(11,5,256,1) || hll_hash_integer(1,0));
?column?
----------
Expand Down
19 changes: 7 additions & 12 deletions expected/hash.out
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,10 @@ WARNING: negative seed values not compatible
(1 row)

-- WARNING: negative seed values not compatible
\set VERBOSITY terse
SELECT hll_hash_boolean(0, -1);
ERROR: function hll_hash_boolean(integer, integer) does not exist
LINE 1: SELECT hll_hash_boolean(0, -1);
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
ERROR: function hll_hash_boolean(integer, integer) does not exist at character 8
\set VERBOSITY default
SELECT hll_hash_smallint(0::smallint, -1);
WARNING: negative seed values not compatible
hll_hash_smallint
Expand Down Expand Up @@ -316,13 +315,9 @@ SELECT hll_empty() || CAST(42 AS bigint)::hll_hashval;
(1 row)

-- ERROR: doesn't cast implicitly
\set VERBOSITY terse
SELECT hll_empty() || 42;
ERROR: operator does not exist: hll || integer
LINE 1: SELECT hll_empty() || 42;
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
ERROR: operator does not exist: hll || integer at character 20
SELECT hll_empty() || 42::bigint;
ERROR: operator does not exist: hll || bigint
LINE 1: SELECT hll_empty() || 42::bigint;
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
ERROR: operator does not exist: hll || bigint at character 20
\set VERBOSITY default
2 changes: 2 additions & 0 deletions sql/card_op.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ SELECT #E'\\x108b49'::hll;

SELECT #hll_empty(11,5,256,1);

\set VERBOSITY terse
-- # gets evaluated first so || hll_union(double, bigint) fails
SELECT #hll_empty(11,5,256,1) || hll_hash_integer(1,0);
\set VERBOSITY default

SELECT #(hll_empty(11,5,256,1) || hll_hash_integer(1,0));

Expand Down
5 changes: 4 additions & 1 deletion sql/hash.sql
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ SELECT hll_hash_bigint(0, -2);
SELECT hll_hash_bigint(0, -2147483648);

-- WARNING: negative seed values not compatible
\set VERBOSITY terse
SELECT hll_hash_boolean(0, -1);
\set VERBOSITY default
SELECT hll_hash_smallint(0::smallint, -1);
SELECT hll_hash_integer(0, -1);
SELECT hll_hash_bigint(0, -1);
Expand Down Expand Up @@ -97,6 +99,7 @@ SELECT hll_empty() || 42::bigint::hll_hashval;
SELECT hll_empty() || CAST(42 AS bigint)::hll_hashval;

-- ERROR: doesn't cast implicitly
\set VERBOSITY terse
SELECT hll_empty() || 42;
SELECT hll_empty() || 42::bigint;

\set VERBOSITY default
12 changes: 10 additions & 2 deletions src/hll.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ hll_aggregation_restriction_hook(PlannerInfo *root, UpperRelationKind stage,
* InitializeHllAggregateOids initializes the array of hll aggregate oids.
*/
static void
InitializeHllAggregateOids()
InitializeHllAggregateOids(void)
{
Oid extensionId = get_extension_oid(EXTENSION_NAME, false);
Oid hllSchemaOid = get_extension_schema(extensionId);
Expand Down Expand Up @@ -336,7 +336,15 @@ FunctionOid(const char *schemaName, const char *functionName, int argumentCount,
List *argumentList = NIL;
const bool findVariadics = false;
const bool findDefaults = false;
#if PG_VERSION_NUM >= 140000
#if PG_VERSION_NUM >= 190000
const bool includeOutArguments = false;
int fgcFlags = 0;

functionList = FuncnameGetCandidates(qualifiedFunctionNameList, argumentCount,
argumentList, findVariadics,
findDefaults, includeOutArguments,
true, &fgcFlags);
#elif PG_VERSION_NUM >= 140000
const bool includeOutArguments = false;

functionList = FuncnameGetCandidates(qualifiedFunctionNameList, argumentCount,
Expand Down