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 calling virtual function in ctor #4022

Merged
merged 2 commits into from
Feb 14, 2022

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Feb 14, 2022

Signed-off-by: JaySon-Huang jayson.hjs@gmail.com

What problem does this PR solve?

Issue Number: close #4030

Problem Summary:

[2022-02-14T08:41:46.709Z] /build/tics/dbms/src/Storages/DeltaMerge/DMSegmentThreadInputStream.h:47:35: error: Call to virtual method 'DMSegmentThreadInputStream::getName' during construction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall,-warnings-as-errors]
[2022-02-14T08:41:46.709Z]         , log(getMPPTaskLog(log_, getName()))
[2022-02-14T08:41:46.709Z]                                   ^

What is changed and how it works?

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 14, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • SeaRise

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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 14, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 14, 2022
@JaySon-Huang
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@JaySon-Huang: 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: ce65f594662112c9fed46a78e5d390e22c5ddf98

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

sre-bot commented Feb 14, 2022

Coverage for changed files

Filename                                                Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DataStreams/ExpressionBlockInputStream.cpp                    9                 9     0.00%           4                 4     0.00%          23                23     0.00%           4                 4     0.00%
DataStreams/ExpressionBlockInputStream.h                      1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
DataStreams/FilterBlockInputStream.cpp                       75                75     0.00%           4                 4     0.00%         122               122     0.00%          56                56     0.00%
DataStreams/FilterBlockInputStream.h                          1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
DataStreams/LimitBlockInputStream.cpp                        24                24     0.00%           2                 2     0.00%          39                39     0.00%          16                16     0.00%
DataStreams/LimitBlockInputStream.h                           2                 2     0.00%           2                 2     0.00%           2                 2     0.00%           0                 0         -
DataStreams/MergeSortingBlockInputStream.cpp                117               117     0.00%           9                 9     0.00%         168               168     0.00%          76                76     0.00%
DataStreams/MergeSortingBlockInputStream.h                   11                11     0.00%          11                11     0.00%          11                11     0.00%           0                 0         -
DataStreams/ParallelAggregatingBlockInputStream.cpp          91                91     0.00%          12                12     0.00%         147               147     0.00%          62                62     0.00%
DataStreams/ParallelAggregatingBlockInputStream.h             5                 5     0.00%           5                 5     0.00%          11                11     0.00%           0                 0         -
DataStreams/SharedQueryBlockInputStream.h                    48                48     0.00%           9                 9     0.00%          84                84     0.00%          28                28     0.00%
DataStreams/SquashingBlockInputStream.cpp                    11                 0   100.00%           2                 0   100.00%          16                 0   100.00%           6                 0   100.00%
DataStreams/SquashingBlockInputStream.h                       2                 0   100.00%           2                 0   100.00%           2                 0   100.00%           0                 0         -
DataStreams/UnionBlockInputStream.h                          92                92     0.00%          23                23     0.00%         124               124     0.00%          46                46     0.00%
Storages/DeltaMerge/DMSegmentThreadInputStream.h             58                 6    89.66%           5                 0   100.00%          58                 2    96.55%          24                 8    66.67%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                       547               482    11.88%          92                83     9.78%         809               735     9.15%         318               296     6.92%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16408      9528             41.93%    180901  96506        46.65%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Feb 14, 2022
@JaySon-Huang
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@JaySon-Huang: 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: 7de8f87ab7c98dc2e63cde26e223b8772f212d7b

@ti-chi-bot ti-chi-bot added status/can-merge Indicates a PR has been approved by a committer. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed status/can-merge Indicates a PR has been approved by a committer. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 14, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Feb 14, 2022

Coverage for changed files

Filename                                                Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DataStreams/ExpressionBlockInputStream.cpp                    9                 9     0.00%           4                 4     0.00%          23                23     0.00%           4                 4     0.00%
DataStreams/ExpressionBlockInputStream.h                      1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
DataStreams/FilterBlockInputStream.cpp                       75                75     0.00%           4                 4     0.00%         122               122     0.00%          56                56     0.00%
DataStreams/FilterBlockInputStream.h                          1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
DataStreams/LimitBlockInputStream.cpp                        24                24     0.00%           2                 2     0.00%          39                39     0.00%          16                16     0.00%
DataStreams/LimitBlockInputStream.h                           2                 2     0.00%           2                 2     0.00%           2                 2     0.00%           0                 0         -
DataStreams/MergeSortingBlockInputStream.cpp                113               113     0.00%           9                 9     0.00%         168               168     0.00%          76                76     0.00%
DataStreams/MergeSortingBlockInputStream.h                   11                11     0.00%          11                11     0.00%          11                11     0.00%           0                 0         -
DataStreams/ParallelAggregatingBlockInputStream.cpp          91                91     0.00%          12                12     0.00%         147               147     0.00%          62                62     0.00%
DataStreams/ParallelAggregatingBlockInputStream.h             5                 5     0.00%           5                 5     0.00%          11                11     0.00%           0                 0         -
DataStreams/SharedQueryBlockInputStream.h                    48                48     0.00%           9                 9     0.00%          84                84     0.00%          28                28     0.00%
DataStreams/SquashingBlockInputStream.cpp                    11                 0   100.00%           2                 0   100.00%          16                 0   100.00%           6                 0   100.00%
DataStreams/SquashingBlockInputStream.h                       2                 0   100.00%           2                 0   100.00%           2                 0   100.00%           0                 0         -
DataStreams/UnionBlockInputStream.h                          92                92     0.00%          23                23     0.00%         124               124     0.00%          46                46     0.00%
Storages/DeltaMerge/DMSegmentThreadInputStream.h             58                 6    89.66%           5                 0   100.00%          58                 2    96.55%          24                 8    66.67%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                       543               478    11.97%          92                83     9.78%         809               735     9.15%         318               296     6.92%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16408      9528             41.93%    180901  96520        46.64%

full coverage report (for internal network access only)

@JaySon-Huang JaySon-Huang added the type/bugfix This PR fixes a bug. label Feb 14, 2022
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@JaySon-Huang
Copy link
Contributor Author

cherry-pick to 5.4: #4029
cherry-pick to 5.3: #4031

@JaySon-Huang
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@JaySon-Huang: 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: 5dafba0

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

sre-bot commented Feb 14, 2022

Coverage for changed files

Filename                                                Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DataStreams/AggregatingBlockInputStream.h                     2                 2     0.00%           2                 2     0.00%           4                 4     0.00%           0                 0         -
DataStreams/ConcatBlockInputStream.h                         10                 0   100.00%           5                 0   100.00%          25                 0   100.00%           4                 0   100.00%
DataStreams/ExpressionBlockInputStream.cpp                    9                 9     0.00%           4                 4     0.00%          23                23     0.00%           4                 4     0.00%
DataStreams/ExpressionBlockInputStream.h                      1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
DataStreams/FilterBlockInputStream.cpp                       75                75     0.00%           4                 4     0.00%         122               122     0.00%          56                56     0.00%
DataStreams/FilterBlockInputStream.h                          1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
DataStreams/HashJoinBuildBlockInputStream.h                   3                 3     0.00%           3                 3     0.00%           6                 6     0.00%           0                 0         -
DataStreams/LimitBlockInputStream.cpp                        24                24     0.00%           2                 2     0.00%          39                39     0.00%          16                16     0.00%
DataStreams/LimitBlockInputStream.h                           2                 2     0.00%           2                 2     0.00%           2                 2     0.00%           0                 0         -
DataStreams/MergeSortingBlockInputStream.cpp                113               113     0.00%           9                 9     0.00%         168               168     0.00%          76                76     0.00%
DataStreams/MergeSortingBlockInputStream.h                   11                11     0.00%          11                11     0.00%          11                11     0.00%           0                 0         -
DataStreams/ParallelAggregatingBlockInputStream.cpp          91                91     0.00%          12                12     0.00%         147               147     0.00%          62                62     0.00%
DataStreams/ParallelAggregatingBlockInputStream.h             5                 5     0.00%           5                 5     0.00%          11                11     0.00%           0                 0         -
DataStreams/PartialSortingBlockInputStream.h                  6                 6     0.00%           6                 6     0.00%           8                 8     0.00%           0                 0         -
DataStreams/SharedQueryBlockInputStream.h                    48                48     0.00%           9                 9     0.00%          84                84     0.00%          28                28     0.00%
DataStreams/SquashingBlockInputStream.cpp                    11                 0   100.00%           2                 0   100.00%          16                 0   100.00%           6                 0   100.00%
DataStreams/SquashingBlockInputStream.h                       2                 0   100.00%           2                 0   100.00%           2                 0   100.00%           0                 0         -
DataStreams/UnionBlockInputStream.h                          92                92     0.00%          23                23     0.00%         124               124     0.00%          46                46     0.00%
Storages/DeltaMerge/DMSegmentThreadInputStream.h             58                 6    89.66%           5                 0   100.00%          58                 2    96.55%          24                 8    66.67%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                       564               489    13.30%         108                94    12.96%         852               753    11.62%         322               296     8.07%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16408      9529             41.92%    180901  96527        46.64%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 6d05b3a into pingcap:master Feb 14, 2022
@JaySon-Huang JaySon-Huang deleted the fix_virtual_func_called branch February 14, 2022 12:43
JaySon-Huang added a commit that referenced this pull request Feb 21, 2022
* Fix calling virtual function in ctor

Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>

* Unify some calls in older changes

Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
JaySon-Huang added a commit that referenced this pull request Apr 21, 2022
* Fix calling virtual function in ctor

Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>

* Unify some calls in older changes

Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
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/L Denotes a PR that changes 100-499 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. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling virtual function in ctor
4 participants