New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using Yugabyte with Hasura, update mutation causes "Missing base table ybctid in index write request" #3805
Comments
@vnovick Just based on the schemas and query above I was not able to replicate the issue locally. |
Yeah I do:
|
Thanks for reporting @vnovick . We are able to reproduce it on our end.
|
Root cause was using update with returning for a table that has indexes (or foreign keys). Simpler way to replicate:
|
… with RETURNING clause Summary: Returning clause processing was being called to early modifying the tuple slot before indexes or foreign key checks (after row triggers) were called. The issue only comes up when using non-immutable (stable or volatile) functions in the SET clause which will need to be evaluated during execution (such as 'NOW()') Test Plan: Updated TestPgRegressFeature (yb_feature_update.sql) In `ysqlsh`: ``` CREATE TABLE test ( id SERIAL PRIMARY KEY, a TEXT UNIQUE, b timestamp with time zone ); INSERT INTO test (a,b) values ('foo', NOW()); UPDATE test SET b = NOW() where id = 1 RETURNING *; ``` Reviewers: neha, neil Reviewed By: neil Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D8089
Fixed by f8ca1c2. |
Using Yugabyte 2.1.0.0 version and running Hasura on top of it to generate GraphQL, there is a problem with GraphQL update mutations.
For example:
I have two tables:
When executing the following mutation:
Hasura compiles mutation to SQL query:
This results in the following error:
The text was updated successfully, but these errors were encountered: