State the C value feeding a row column two C values of its type fit - #171
Merged
estebanzimanyi merged 1 commit intoOct 4, 2026
Conversation
meta/sql-columns.json states, beside the ordinal and the offset a wrapper computes, the C value feeding a column where the types leave it open: "from" is "return" or the name of an out-parameter, and the column takes that value. A statement naming no C value of the function stops the catalog, as a column nothing feeds does. jsonbEachText states its key from the returned array and its value from the out-parameter values. Witness: jsonb_each_text returns its keys and fills its values, both text, and jsonbEachText returns rows (key text, value text). Over a MobilityDB tree deploying jsonbEachText, run.py stops with "SQL rows with a column MEOS states no source for ... jsonb_each_text: jsonbEachText(jsonb) RETURNS record", since both C values fit both columns. With this change the catalog reads key from return and value from values. Why: matching a column by type refuses to choose between two C values of one type, and it must, since the SQL column order and the C parameter order need not agree; the source is then a fact only the function's author knows, and meta/sql-columns.json is where the catalog reads such facts. A statement that only skipped its column, as the ordinal does, left both C values unfed. Measured: over MobilityDB 453039dd6c the catalog run.py derives with this change is byte-identical to the one it derives without it. Over the MobilityDB branch meos/host-base-sqlfn it derives, where it stopped before, and jsonbEachText carries the columns above. tests/test_sqlfn_rows.py states that two C values of one type need a statement, that a statement feeds its column, and that a statement naming no C value stops the catalog; the suite passes 487 tests with none skipped, above the floor of 469.
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.
meta/sql-columns.json states, beside the ordinal and the offset a wrapper computes, the C value
feeding a column where the types leave it open: "from" is "return" or the name of an
out-parameter, and the column takes that value. A statement naming no C value of the function
stops the catalog, as a column nothing feeds does. jsonbEachText states its key from the
returned array and its value from the out-parameter values.
Witness: jsonb_each_text returns its keys and fills its values, both text, and jsonbEachText
returns rows (key text, value text). Over a MobilityDB tree deploying jsonbEachText, run.py
stops with "SQL rows with a column MEOS states no source for ... jsonb_each_text:
jsonbEachText(jsonb) RETURNS record", since both C values fit both columns. With this change
the catalog reads key from return and value from values.
Why: matching a column by type refuses to choose between two C values of one type, and it must,
since the SQL column order and the C parameter order need not agree; the source is then a fact
only the function's author knows, and meta/sql-columns.json is where the catalog reads such
facts. A statement that only skipped its column, as the ordinal does, left both C values unfed.
Measured: over MobilityDB 453039dd6c the catalog run.py derives with this change is
byte-identical to the one it derives without it. Over the MobilityDB branch
meos/host-base-sqlfn it derives, where it stopped before, and jsonbEachText carries the columns
above. tests/test_sqlfn_rows.py states that two C values of one type need a statement, that a
statement feeds its column, and that a statement naming no C value stops the catalog; the suite
passes 487 tests with none skipped, above the floor of 469.