Skip to content

Default a trailing input to the literal MEOS's own calls pass it - #158

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/aux-default-meos-passes
Oct 1, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/aux-default-meos-passes

Conversation

@estebanzimanyi

@estebanzimanyi estebanzimanyi commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

A trailing input of a codec defaults to the literal MEOS's own calls
pass for a parameter of its name, where every call passing a literal
passes the same one (parser/boundargs.py extract_call_literals, read
over meos/src as the wrapper literals are). Every call passing a literal
typmod passes -1, PostgreSQL's unspecified type modifier, so
interval_in, pg_timetz_in and numeric_in read with typmod -1. A name
passed two literals, srid passed 0 and SRID_UNKNOWN or maxdd passed 0
and OUT_DEFAULT_DECIMAL_DIGITS, or one macro, keeps the default the
codec states for it. The literal rides on each parameter as a private
_callLiteral the catalog does not carry.

Why. typmod defaulted to 0, which PostgreSQL reads as a modifier:
interval_in(str, 0) raises "unrecognized interval typmod: 0" and
pg_timetz_in rounds to whole seconds.

Measured. Over MobilityDB 72abdf86c2, MEOS's calls pass a literal typmod
10 times, each -1. The catalog differs from the one derived without this
change in the typmod default alone, 0 to -1: decoderAux and in_aux of
Interval, TimeTzADT and NumericData and the 352 wire decode_aux entries
of the parameters those classes read.

Witness. tests/test_boundargs.py reads one literal for typmod past a
definition, a variable and a comment, none for srid passed two, and
strips the key it attaches; tests/test_enrich.py defaults typmod to -1,
srs to NULL and a boolean to true, keeps 15 for maxdd passed a macro,
and over the catalog finds typmod -1 on the three classes. The suite
floor goes from 377 to 383.

A trailing input of a codec defaults to the literal MEOS's own calls
pass for a parameter of its name, where every call passing a literal
passes the same one (parser/boundargs.py extract_call_literals, read
over meos/src as the wrapper literals are). Every call passing a literal
typmod passes -1, PostgreSQL's unspecified type modifier, so
interval_in, pg_timetz_in and numeric_in read with typmod -1. A name
passed two literals, srid passed 0 and SRID_UNKNOWN or maxdd passed 0
and OUT_DEFAULT_DECIMAL_DIGITS, or one macro, keeps the default the
codec states for it. The literal rides on each parameter as a private
_callLiteral the catalog does not carry.

Why. typmod defaulted to 0, which PostgreSQL reads as a modifier:
interval_in(str, 0) raises "unrecognized interval typmod: 0" and
pg_timetz_in rounds to whole seconds.

Measured. Over MobilityDB 72abdf86c2, MEOS's calls pass a literal typmod
10 times, each -1. The catalog differs from the one derived without this
change in the typmod default alone, 0 to -1: decoderAux and in_aux of
Interval, TimeTzADT and NumericData and the 352 wire decode_aux entries
of the parameters those classes read.

Witness. tests/test_boundargs.py reads one literal for typmod past a
definition, a variable and a comment, none for srid passed two, and
strips the key it attaches; tests/test_enrich.py defaults typmod to -1,
srs to NULL and a boolean to true, keeps 15 for maxdd passed a macro,
and over the catalog finds typmod -1 on the three classes. The suite
floor goes from 377 to 383.
@estebanzimanyi
estebanzimanyi force-pushed the catalog/aux-default-meos-passes branch from b6daea2 to 7afb4ea Compare October 1, 2026 11:24
@estebanzimanyi
estebanzimanyi merged commit 32078f9 into MobilityDB:master Oct 1, 2026
3 checks passed
@estebanzimanyi
estebanzimanyi deleted the catalog/aux-default-meos-passes branch October 1, 2026 11:37
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