Bug 1486872

Summary: Incorrect results when executing simple SELECT queries
Product: [JBoss] JBoss Data Virtualization 6 Reporter: Cojan van Ballegooijen <cojan>
Component: TeiidAssignee: Van Halbert <vhalbert>
Status: CLOSED CURRENTRELEASE QA Contact: Jan Stastny <jstastny>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4.0CC: blafond, drieden, gjospin, jolee, jschatte, shawkins, thauser, vhalbert
Target Milestone: ER3   
Target Release: 6.4.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-13 17:39:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Cojan van Ballegooijen 2017-08-30 16:32:58 UTC
Description of problem:
Incorrect results when executing simple SELECT queries

Version-Release number of selected component (if applicable):
6.3.6

How reproducible:
Use any deployed VDB and execute the following select statements

Steps to Reproduce:
1. Use any deployed VDB
2. Connect using JDBC client i.e. SQuirrelSQL
3. Run following query
3a. SELECT not(false)
3b. SELECT * FROM <model> where 1 = 1

Actual results 3a:
3a. SELECT not(false)
1st attempt returns true
2nd attempt returns false

Actual results 3b:
no rows returned

Expected results:

3a. true all the time
3b. all rows should be returned since 1 is equal to 1 = true

Additional info:
Tested it in 6.4 ER1 and seems to be fixed in this release.

Comment 2 Steven Hawkins 2017-08-30 18:11:40 UTC
As written this is not reproducible for me, but the issue here seems rooted in using the predicate "not(true)".  Due to how this is handled in the rewriter the constant representing true is modified, thus later queries become invalidated.  I've captured this as https://issues.jboss.org/browse/TEIID-5045