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 typo in WALReplayer::replayRelTableRecord #1636

Merged
merged 1 commit into from
Jun 6, 2023
Merged

Fix typo in WALReplayer::replayRelTableRecord #1636

merged 1 commit into from
Jun 6, 2023

Conversation

gaurav8297
Copy link
Collaborator

@gaurav8297 gaurav8297 commented Jun 5, 2023

This won't lead to a bug because when we set WalRecord.relTableRecord to some value, then WalRecord.nodeTableRecord will also return the same value since they both store "int" at the same address due to union datatype (WalRecord). However, it's still incorrect from a code perspective.

For example:

struct TestUnion
{
    enum{CHAR, INT} tag;
    union
    {
        int a;
        int b;
    };
};

TEST {
    TestUnion t;
    t.tag = TestUnion::CHAR;
    t.a = 4;
    printf("%d", t.b); // returns 4 because same type as "a" and at that address 4 is stored.
}

This won't lead to a bug because when we set
WalRecord.relTableRecord to some value, then
WalRecord.nodeTableRecord will also return the
same value since they both store "int" at the same
address due to union datatype.
@codecov
Copy link

codecov bot commented Jun 5, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (cb437d7) 91.66% compared to head (b7eed75) 91.66%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1636   +/-   ##
=======================================
  Coverage   91.66%   91.66%           
=======================================
  Files         716      716           
  Lines       26042    26042           
=======================================
  Hits        23871    23871           
  Misses       2171     2171           
Impacted Files Coverage Δ
src/storage/wal_replayer.cpp 95.01% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@gaurav8297 gaurav8297 merged commit 57a97d7 into master Jun 6, 2023
8 checks passed
@gaurav8297 gaurav8297 deleted the fix_bug branch June 6, 2023 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants