[JBoss JIRA] (TEIID-5800) Error in generated links in odata pages
by Christoph John (Jira)
[ https://issues.jboss.org/browse/TEIID-5800?page=com.atlassian.jira.plugin... ]
Christoph John commented on TEIID-5800:
---------------------------------------
Hello Steven,
I have to close the issue. Yesterday, I forgot to update the teiid sources and used sources which were about 3 weeks old. With the current sources I cannot replicate the issue.
> Error in generated links in odata pages
> ---------------------------------------
>
> Key: TEIID-5800
> URL: https://issues.jboss.org/browse/TEIID-5800
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 13.0
> Reporter: Christoph John
> Assignee: Steven Hawkins
> Priority: Major
>
> The generated urls in the generated odata webpages seem to have a bug. The primary key appears twice here
> expected result:
> http://localhost:18080/odata4/svc/my_nutri_diary/Account(idProfile=1)
> actual result:
> <a:entry>
> <a:id>
> http://localhost:18080/odata4/svc/my_nutri_diary/Account(idProfile=1,idPr...
> </a:id>
> Table definition is given as:
> CREATE FOREIGN TABLE Account (
> idProfile long NOT NULL AUTO_INCREMENT OPTIONS(NAMEINSOURCE '"idProfile"', NATIVE_TYPE 'BIGINT'),
> uuidUser string(36) NOT NULL OPTIONS(NAMEINSOURCE '"uuidUser"', NATIVE_TYPE 'CHAR'),
> CONSTRAINT "PRIMARY" PRIMARY KEY(idProfile),
> CONSTRAINT uuidUser_UNIQUE UNIQUE(uuidUser)
> ) OPTIONS(NAMEINSOURCE '"Account"', UPDATABLE 'TRUE', CARDINALITY '2');
> I have used the github sources from yesterday.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 3 months
[JBoss JIRA] (TEIID-5799) GENERATED_KEY cannot resolve primary key, if created via insert trigger on view
by Christoph John (Jira)
[ https://issues.jboss.org/browse/TEIID-5799?page=com.atlassian.jira.plugin... ]
Christoph John commented on TEIID-5799:
---------------------------------------
Hello Steven,
I did assamble a compose file for you with teiid and a mysql database holding test data, to show the issue. I also added 3 curl scripts with POST requests which show the bugs in the three relevant code paths in the "CREATE TRIGGER ON Diary INSTEAD OF INSERT AS" code.
By building the compose file, I observed a quite weird behaviour. Therefore I am currently assuming, that the observed bug might be runtime related.
My full installation at home includes a keycloak server for oauth and permission handling in addition to what I packaged into the compose file. For my home install, the provided scripts 1 and 2 are working fine. Hence, I do not have issues with the first 2 code paths of the INSERT trigger.
The only difference in the vdb, compared to the one provided in this example is, that here user odata has simply all permissions. Hence, the vdb is identical except for the grants part of the vdb.
What I do not understand is, that scripts 1 and 2 in this provided example are not working. Here I also get
"TEIID16016 Insert into Diary success, but failed to retrieve auto generated keys from source, thus failed to show result entity; Supply the key values."
I furthermore observed, that in my full installation, if I copy the IF part of the code into ELSE IF (new.fkDatabaseKey = 3), (which should be working code if the correct product ID is provided to the insert (attention foreign key constraints)) than I also observe the mentioned error.
To some up, due to these facts I assume something runtime related to be wrong here. You find the compose file alongside with a detail howto README at:
https://c.gmx.net/@328076122686231878/d2XSupdWRYmtR_WOFjhHQQ
> GENERATED_KEY cannot resolve primary key, if created via insert trigger on view
> -------------------------------------------------------------------------------
>
> Key: TEIID-5799
> URL: https://issues.jboss.org/browse/TEIID-5799
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 13.0
> Reporter: Christoph John
> Assignee: Steven Hawkins
> Priority: Blocker
> Attachments: svc-vdb-example.ddl
>
>
> Hello Steven,
> I just ran into the next issue with the generated key functionality. Attached you find an example. The relevant section is given in
> CREATE TRIGGER ON Diary INSTEAD OF INSERT AS
> with the block following:
> ELSE IF (new.fkDatabaseKey = 3)
> In the insert trigger I am trying to duplicate a record from table "UserDefinedProducts" and reference it in the row to be created from the trigger.
> I again the the error message:
> POST on 'Diary' failed; will be repeated automatically - Error: TEIID16016 Insert into Diary success, but failed to retrieve auto generated keys from source, thus failed to show result entity; Supply the key values.
> I am using the most recent sources checked out about an hour ago.
> Do you see a bug in my code, or is it again an issue I have hit? Thanks for your help!
> Let me know if I shall assemble a docker-compose file for you to debug the issue.
> Update: As I seem to be not able to delete attachments here. One further note. My example hat a permission error in one line where I have red from the wrong table. It should instead be:
> SELECT * INTO #tmpItem FROM UserDefinedProductsOfAllUsers WHERE fkProduct = new.fkProduct LIMIT 1;
> However, the previously described error stays the same.
> Best regards,
> Christoph
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 3 months
[JBoss JIRA] (TEIID-5799) GENERATED_KEY cannot resolve primary key, if created via insert trigger on view
by Christoph John (Jira)
[ https://issues.jboss.org/browse/TEIID-5799?page=com.atlassian.jira.plugin... ]
Christoph John commented on TEIID-5799:
---------------------------------------
Hello Steven, the relevant post holds all the relevant data
{"fkProfile":"1","AddedDateTime":"2019-07-30T23:07:08+02:00","fkProduct":"657815","fkDatabaseKey":3,"MealNumber":"5","AmountInG":100}
However, it seems there got something messed up with the generated key retrieval in the recent sources. I am just trying to setup a compose file and hope that I will be able to deliver more feedback tomorrow. I am not sure what is going one, but the same ddl file working in one teiid setup, does not work in the next one. More on that tomorrow.
Best regards,
Christoph
> GENERATED_KEY cannot resolve primary key, if created via insert trigger on view
> -------------------------------------------------------------------------------
>
> Key: TEIID-5799
> URL: https://issues.jboss.org/browse/TEIID-5799
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 13.0
> Reporter: Christoph John
> Assignee: Steven Hawkins
> Priority: Blocker
> Attachments: svc-vdb-example.ddl
>
>
> Hello Steven,
> I just ran into the next issue with the generated key functionality. Attached you find an example. The relevant section is given in
> CREATE TRIGGER ON Diary INSTEAD OF INSERT AS
> with the block following:
> ELSE IF (new.fkDatabaseKey = 3)
> In the insert trigger I am trying to duplicate a record from table "UserDefinedProducts" and reference it in the row to be created from the trigger.
> I again the the error message:
> POST on 'Diary' failed; will be repeated automatically - Error: TEIID16016 Insert into Diary success, but failed to retrieve auto generated keys from source, thus failed to show result entity; Supply the key values.
> I am using the most recent sources checked out about an hour ago.
> Do you see a bug in my code, or is it again an issue I have hit? Thanks for your help!
> Let me know if I shall assemble a docker-compose file for you to debug the issue.
> Update: As I seem to be not able to delete attachments here. One further note. My example hat a permission error in one line where I have red from the wrong table. It should instead be:
> SELECT * INTO #tmpItem FROM UserDefinedProductsOfAllUsers WHERE fkProduct = new.fkProduct LIMIT 1;
> However, the previously described error stays the same.
> Best regards,
> Christoph
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 3 months
[JBoss JIRA] (TEIID-5800) Error in generated links in odata pages
by Christoph John (Jira)
[ https://issues.jboss.org/browse/TEIID-5800?page=com.atlassian.jira.plugin... ]
Christoph John updated TEIID-5800:
----------------------------------
Description:
The generated urls in the generated odata webpages seem to have a bug. The primary key appears twice here
expected result:
http://localhost:18080/odata4/svc/my_nutri_diary/Account(idProfile=1)
actual result:
<a:entry>
<a:id>
http://localhost:18080/odata4/svc/my_nutri_diary/Account(idProfile=1,idPr...
</a:id>
Table definition is given as:
CREATE FOREIGN TABLE Account (
idProfile long NOT NULL AUTO_INCREMENT OPTIONS(NAMEINSOURCE '"idProfile"', NATIVE_TYPE 'BIGINT'),
uuidUser string(36) NOT NULL OPTIONS(NAMEINSOURCE '"uuidUser"', NATIVE_TYPE 'CHAR'),
CONSTRAINT "PRIMARY" PRIMARY KEY(idProfile),
CONSTRAINT uuidUser_UNIQUE UNIQUE(uuidUser)
) OPTIONS(NAMEINSOURCE '"Account"', UPDATABLE 'TRUE', CARDINALITY '2');
I have used the github sources from yesterday.
was:
The generated urls in the generated odata webpages seem to have a bug. The primary key appears twice here
expected result:
http://localhost:18080/odata4/svc/my_nutri_diary/Account(idProfile=1)
actual result:
<a:entry>
<a:id>
http://localhost:18080/odata4/svc/my_nutri_diary/Account(idProfile=1,idPr...
</a:id>
I have used the github sources from yesterday.
> Error in generated links in odata pages
> ---------------------------------------
>
> Key: TEIID-5800
> URL: https://issues.jboss.org/browse/TEIID-5800
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 13.0
> Reporter: Christoph John
> Assignee: Steven Hawkins
> Priority: Major
>
> The generated urls in the generated odata webpages seem to have a bug. The primary key appears twice here
> expected result:
> http://localhost:18080/odata4/svc/my_nutri_diary/Account(idProfile=1)
> actual result:
> <a:entry>
> <a:id>
> http://localhost:18080/odata4/svc/my_nutri_diary/Account(idProfile=1,idPr...
> </a:id>
> Table definition is given as:
> CREATE FOREIGN TABLE Account (
> idProfile long NOT NULL AUTO_INCREMENT OPTIONS(NAMEINSOURCE '"idProfile"', NATIVE_TYPE 'BIGINT'),
> uuidUser string(36) NOT NULL OPTIONS(NAMEINSOURCE '"uuidUser"', NATIVE_TYPE 'CHAR'),
> CONSTRAINT "PRIMARY" PRIMARY KEY(idProfile),
> CONSTRAINT uuidUser_UNIQUE UNIQUE(uuidUser)
> ) OPTIONS(NAMEINSOURCE '"Account"', UPDATABLE 'TRUE', CARDINALITY '2');
> I have used the github sources from yesterday.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
5 years, 3 months