这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@rakeshkky
Copy link
Member

Description

The re-modeled check permissions for insert and update (see #3804, #3598) generates the INSERT and UPDATE SQL CTE statement by RETURNING * and an extra column which invokes the check permission exception on invalidation (see note [Mutation output expression] in the diff) . This causes the output rows from the mutation CTE to contain an extra column and cannot typecast to table row type for the computed field function's input. Hence the Postgres query is failing. This PR fixes the same.

Changelog

  • CHANGELOG.md is updated with user-facing content relevant to this PR.

Affected components

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System
  • Tests
  • Other (list it)

Related Issues

Fix #4035

Solution and Design

In the SQL statement which generates the mutation output, add a CTE which extracts only table columns in the order of their ordinal positions. This will ensure the input for computed field will be cast-able to table rowtype. See note [Mutation output expression] in Hasura.RQL.DML.Returning module.

Steps to test and verify

Reproduce the issue #4035, 'postgres query error' shouldn't happen.

Limitations, known bugs & workarounds

Server checklist

Catalog upgrade

Does this PR change Hasura Catalog version?

  • No
  • Yes

Metadata

Does this PR add a new Metadata feature?

  • No
  • Yes

GraphQL

  • No new GraphQL schema is generated
  • New GraphQL schema is being generated:

Breaking changes

  • No Breaking changes
  • There are breaking changes

@rakeshkky rakeshkky added the c/server Related to server label Mar 11, 2020
@rakeshkky rakeshkky self-assigned this Mar 11, 2020
@rakeshkky rakeshkky requested review from 0x777 and paf31 March 11, 2020 06:00
@hasura-bot
Copy link
Contributor

Review app for commit bb2b631 deployed to Heroku: https://hge-ci-pull-4080.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4080-bb2b631f

@marionschleifer
Copy link
Contributor

Changelog is fine.

@netlify
Copy link

netlify bot commented Mar 11, 2020

Deploy preview for hasura-docs ready!

Built with commit 8c2b5ad

https://deploy-preview-4080--hasura-docs.netlify.com

@hasura-bot
Copy link
Contributor

Review app for commit 8da7578 deployed to Heroku: https://hge-ci-pull-4080.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4080-8da7578f

@rakeshkky rakeshkky force-pushed the issue-4035-check-computed-field branch from 8da7578 to 8c2b5ad Compare March 11, 2020 10:41
@hasura-bot
Copy link
Contributor

Review app for commit 8c2b5ad deployed to Heroku: https://hge-ci-pull-4080.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4080-8c2b5ad9

@hasura-bot
Copy link
Contributor

Review app for commit 889f375 deployed to Heroku: https://hge-ci-pull-4080.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4080-889f375a

@tirumaraiselvan tirumaraiselvan added this to the v1.2.0 milestone Mar 13, 2020
@hasura-bot
Copy link
Contributor

Review app for commit 1142689 deployed to Heroku: https://hge-ci-pull-4080.herokuapp.com
Docker image for server: hasura/graphql-engine:pull4080-11426891

@0x777 0x777 merged commit 04e5a20 into hasura:master Mar 27, 2020
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-4080.herokuapp.com is deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/server Related to server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After upgrade from 1.1.0 to 1.2.0-beta.1 or 2, mutation fails with "Input has too many columns."

5 participants