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

Fix service crash caused by using function call as a part of the filter in LOOKUP #4111

Merged
merged 4 commits into from
Apr 2, 2022

Conversation

Aiee
Copy link
Contributor

@Aiee Aiee commented Apr 1, 2022

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

Close #4097

Description:

There is a bug in the constant folding of function call expressions like date('2022-03-25') when checking purity.

How do you solve it?

Fix purity checking by bonding purity to the number of arity of the function

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

@Aiee Aiee added ready-for-testing PR: ready for the CI test cherry-pick-v3.1 PR: need cherry-pick to this version labels Apr 1, 2022
@Aiee Aiee requested review from CPWstatic and jievince and removed request for CPWstatic April 1, 2022 17:11
Copy link
Contributor

@CPWstatic CPWstatic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

Copy link
Contributor

@yixinglu yixinglu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov-commenter
Copy link

Codecov Report

Merging #4111 (10815f1) into master (5d96c60) will decrease coverage by 0.06%.
The diff coverage is 66.44%.

@@            Coverage Diff             @@
##           master    #4111      +/-   ##
==========================================
- Coverage   85.10%   85.03%   -0.07%     
==========================================
  Files        1339     1324      -15     
  Lines      132245   131689     -556     
==========================================
- Hits       112544   111988     -556     
  Misses      19701    19701              
Impacted Files Coverage Δ
src/clients/meta/MetaClient.cpp 76.75% <ø> (+0.31%) ⬆️
src/clients/meta/MetaClient.h 92.30% <ø> (ø)
src/common/thread/test/GenericThreadPoolTest.cpp 53.42% <0.00%> (-30.14%) ⬇️
src/common/thread/test/GenericWorkerTest.cpp 54.16% <0.00%> (-44.45%) ⬇️
src/graph/executor/ExecutionError.h 0.00% <ø> (ø)
src/graph/executor/Executor.cpp 81.32% <ø> (+0.31%) ⬆️
src/graph/executor/Executor.h 100.00% <ø> (ø)
src/graph/executor/StorageAccessExecutor.cpp 100.00% <ø> (ø)
src/graph/executor/StorageAccessExecutor.h 57.77% <ø> (-2.23%) ⬇️
src/graph/executor/admin/AddHostsExecutor.cpp 91.66% <ø> (ø)
... and 273 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3bef944...10815f1. Read the comment docs.

@yixinglu yixinglu merged commit 82c70ea into vesoft-inc:master Apr 2, 2022
@Aiee Aiee deleted the fix-func-constant-folding branch April 2, 2022 05:53
Sophie-Xie pushed a commit that referenced this pull request Apr 3, 2022
…er in `LOOKUP` (#4111)

* Fix function call purity check

* Add UT for purity check

* Add TCK cases
CPWstatic added a commit that referenced this pull request Apr 3, 2022
* fix memory leak (#4103)

* Param MATCH vid seek fix (#4024)

* Add qctx to isEvaluableExpr for kRelIn

Fixing MATCH (n) WHERE id(n) IN [$t] RETURN n

* Fix eq kVal parameter vidseek

* Fix id(n) IN [$var] case

* lint add explicit and remove tailing semicolon

* clang-format-10

* double check type of rightListValue

Addressing Kyle's review comment

* ut added in features/yield/parameter.feature

* support kAttribute

match (n) where n in $list_var return n

* Add kSubscript for eq case

MATCH (v) WHERE id(v) == $p7.a.b.d[4] RETURN v

Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>
Co-authored-by: kyle.cao <kyle.cao@vesoft.com>
Co-authored-by: cpw <13495049+CPWstatic@users.noreply.github.com>

* disable console pkg (#4110)

* disable console pkg

* fix

* disable console pkg (#4112)

* Fix service crash caused by using function call as a part of the filter in `LOOKUP` (#4111)

* Fix function call purity check

* Add UT for purity check

* Add TCK cases

* Fix cmake command error (#4114)

Co-authored-by: yaphet <4414314+darionyaphet@users.noreply.github.com>
Co-authored-by: Wey Gu <weyl.gu@gmail.com>
Co-authored-by: kyle.cao <kyle.cao@vesoft.com>
Co-authored-by: cpw <13495049+CPWstatic@users.noreply.github.com>
Co-authored-by: Yichen Wang <18348405+Aiee@users.noreply.github.com>
Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-v3.1 PR: need cherry-pick to this version ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

where statement causes storage process to exit
5 participants