[JBoss JIRA] (TEIID-4228) ODBC "Parse Statements" option can result in changes in LENGTH metadata for columns
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4228?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-4228:
---------------------------------------
Just to confirm this seems to affect only teiid bigdecimal types that have been marked as having a precision of 0 correct? It is generally invalid to have the precision set to 0 - was this something created by the user or by teiid through import?
> ODBC "Parse Statements" option can result in changes in LENGTH metadata for columns
> -----------------------------------------------------------------------------------
>
> Key: TEIID-4228
> URL: https://issues.jboss.org/browse/TEIID-4228
> Project: Teiid
> Issue Type: Bug
> Environment: Connections through ODBC driver
> Reporter: Marc Shirley
> Assignee: Steven Hawkins
>
> Connections through ODBC driver with the driver setting "Parse Statements" option enabled can result in incorrect length values being passed to the client. In some cases (such as SQL Server linked server capabilities), this can result in the client throwing exceptions due to the expected LENGTH changing during the course of the query execution.
> This may be limited to columns with precision set to 0, as the SQL Server linked server case was corrected when the precision was changed from 0 to 9 for the column specified in the error.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (TEIID-4133) SQL Server requires CAST when using NULL in anchor part of recursive CTE
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4133?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-4133:
------------------------------------------------
Andrej Smigala <asmigala(a)redhat.com> changed the Status of [bug 1326826|https://bugzilla.redhat.com/show_bug.cgi?id=1326826] from ON_QA to VERIFIED
> SQL Server requires CAST when using NULL in anchor part of recursive CTE
> ------------------------------------------------------------------------
>
> Key: TEIID-4133
> URL: https://issues.jboss.org/browse/TEIID-4133
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x
> Reporter: Andrej Šmigala
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5
>
>
> Running the following query in teiid:
> {code:sql}
> with a (intkey, stringcolumn, lvl) as
> (
> select intkey, NULL as stringcolumn, 0 as lvl from bqt1.smallb where intkey = 1
> union all
> select n.intkey, n.stringkey as stringcolumn, rcte.lvl + 1 as lvl from bqt1.smallb n inner join a rcte on n.intkey = rcte.intkey + 1
> )
> select * from a
> {code}
> results in the following source query:
> {code:sql}
> WITH a (intkey, stringcolumn, lvl) AS
> (
> SELECT SmallB.IntKey, NULL AS stringcolumn, 0 AS lvl FROM SmallB WHERE SmallB.IntKey = 1
> UNION ALL
> SELECT n.IntKey, n.StringKey AS stringcolumn, (rcte.lvl + 1) AS lvl FROM SmallB n INNER JOIN a rcte ON n.IntKey = (rcte.intkey + 1)
> )
> SELECT a.intkey, a.stringcolumn, a.lvl FROM a
> {code}
> which fails on SQL Server with {noformat}Types don't match between the anchor and the recursive part in column "stringcolumn" of recursive query "a".{noformat}.
> The source query should be
> {code:sql}
> WITH a (intkey, stringcolumn, lvl) AS
> (
> SELECT SmallB.IntKey, CAST(NULL AS VARCHAR(10)) AS stringcolumn, 0 AS lvl FROM SmallB WHERE SmallB.IntKey = 1
> UNION ALL
> SELECT n.IntKey, n.StringKey AS stringcolumn, (rcte.lvl + 1) AS lvl FROM SmallB n INNER JOIN a rcte ON n.IntKey = (rcte.intkey + 1)
> )
> SELECT a.intkey, a.stringcolumn, a.lvl FROM a
> {code}
> i.e. the NULL has to be cast to the precise type of the column in the recursive part of the query.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months
[JBoss JIRA] (TEIID-4135) Invalid query when using recursive CTE with translators that do not suport RCTE pushdown
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4135?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-4135:
------------------------------------------------
Andrej Smigala <asmigala(a)redhat.com> changed the Status of [bug 1326842|https://bugzilla.redhat.com/show_bug.cgi?id=1326842] from ON_QA to VERIFIED
> Invalid query when using recursive CTE with translators that do not suport RCTE pushdown
> ----------------------------------------------------------------------------------------
>
> Key: TEIID-4135
> URL: https://issues.jboss.org/browse/TEIID-4135
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x
> Reporter: Andrej Šmigala
> Assignee: Steven Hawkins
> Fix For: 9.0, 8.12.5
>
>
> When running a recursive common table expression query against a source that does not support recursive cte pushdown, only the recursive part of the query is pushed, which fails, since it references a non-existent table (the cte).
> E. g. the query
> {code:sql}
> WITH tmp_cte(id, fk, lvl) AS (
> SELECT id, fk, 0 as lvl FROM SourceModel.cte_source WHERE fk IS NULL
> UNION ALL
> SELECT e.id, e.fk, lvl + 1 as lvl FROM SourceModel.cte_source AS e INNER JOIN tmp_cte AS ecte ON ecte.id = e.fk
> )
> SELECT * FROM tmp_cte
> {code}
> against a PostreSQL source results in {noformat}Remote org.postgresql.util.PSQLException: ERROR: relation "tmp_cte" does not exist{noformat}
> because this query is pushed down:
> {code:sql}SELECT g_0.id, g_0.fk, g_0.lvl FROM tmp_cte AS g_0{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 7 months