Skip to content

Read a wrapper's call to the pg_ twin of a function as a call to it - #175

Open
estebanzimanyi wants to merge 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/pg-twin-bound-args
Open

estebanzimanyi wants to merge 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/pg-twin-bound-args

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

A function MEOS takes from PostgreSQL is public under PostgreSQL's name only in MEOS, where it
calls its pg_ twin, which takes the same parameters in the same order; the extension, which
links PostgreSQL's own function of that name, calls the twin. The bound arguments a wrapper
passes are read from its call to the function or to its pg_ twin, so Jsonb_path_exists_common
calling pg_jsonb_path_exists(jb, jp, vars, silent, tz) binds tz for jsonb_path_exists:
jsonbPathExists passes false and jsonbPathExistsTz true. PgTwinTests reads both wrappers of one
helper, and a helper calling another function binds nothing.

Witness: over MobilityDB 2d13c5c42d the catalog states jsonbPathExists and jsonbPathExistsTz
with no boundArgs, so their two signatures cannot be told apart and a binding cannot pass tz;
the JMEOS generators leave the path functions over jsonb out on an argument count, four SQL
arguments for five C parameters.

Measured: over MobilityDB 2d13c5c42d, 12 signatures of 6 functions carry boundArgs, tz false
and true for jsonb_path_exists, jsonb_path_match, jsonb_path_query_all, jsonb_path_query_array
and jsonb_path_query_first, any true for jsonbExistsAny and false for jsonbExistsAll; no other
entry of the catalog differs. The catalog holds 216 functions with a pg_ twin, 213 with the same
parameters and 3 whose parameters differ in name alone (json_make, float4_cmp, float8_cmp), and
a twin binds by position. The suite passes, 473 tests; against the parser of master
PgTwinTests' twin test fails.

A function MEOS takes from PostgreSQL is public under PostgreSQL's name only in MEOS, where it
calls its pg_ twin, which takes the same parameters in the same order; the extension, which
links PostgreSQL's own function of that name, calls the twin. The bound arguments a wrapper
passes are read from its call to the function or to its pg_ twin, so Jsonb_path_exists_common
calling pg_jsonb_path_exists(jb, jp, vars, silent, tz) binds tz for jsonb_path_exists:
jsonbPathExists passes false and jsonbPathExistsTz true. PgTwinTests reads both wrappers of one
helper, and a helper calling another function binds nothing.

Witness: over MobilityDB 2d13c5c42d the catalog states jsonbPathExists and jsonbPathExistsTz
with no boundArgs, so their two signatures cannot be told apart and a binding cannot pass tz;
the JMEOS generators leave the path functions over jsonb out on an argument count, four SQL
arguments for five C parameters.

Measured: over MobilityDB 2d13c5c42d, 12 signatures of 6 functions carry boundArgs, tz false
and true for jsonb_path_exists, jsonb_path_match, jsonb_path_query_all, jsonb_path_query_array
and jsonb_path_query_first, any true for jsonbExistsAny and false for jsonbExistsAll; no other
entry of the catalog differs. The catalog holds 216 functions with a pg_ twin, 213 with the same
parameters and 3 whose parameters differ in name alone (json_make, float4_cmp, float8_cmp), and
a twin binds by position. The suite passes, 473 tests; against the parser of master
PgTwinTests' twin test fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant