Bug 1259736 - (TEIID-3671) Odata filter on child table not working correctly
Odata filter on child table not working correctly
Status: CLOSED CURRENTRELEASE
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid (Show other bugs)
6.1.0
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: jolee
Filip Elias
: QA-Closed
Depends On:
Blocks: 1241696
  Show dependency treegraph
 
Reported: 2015-09-03 09:01 EDT by dsteigne
Modified: 2016-02-10 03:50 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Odata filters do not work correctly on child tables, hence filter results may sometimes be inaccurate.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-10 03:50:21 EST
Type: Support Patch
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
dynamic vdb w/details in comment (2.95 KB, application/xml)
2015-10-23 09:17 EDT, jolee
no flags Details
used for local testing (4.93 KB, application/xml)
2015-10-23 16:19 EDT, jolee
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker TEIID-3671 Critical Closed filter on child table not working 2016-08-09 01:15 EDT
Red Hat Knowledge Base (Solution) 1599793 None None None Never

  None (edit)
Description dsteigne 2015-09-03 09:01:55 EDT
Describe the issue: 
See https://issues.jboss.org/browse/TEIID-3671

the url - //localhost:8080/odata/testVDB/sales('13')/sales_uk?$format=json, i get the results from sales_uk table which are having id=13.

Now i am trying to apply a filter on this url, i am supposed to get results which are having id=13 and satisfy the filter condition, but this url blindly returns me data from sales_uk table which satisfy the filter condition. URL- //localhost:8080/odata/testVDB/sales('13')/sales_uk?$format=json&$filter=DISCOUNT eq '22'



Suggestions for improvement: 

Additional information:
Comment 2 jolee 2015-09-16 11:43:13 EDT
git@github.com:jboss-integration/teiid.git : 8.7.x-prod-ipv6.1 : 62b86a878

git@github.com:teiid/teiid.git : 8.7.x : 62b86a878
Comment 3 dsteigne 2015-10-14 11:28:24 EDT
The fix for this broke the existing work flow of Parent-child tables relationship. 
I was getting Nullpointer exception for the base urls , 'filter for child table not working' is not solved.
11:36:18,353 WARN  [org.teiid.ODATA] (http-/0.0.0.0:8080-1) TEIID16012 Could not produce a successful OData response.  Returning status ServerErrorException with message Internal Server Error.: org.odata4j.exceptions.ServerErrorException
	at org.teiid.odata.LocalClient.executeSQL(LocalClient.java:333) [classes:]
	at org.teiid.odata.TeiidProducer.getNavProperty(TeiidProducer.java:89) [classes:]
	at org.teiid.odata.TeiidProducer.getNavProperty(TeiidProducer.java:55) [classes:]
	at org.odata4j.producer.resources.PropertyRequestResource.getNavProperty(PropertyRequestResource.java:194) [odata-core-0.8.7.redhat-61-1.jar:0.8.7.redhat-61-1]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_75]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_75]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_75]
	at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_75]
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:159) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:92) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.teiid.odata.ODataServletContainerDispatcher.service(ODataServletContainerDispatcher.java:118) [classes:]
	at org.teiid.odata.ODataServlet.service(ODataServlet.java:65) [classes:]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:512) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.4.3.Final-redhat-2.jar:7.4.3.Final-redhat-2]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_75]
Caused by: java.lang.NullPointerException
	at org.teiid.odata.EntityList.getEntity(EntityList.java:62) [classes:]
	at org.teiid.odata.EntityList.addEntity(EntityList.java:54) [classes:]
	at org.teiid.odata.LocalClient.executeSQL(LocalClient.java:302) [classes:]
	... 33 more
Comment 4 JBoss JIRA Server 2015-10-20 04:52:34 EDT
Juraj Duráni <jdurani@redhat.com> updated the status of jira TEIID-3671 to Reopened
Comment 7 jolee 2015-10-23 09:17 EDT
Created attachment 1085846 [details]
dynamic vdb w/details in comment

I seem to be getting a close variation of the results that Jurag and Debbie have seen,  I will use it to vet proposed changes unless someone points out a discrepancy that should be addressed.
Comment 9 jolee 2015-10-23 15:58:29 EDT
git@github.com:jboss-integration/teiid.git : 8.7.x-prod-ipv6.1 : 184a1f2

git@github.com:teiid/teiid.git : 8.7.x : 184a1f2
Comment 10 jolee 2015-10-23 16:19 EDT
Created attachment 1085929 [details]
used for local testing

just updating as last file had issues which were troublesome to track down (TEIID-3787)
Comment 11 Juraj Duráni 2015-10-30 02:29:53 EDT
Both, old and new, issues has been verified in the rebuild. Setting to VERIFIED.
Comment 12 JBoss JIRA Server 2015-10-30 09:59:31 EDT
Steven Hawkins <shawkins@redhat.com> updated the status of jira TEIID-3671 to Resolved
Comment 13 JBoss JIRA Server 2015-10-30 09:59:38 EDT
Steven Hawkins <shawkins@redhat.com> updated the status of jira TEIID-3671 to Closed

Note You need to log in before you can comment on or make changes to this bug.