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

Prevent query when the keys are empty #54

Conversation

hungthai1401
Copy link
Contributor

@hungthai1401 hungthai1401 commented Jun 7, 2023

Dear @aarondfrancis ,

I have a query with the fast pagination that do the follow sql:

select count(*) as aggregate from `users`;
select `users`.`id` from `users` limit 2 offset 30;
select * from `users` where 0 = 1 limit 3 offset 0;

I think the last query of fast paginations is redundant because the keys from the second query result is empty.
Expected:

select count(*) as aggregate from `users`;
select `users`.`id` from `users` limit 2 offset 30;

I have created this PR to prevent it.

@aarondfrancis
Copy link
Contributor

Amazing, thank you so much!

@aarondfrancis aarondfrancis merged commit 273cda1 into hammerstonedev:main May 15, 2024
23 checks passed
@hungthai1401 hungthai1401 deleted the feature/query_in_not_exists_page_prevented branch May 16, 2024 03:05
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