We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0d12dd commit ca47ec7Copy full SHA for ca47ec7
store/postgres/src/relational_queries.rs
@@ -2091,7 +2091,14 @@ impl<'a> QueryFragment<Pg> for FindRangeQuery<'a> {
2091
}
2092
2093
2094
- out.push_sql("\norder by block_number, entity, id");
+
2095
+ if first {
2096
+ // In case we have only immutable entities, the upper range will not create any
2097
+ // select statement. So here we have to generate an empty SQL statement.
2098
+ out.push_sql("select 1");
2099
+ } else {
2100
+ out.push_sql("\norder by block_number, entity, id");
2101
+ }
2102
2103
Ok(())
2104
0 commit comments