diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/executor/FetchFromDistributedMetadataStep.java b/core/src/main/java/com/orientechnologies/orient/core/sql/executor/FetchFromDistributedMetadataStep.java index 58a659fa1d0..79b19609e88 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/executor/FetchFromDistributedMetadataStep.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/executor/FetchFromDistributedMetadataStep.java @@ -23,7 +23,7 @@ public FetchFromDistributedMetadataStep(OCommandContext ctx, boolean profilingEn @Override public OResultSet syncPull(OCommandContext ctx, int nRecords) throws OTimeoutException { - if (resultSet != null) { + if (resultSet == null) { getPrev().ifPresent(x -> x.syncPull(ctx, nRecords)); resultSet = new OProduceOneResult(() -> produce(ctx), true); }