Default a trailing input to the literal MEOS's own calls pass it - #158
Merged
estebanzimanyi merged 1 commit intoOct 1, 2026
Merged
estebanzimanyi merged 1 commit into
estebanzimanyi merged 1 commit into
Conversation
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
force-pushed
the
catalog/aux-default-meos-passes
branch
from
October 1, 2026 11:24
b6daea2 to
7afb4ea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.