Repository navigation
sql-dialect-fixes - #70
Merged
Merged
Conversation
…ttern REGEXP follows the collation of its operand, case-insensitive by default, so "a.*" matched "A..." natively and not when interpreted. The case-sensitive pattern starts with (?-i), read by ICU (MySQL 8.0.4+) and PCRE (MariaDB). Signed-off-by: dbulahov <bulahovdenis@gmail.com>
SQL Server averages an INTEGER column to an INTEGER (31 for 31 and 32). The renderer asks the dialect for the operand of an avg aggregate (AggregationGenerator.averageOperand, the operand itself by default); SQL Server reads it as float. Signed-off-by: dbulahov <bulahovdenis@gmail.com>
PostgreSQL had no list aggregation, and every text aggregation measure failed: the SQL builder declined the segment and the recorder could not write it either. STRING_AGG takes text only, so the operand is cast; DISTINCT beside an ORDER BY over other columns is an error in PostgreSQL and is left out, as DuckDB does. Signed-off-by: dbulahov <bulahovdenis@gmail.com>
Derby locks its system tables for DDL; tables and indexes created at once deadlocked while a test database was loaded. Signed-off-by: dbulahov <bulahovdenis@gmail.com>
Derby averages an INTEGER column to an INTEGER, like SQL Server; the operand of avg is read as DOUBLE. Signed-off-by: dbulahov <bulahovdenis@gmail.com>
A dialect without DROP TABLE IF EXISTS (Derby, Oracle before 23) writes a plain DROP TABLE, which fails on a table that is not there; every fixture load on Derby failed so. The importer looks the table up by its exact name in its schema first, the name escaped for the metadata pattern. Signed-off-by: dbulahov <bulahovdenis@gmail.com>
The dialect stores a truth value as SMALLINT, and Derby does not compare SMALLINT with BOOLEAN; the literal is 1 or 0. Signed-off-by: dbulahov <bulahovdenis@gmail.com>
Derby divides DECIMAL(31,4) by DECIMAL(31,4) at scale 0 and integers to an integer: a native ratio of 1.9 came out as 1. The renderer asks the dialect for the dividend of a division (FunctionGenerator.quotientDividend, the dividend itself by default); Derby reads it as DOUBLE. Signed-off-by: dbulahov <bulahovdenis@gmail.com>
PostgreSQL, SQL Server and H2 divide integers to an integer, and a native filter over sum(units_shipped) / sum(units_ordered) read 0 where MDX reads 0.9. The dividend is read as a floating type, as on Derby. Signed-off-by: dbulahov <bulahovdenis@gmail.com>
…mplement NOT is logical in both. PostgreSQL refused NOT(bit_and(x)) on an integer column; MySQL and MariaDB answered 0 or 1 where DuckDB and the provider answer -2 for the NAND of 1. The complement is ~; MySQL's BIT_AND is unsigned 64-bit, so its complement is read as SIGNED. Signed-off-by: dbulahov <bulahovdenis@gmail.com>
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.
What does this PR do?
dialect(mysql)MATCHESstays case-sensitive:REGEXPfollows the operand's collation (case-insensitive by default), so the pattern now starts with(?-i)(ICU, MySQL 8.0.4+; PCRE, MariaDB).dialect(mssql)AggregationGenerator.averageOperand; SQL Server reads the operand asfloat.dialect(postgresql)STRING_AGG; before, every text aggregation measure failed on PostgreSQL.dialect(derby)supportsParallelLoading() = false); concurrent DDL deadlocked on Derby's system tables.dialect(derby)DOUBLE).importer(csv)DROP TABLEwhen the dialect has noDROP TABLE IF EXISTS(Derby, Oracle before 23).dialect(derby)1/0, theSMALLINTit is stored as.dialect(derby)FunctionGenerator.quotientDividend; the renderer asks the dialect for the dividend of aDIVIDE.dialect(postgresql, mssql, h2)sum(units_shipped) / sum(units_ordered)came out as 0 instead of ~0.9.dialect(postgresql, mysql)~), not logicalNOT.