[JBoss JIRA] (TEIID-3345) NPE while accessing VDB via OData access
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-3345?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-3345:
------------------------------------------------
Filip Elias <felias(a)redhat.com> changed the Status of [bug 1194292|https://bugzilla.redhat.com/show_bug.cgi?id=1194292] from VERIFIED to CLOSED
> NPE while accessing VDB via OData access
> ----------------------------------------
>
> Key: TEIID-3345
> URL: https://issues.jboss.org/browse/TEIID-3345
> Project: Teiid
> Issue Type: Bug
> Reporter: Juraj Duráni
> Assignee: Ramesh Reddy
> Priority: Minor
> Labels: Alpha1
> Fix For: 8.11
>
>
> If wrong odata URL is provided, an internal error is displayed:
> URL: http://localhost:8080/odata/
> Exception: org.teiid.core.TeiidRuntimeException: TEIID16008 VDB name not defined on the URL. The url format is http://{host}:{port}/odata/{vdb-name}[.{vdb-version}]/...
> org.teiid.odata.TeiidProducerProvider.getContext(TeiidProducerProvider.java:88)
> org.teiid.odata.TeiidProducerProvider.getContext(TeiidProducerProvider.java:47)
> ....
> This behavior is quite expected.
> URL: http://localhost:8080/odata
> Exception: java.lang.NullPointerException
> org.teiid.odata.TeiidProducerProvider.getContext(TeiidProducerProvider.java:80)
> org.teiid.odata.TeiidProducerProvider.getContext(TeiidProducerProvider.java:47)
> ...
> I expect that teiid should return similar exception
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 4 months
[JBoss JIRA] (TEIID-3882) Unable to convert Geometry Collection to GeoJSON
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-3882?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-3882:
------------------------------------------------
Filip Elias <felias(a)redhat.com> changed the Status of [bug 1296213|https://bugzilla.redhat.com/show_bug.cgi?id=1296213] from VERIFIED to CLOSED
> Unable to convert Geometry Collection to GeoJSON
> ------------------------------------------------
>
> Key: TEIID-3882
> URL: https://issues.jboss.org/browse/TEIID-3882
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.12.3
> Reporter: Andrej Šmigala
> Assignee: Steven Hawkins
> Fix For: 8.13, 8.12.4
>
>
> Running the following query results in the error below:
> {code:sql}
> select ST_AsGeoJson(ST_GeomFromText('GEOMETRYCOLLECTION(POINT(4 6),LINESTRING(4 6,7 10))')) as g{code}
> It appears that jts2geojson only supports converting geometry collections since version 0.6 (teiid uses version 0.4), compare https://github.com/bjornharrtell/jts2geojson/blob/v0.4.0/src/main/java/or... and https://github.com/bjornharrtell/jts2geojson/blob/0.6.0/src/main/java/org...
> {noformat}
> 16:38:00,967 WARN [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue7) TEIID30020 Processing exception for request SqO0xtySU9j7.0 'TEIID30328 Unable to evaluate ST_AsGeoJson(?): TEIID30384 Error while evaluating function st_asgeojson'. Originally ExpressionEvaluationException GeoJSONWriter.java:35.: org.teiid.api.exception.query.ExpressionEvaluationException: TEIID30328 Unable to evaluate ST_AsGeoJson(?): TEIID30384 Error while evaluating function st_asgeojson
> at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:695) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.rewriter.QueryRewriter.evaluate(QueryRewriter.java:2151) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.rewriter.QueryRewriter.rewriteExpressionDirect(QueryRewriter.java:2141) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.rewriter.QueryRewriter.access$000(QueryRewriter.java:101) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.rewriter.QueryRewriter$3.replaceExpression(QueryRewriter.java:640) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.sql.visitor.ExpressionMappingVisitor.visit(ExpressionMappingVisitor.java:157) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.sql.symbol.AliasSymbol.acceptVisitor(AliasSymbol.java:90) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.sql.navigator.AbstractNavigator.visitVisitor(AbstractNavigator.java:54) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.postVisitVisitor(PreOrPostOrderNavigator.java:61) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:80) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.sql.symbol.AliasSymbol.acceptVisitor(AliasSymbol.java:90) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.sql.navigator.AbstractNavigator.visitNode(AbstractNavigator.java:63) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.sql.navigator.AbstractNavigator.visitNodes(AbstractNavigator.java:76) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.sql.navigator.PreOrPostOrderNavigator.visit(PreOrPostOrderNavigator.java:342) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.sql.lang.Select.acceptVisitor(Select.java:168) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.sql.navigator.PostOrderNavigator.doVisit(PostOrderNavigator.java:40) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.rewriter.QueryRewriter.rewriteExpressions(QueryRewriter.java:647) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.rewriter.QueryRewriter.rewriteQuery(QueryRewriter.java:484) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.rewriter.QueryRewriter.rewriteCommand(QueryRewriter.java:224) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:169) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.rewriter.QueryRewriter.rewrite(QueryRewriter.java:173) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:413) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.dqp.internal.process.Request.processRequest(Request.java:463) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:640) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:337) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_65]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_65]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_65]
> Caused by: org.teiid.api.exception.query.FunctionExecutionException: TEIID30384 Error while evaluating function st_asgeojson
> at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:295) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:1384) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.eval.Evaluator.internalEvaluate(Evaluator.java:723) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:693) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> ... 32 more
> Caused by: org.teiid.api.exception.query.FunctionExecutionException
> at org.teiid.query.function.GeometryUtils.geometryToGeoJson(GeometryUtils.java:118) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at org.teiid.query.function.GeometryFunctionMethods.asGeoJson(GeometryFunctionMethods.java:71) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_65]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_65]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_65]
> at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_65]
> at org.teiid.query.function.FunctionDescriptor.invokeFunction(FunctionDescriptor.java:281) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> ... 35 more
> Caused by: java.lang.UnsupportedOperationException
> at org.wololo.jts2geojson.GeoJSONWriter.write(GeoJSONWriter.java:35) [jts2geojson-0.4.0.jar:]
> at org.teiid.query.function.GeometryUtils.geometryToGeoJson(GeometryUtils.java:113) [teiid-engine-8.12.3.redhat-1.jar:8.12.3.redhat-1]
> ... 41 more
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 4 months
[JBoss JIRA] (TEIID-3574) Teiid ODBC driver inconsistent error logs
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-3574?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-3574:
------------------------------------------------
Filip Elias <felias(a)redhat.com> changed the Status of [bug 1243466|https://bugzilla.redhat.com/show_bug.cgi?id=1243466] from VERIFIED to CLOSED
> Teiid ODBC driver inconsistent error logs
> -----------------------------------------
>
> Key: TEIID-3574
> URL: https://issues.jboss.org/browse/TEIID-3574
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.7.1.6_2
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Labels: odbc
> Fix For: 8.12
>
>
> When comparing behaviour of ODBC driver with behaviour of JDBC driver there are a few inconsistencies.
> For particular malformed query there is:
> # no error log entry for ODBC driver, while for JDBC there is a comprehensive explanation in the server logs.
> #* Example query:
> {code:sql}
> SELECT title, COUNT() FROM employeefixed
> {code}
> #* JDBC log entry:
> {code:plain}WARN [org.teiid.PROCESSOR] (Worker13_QueryProcessorQueue382) TEIID30020 Processing exception for request pIU27iFFv21F.7 'TEIID31100 Parsing error: Encountered ", COUNT([*])[*] FROM employeefixed" at line 1, column 21.
> Was expecting: "char" | "cast" | "convert" | "all" | "any" | "array_agg" | "case" | "distinct" | "exists" | "false" ...'. Originally QueryParserException QueryParser.java:214. Enable more detailed logging to see the entire stacktrace.
> {code}
> #* ODBC log entry:
> none present
> # error log but also exception stack trace
> #* Example query:
> {code:sql}
> SELECT title, city, COUNT(title) FROM employeefixed GROUP BY title
> {code}
> #* JDBC log entry:
> {code:plain}
> WARN [org.teiid.PROCESSOR] (Worker14_QueryProcessorQueue384) TEIID30020 Processing exception for request pIU27iFFv21F.8 'TEIID30492 [EmployeeFixedData.EmployeeFixed.city] cannot be used outside of aggregate functions since they are not present in a GROUP BY clause.'. Originally QueryValidatorException Request.java:305. Enable more detailed logging to see the entire stacktrace.
> {code}
> #* ODBC log entry:
> {code:plain}
> WARN [org.teiid.PROCESSOR] (Worker14_QueryProcessorQueue383) TEIID30020 Processing exception for request RPpTChkE/84O.40 'TEIID30492 [EmployeeFixedData.EmployeeFixed.city] cannot be used outside of aggregate functions since they are not present in a GROUP BY clause.'. Originally QueryValidatorException Request.java:305. Enable more detailed logging to see the entire stacktrace.
> ERROR [org.teiid.ODBC] (Worker14_QueryProcessorQueue383) TEIID40015 Unexpected error occurred: java.util.concurrent.ExecutionException: org.teiid.jdbc.TeiidSQLException: TEIID30492 [EmployeeFixedData.EmployeeFixed.city] cannot be used outside of aggregate functions since they are not present in a GROUP BY clause.
> at org.teiid.client.util.ResultsFuture.convertResult(ResultsFuture.java:104) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.client.util.ResultsFuture.get(ResultsFuture.java:99) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.odbc.ODBCServerRemoteImpl$5.onCompletion(ODBCServerRemoteImpl.java:586) [teiid-runtime-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.client.util.ResultsFuture$1.exceptionOccurred(ResultsFuture.java:68) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.jdbc.StatementImpl$2.onCompletion(StatementImpl.java:518) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.RequestWorkItem.sendError(RequestWorkItem.java:1001) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.RequestWorkItem.close(RequestWorkItem.java:556) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:352) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:254) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:274) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_75]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_75]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_75]
> Caused by: org.teiid.jdbc.TeiidSQLException: TEIID30492 [EmployeeFixedData.EmployeeFixed.city] cannot be used outside of aggregate functions since they are not present in a GROUP BY clause.
> at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:135) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:71) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.jdbc.StatementImpl.postReceiveResults(StatementImpl.java:667) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.jdbc.StatementImpl.access$100(StatementImpl.java:63) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.jdbc.StatementImpl$2.onCompletion(StatementImpl.java:515) [teiid-client-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> ... 14 more
> Caused by: org.teiid.api.exception.query.QueryValidatorException: TEIID30492 [EmployeeFixedData.EmployeeFixed.city] cannot be used outside of aggregate functions since they are not present in a GROUP BY clause.
> at org.teiid.dqp.internal.process.Request.validateWithVisitor(Request.java:305) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.Request.validateQuery(Request.java:268) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:385) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.PreparedStatementRequest.generatePlan(PreparedStatementRequest.java:115) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.Request.processRequest(Request.java:435) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.PreparedStatementRequest.processRequest(PreparedStatementRequest.java:290) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:613) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:315) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
> ... 8 more
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 4 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:
------------------------------------------------
Filip Elias <felias(a)redhat.com> changed the Status of [bug 1326826|https://bugzilla.redhat.com/show_bug.cgi?id=1326826] from VERIFIED to CLOSED
> 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, 4 months