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

add ut for ifnull #4086

Merged
merged 7 commits into from
Feb 21, 2022
Merged

add ut for ifnull #4086

merged 7 commits into from
Feb 21, 2022

Conversation

windtalker
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #3604

Problem Summary:

What is changed and how it works?

  1. add ut for ifNull
  2. fix some bugs found by ut
  3. support more powerful decimal parse in parseDecimal

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 21, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • LittleFall

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 21, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 21, 2022
@LittleFall
Copy link
Contributor

build failed on tidy

(https://ci.pingcap.net/blue/organizations/jenkins/tics_ghpr_build/detail/tics_ghpr_build/9264/pipeline#step-64-log-455)[2022-02-21T09:26:07.610Z] clang-tidy -p=/build/tics/release-centos7-llvm/build-release /build/tics/dbms/src/DataTypes/getLeastSupertype.cpp

[2022-02-21T09:26:25.680Z] clang-tidy -p=/build/tics/release-centos7-llvm/build-release /build/tics/dbms/src/Functions/FunctionsConditional.cpp

[2022-02-21T09:26:25.680Z] /build/tics/dbms/src/Functions/FunctionsConditional.cpp:234:10: error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]

[2022-02-21T09:26:25.680Z]     if (!args.size())

[2022-02-21T09:26:25.680Z]         ~^~~~~~~~~~~

[2022-02-21T09:26:25.680Z]         args.empty()

[2022-02-21T09:26:25.680Z] /usr/local/bin/../include/c++/v1/vector:685:10: note: method 'vector'::empty() defined here

[2022-02-21T09:26:25.680Z]     bool empty() const _NOEXCEPT

[2022-02-21T09:26:25.680Z]          ^

[2022-02-21T09:26:25.680Z] /build/tics/dbms/src/Functions/FunctionsConditional.cpp:266:10: error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors]

[2022-02-21T09:26:25.680Z]     if (!args.size())

[2022-02-21T09:26:25.680Z]         ~^~~~~~~~~~~

[2022-02-21T09:26:25.680Z]         args.empty()

[2022-02-21T09:26:25.680Z] /usr/local/bin/../include/c++/v1/vector:685:10: note: method 'vector'::empty() defined here

[2022-02-21T09:26:25.680Z]     bool empty() const _NOEXCEPT

[2022-02-21T09:26:25.680Z]          ^

[2022-02-21T09:26:40.538Z] clang-tidy -p=/build/tics/release-centos7-llvm/build-release /build/tics/dbms/src/Functions/FunctionsNull.cpp

[2022-02-21T09:28:16.994Z] clang-tidy -p=/build/tics/release-centos7-llvm/build-release /build/tics/dbms/src/Flash/Coprocessor/DAGExpressionAnalyzerHelper.cpp

[2022-02-21T09:28:16.994Z] /build/tics/dbms/src/Flash/Coprocessor/DAGExpressionAnalyzerHelper.cpp:174:5: error: 'auto collator' can be declared as 'const auto *collator' [readability-qualified-auto,-warnings-as-errors]

[2022-02-21T09:28:16.994Z]     auto collator = getCollatorFromExpr(expr);

[2022-02-21T09:28:16.994Z]     ^~~~~

[2022-02-21T09:28:16.994Z]     const auto *

[2022-02-21T09:28:16.994Z] 40734 warnings generated.

[2022-02-21T09:28:16.994Z] Suppressed 40753 warnings (40734 in non-user code, 19 NOLINT).

[2022-02-21T09:28:16.994Z] Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[2022-02-21T09:28:16.994Z] 42572 warnings generated.

[2022-02-21T09:28:16.994Z] Suppressed 42595 warnings (42570 in non-user code, 25 NOLINT).

[2022-02-21T09:28:16.994Z] Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[2022-02-21T09:28:16.994Z] 2 warnings treated as errors

[2022-02-21T09:28:16.994Z] 41914 warnings generated.

[2022-02-21T09:28:16.994Z] Suppressed 41939 warnings (41914 in non-user code, 25 NOLINT).

[2022-02-21T09:28:16.994Z] Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[2022-02-21T09:28:16.994Z] 63953 warnings generated.

[2022-02-21T09:28:16.994Z] Suppressed 63981 warnings (63952 in non-user code, 29 NOLINT).

[2022-02-21T09:28:16.994Z] Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

[2022-02-21T09:28:16.994Z] 1 warning treated as error

Signed-off-by: xufei <[email protected]>
Signed-off-by: xufei <[email protected]>
@windtalker
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@windtalker: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: c0373b3

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 21, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Feb 21, 2022

Coverage for changed files

Filename                                              Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Common/MyDuration.h                                        33                 7    78.79%           4                 1    75.00%          22                 7    68.18%          24                10    58.33%
DataTypes/getLeastSupertype.cpp                           234                14    94.02%           3                 0   100.00%         326                29    91.10%         182                16    91.21%
Flash/Coprocessor/DAGExpressionAnalyzerHelper.cpp          85                85     0.00%          12                12     0.00%         222               222     0.00%          62                62     0.00%
Functions/FunctionsConditional.cpp                         99                36    63.64%          14                 6    57.14%         244                91    62.70%          64                29    54.69%
Functions/FunctionsNull.cpp                                94                39    58.51%          29                18    37.93%         234                99    57.69%          50                19    62.00%
Functions/tests/gtest_ifnull.cpp                          429               141    67.13%           9                 0   100.00%         446                10    97.76%         174                73    58.05%
TestUtils/FunctionTestUtils.cpp                            63                 9    85.71%           9                 0   100.00%          81                 9    88.89%          28                 9    67.86%
TestUtils/FunctionTestUtils.h                             113                 9    92.04%          33                 0   100.00%         263                 7    97.34%          48                 6    87.50%
TestUtils/tests/gtest_function_test_utils.cpp            2055               378    81.61%           2                 0   100.00%         169                 0   100.00%         600               302    49.67%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                    3205               718    77.60%         115                37    67.83%        2007               474    76.38%        1232               526    57.31%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16581      9495             42.74%    183515  95902        47.74%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit a197f59 into pingcap:master Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add unit test for Conditional function ifnull
4 participants