Skip to content
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

Current testing technique does not catch some cases when the return value is not valid for given type #5738

Open
4 of 5 tasks
findepi opened this issue Oct 29, 2020 · 2 comments
Labels
bug Something isn't working test

Comments

@findepi
Copy link
Member

findepi commented Oct 29, 2020

io.prestosql.sql.query.QueryAssertions#expression(java.lang.String) + matches can pass eveb when value is not correct for given type: eg not properly truncated (char with trailing spaces), or not properly rounded (timestamp with not max precision).

See #5736 (comment) for example.

Implementation plan:

Add checks within (explicitly or implicitly) io.prestosql.spi.type.Type#getObjectValue implementations:

@findepi
Copy link
Member Author

findepi commented Nov 3, 2020

I updated the description with the checklist. @prestosql/maintainers please update if any more checks we should add come to your mind.

@findepi
Copy link
Member Author

findepi commented Oct 20, 2021

We still need to add checks for decimal.
So far @ksobolew added a check flagging "negative zero", but we also need precision/scale checks.

cc @ksobolew @lukasz-stec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test
Development

No branches or pull requests

1 participant