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 embedded field detection #972

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

adriansmares
Copy link
Contributor

This PR fixes the situation in which an embed tag is combined with a set of scanonly fields.

This issue seems to be caused by 9052fc4 - see the review comments below.

cc @vmihailenco

@@ -207,7 +207,7 @@ func (t *Table) processFields(
}

subtable := newTable(t.dialect, fieldType, seen, canAddr)
for _, subfield := range subtable.Fields {
for _, subfield := range subtable.allFields {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Iterating over Fields skips the scanonly fields, so I suppose this should be allFields too.

It is also the case that on L177 we also iterate over subtable.allFields, so maybe this was some kind of copy paste error ?

@vmihailenco
Copy link
Member

@adriansmares thanks for fixing this with a test 👍

@vmihailenco vmihailenco merged commit 007f12f into uptrace:master Apr 2, 2024
4 checks passed
@adriansmares adriansmares deleted the fix/embeding branch April 2, 2024 14:45
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

2 participants