]
Steven Hawkins resolved TEIID-5067.
-----------------------------------
Resolution: Done
Corrected the delete and update to consider all columns that are used in the simple case
so that a compensating query can be used instead when a non-mappable column is used.
Incorrect source query with simple inherent updates
---------------------------------------------------
Key: TEIID-5067
URL:
https://issues.jboss.org/browse/TEIID-5067
Project: Teiid
Issue Type: Bug
Components: JDG Connector, Misc. Connectors
Affects Versions: 8.12.x-6.4
Reporter: Jan Stastny
Assignee: Steven Hawkins
Priority: Critical
Fix For: 10.0, 8.12.x-6.4, 9.3.4, 9.2.6
A delete query against a view fails, when in WHERE clause there is a filter on
non-directly mapped column. Please note, that the integer type is only example, this
happens for any type (time/date/timestamp amongst other).
{code}
CREATE FOREIGN TABLE SmallA (
IntValue string,
StringKey string PRIMARY KEY
) OPTIONS(UPDATABLE true);
CREATE VIEW VSmallA(
IntValue integer,
StringKey string PRIMARY KEY
) OPTIONS (UPDATABLE true) AS
SELECT
CONVERT(source.IntValue,integer), source.StringKey FROM Source.SmallA as
source;
{code}
And following queries:
{code:sql|title=DELETE query}
DELETE FROM VSmallA WHERE IntValue=13
UPDATE VSmallA Set StringKey='a' WHERE IntValue=13
{code}
I get an incorrect source query with x.intvalue in the predicate.