Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5067

Incorrect source query with simple inherent updates

    Details

      Description

      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).

                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;
      

      And following queries:

      DELETE query

      DELETE FROM VSmallA WHERE IntValue=13
      UPDATE VSmallA Set StringKey='a' WHERE IntValue=13
      

      I get an incorrect source query with x.intvalue in the predicate.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  shawkins Steven Hawkins
                  Reporter:
                  jstastny Jan Stastny
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: