7 Replies Latest reply on Jan 4, 2011 9:27 PM by Steven Hawkins

    StackOverflowError for a simple Select * query over a simple view and SQL Server

    Claudio Venturini Newbie

      Hi,

      I'm new to Teiid but I think I've found a problem in the query processor of Teiid.

       

      I'm testing Teiid 7.2 (final) on JBoss AS 5.1. I have created a simple VDB with 2 models, in teiid designer 7.1. The first (Northwind.xmi) is a source model which connects to SQL Server 2000 trough JDBC (Jtds 1.2.5), and imports all tables from the Notrhwind database (the sample database in SQL server 2000). The other model (logical_northwind.xmi) is a simple view model which includes all the objects of the source model. It doesn't apply any transformation to the data from the source model. The VDB includes these two models, but only the view model is visible.

       

      I've found that a simple query over the view, like SELECT * FROM "logical_northwind"."Northwind.dbo.Categories" fails with a StackOverflowError. And this is the same with all the tables in the view. After some trials, I renamed the table in the view model from "Categories" to "Cat", and now the query works. So it seems that the query fails if the view model uses the same table name used by the source model. Can it be a bug in the query processor, or am I doing something wrong?

       

      In the attachments there are the log files:

      - command.log: contains the messages of the COMMAND_LOG, in case of a query which fails (it is on the Employees tables, but is the same with all the tables)

      - command_ok.log:  contains the messages of the COMMAND_LOG, in case of a query which works (it is on the renamed table)

      - server.log: the general log which includes the StackOverflowError. It includes several queries, but the only one which works is at the top of the file. All the following failed.

       

      By reading the log files, the problem seems to be something like an infinite loop in the query optimizer. Or maybe is this issue related to https://issues.jboss.org/browse/TEIID-912 ??

       

      If there are workarounds, please let me know. By now, the only thing I can do is to rename all the tables in the view...

       

      Thanks in advance,

      Claudio