]
RH Bugzilla Integration commented on TEIID-5195:
------------------------------------------------
Andrej Smigala <asmigala(a)redhat.com> changed the Status of [bug
Osisoft translator - applying LIMIT on a UNION query causes syntax
error
------------------------------------------------------------------------
Key: TEIID-5195
URL:
https://issues.jboss.org/browse/TEIID-5195
Project: Teiid
Issue Type: Bug
Components: JDBC Connector
Affects Versions: 8.12.x-6.4
Reporter: Andrej Šmigala
Assignee: Ramesh Reddy
Fix For: 8.12.x-6.4, 10.1
Query such as
{code:sql}
SELECT g_0.intkey FROM bqt1.smalla g_0 UNION SELECT g_1.intkey FROM bqt1.smallb g_1 LIMIT
100
{code}
fails with
{noformat}
[PIOLEDBENT] [SQL Parser] [Line 1:106] Syntax error at 'TOP'
{noformat}
because it is translated as
{code:sql}
SELECT g_1.IntKey AS c_0 FROM dvqe..SmallA AS g_1 UNION SELECT g_0.IntKey AS c_0 FROM
dvqe..SmallB AS g_0 TOP 100
{code}
notice the TOP 100 at the end, instead of right after the SELECT.