Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1506519

Summary: Osisoft translator - SUBSTRING fails when start > string length
Product: [JBoss] JBoss Data Virtualization 6 Reporter: Andrej Smigala <asmigala>
Component: Teiid, DocumentationAssignee: David Le Sage <dlesage>
Status: CLOSED WONTFIX QA Contact: Jan Stastny <jstastny>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.4.0CC: blafond, dlesage, drieden, gjospin, jolee, jschatte, thauser, vhalbert
Target Milestone: GAKeywords: Documentation
Target Release: 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
If you are using the OsiSoft translator and try to use the substring function in your queries, you will find that if the index is larger than the length of the string, an exception is thrown.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-01 08:20:14 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 Andrej Smigala 2017-10-26 09:32:40 UTC
Calling a query such as

> SELECT cast(TIMESTAMPVALUE as string), SUBSTRING(TIMESTAMPVALUE, 22, 0) FROM BQT1.SmallA

fails with the following (the length of timestampvalue converted to string is 20):

> com.osisoft.rdsa.RdsaException: [PIOLEDBENT] Arguments are invalid.


This appears to be an issue with the SUBSTR implementation on the PI server, we are ok with either a workaround or documenting as KI.

Comment 3 David Le Sage 2017-12-03 22:06:25 UTC
Added to release notes errata as a known issue.

Comment 4 Andrej Smigala 2017-12-07 13:46:24 UTC
David, the doc text does not fully capture the nature of the KI. It mentions returning empty string instead of null or not supporting negative indexes, but none of that applies in this case. The real problem is that indexes larger than the length of the string result in an exception.