Repository navigation
dialect: known functions, portable expressions, native types, and fixes from a database run - #72
Merged
Merged
Conversation
…es from a database run - known functions MONTH_NAME, TO_TEXT, PAD_RIGHT, DATE_FROM_PARTS and TO_WIDE_INTEGER; an expression and a derived table written once for every database beside the texts of some dialects (SqlExpression.Portable, FromClause.FromPortable) - native types: SQL Server keeps national text national, long text and binary are MAX; DuckDB long text is VARCHAR, binary BLOB; PostgreSQL and MySQL name their large objects (a BLOB is an OID as pgjdbc binds it, other binary BYTEA; a VARBINARY without a length is a LONGBLOB) - MySQL reads AVG as a double; SQL Server declines a distinct text list; Derby spells a typed null, keeps a text null untyped and reads a part of a date by its own YEAR, MONTH and DAY - a capability says whether SUM keeps its operand's type (SQL Server, Derby: an INTEGER column overflows past 2 147 483 647), and TO_WIDE_INTEGER widens the operand Co-authored-by: dbulahov <bulahovdenis@gmail.com> Signed-off-by: dbulahov <bulahovdenis@gmail.com> Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
stbischof
force-pushed
the
pr/dialect-fixes-2026-10-31
branch
from
October 31, 2026 09:26
056d860 to
91eb3d5
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.
MONTH_NAME,TO_TEXT,PAD_RIGHT,DATE_FROM_PARTSandTO_WIDE_INTEGER, each spelled by the dialect.SqlExpression.Portable) and a derived table (FromClause.FromPortable) are written once as a tree for every database, beside the texts some dialects give. The renderer takes the live dialect's own text where there is one, else renders the tree in that dialect, else takes the generic text.MAX.VARCHARand binary asBLOB.BLOBis anOIDas pgjdbc binds it, other binary isBYTEA, and aVARBINARYwithout a length is aLONGBLOB.AVGas a double.YEAR,MONTHandDAY.sumKeepsTheTypeOfItsOperand, says whetherSUMkeeps its operand's type. It is true for SQL Server and Derby, where a sum over anINTEGERcolumn overflows past 2 147 483 647;TO_WIDE_INTEGERwidens the operand.