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

Added conditions to the subqueries that use union #1116

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

Eisei24
Copy link
Contributor

@Eisei24 Eisei24 commented Nov 11, 2024

The blocksDs and scheduledDs subqueries now also directly apply the limitations from pagination and limit with ordering.

Comment on lines +269 to +272
goqu.L("NULL::INTEGER").As("exec_block_number"),
goqu.L("NULL::TEXT").As("graffiti_text"),
goqu.L("NULL::BYTEA").As("fee_recipient"),
goqu.L("NULL::NUMERIC").As("el_reward"),
Copy link
Contributor Author

@Eisei24 Eisei24 Nov 11, 2024

Choose a reason for hiding this comment

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

This got quite complicated here.
As soon as scheduledDs gets a LIMIT added to it the Union goqu method determines that it now needs to wrap itself, meaning SELECT ... => SELECT * FROM ( SELECT ... LIMIT ...) AS t1
As a result of that it could no longer correctly identify the types of our NULL values.
The only solution I found is adding such casts.
Goqu also doesn't allow a Cast(...) method on a V(...) object.

@peterbitfly peterbitfly merged commit feb4f66 into staging Nov 12, 2024
2 checks passed
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.

2 participants