Skip to content

Commit e3254ee

Browse files
committed
Fix infinite loop for metadata retrieval when composing HdtDatasources
1 parent 1af44a8 commit e3254ee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/datasources/CompositeDatasource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ CompositeDatasource.prototype._getDatasourceById = function(datasourceIndex) {
6060
CompositeDatasource.prototype._getDatasourceInfo = function(query, absoluteOffset, cb) {
6161
var self = this;
6262
var emptyQuery = {
63-
offset: 0, limit: 0,
63+
offset: 0, limit: 1,
6464
subject: query.subject, predicate: query.predicate, object: query.object
6565
};
6666
return findRecursive(0, absoluteOffset, -1, -1, 0, cb);

test/datasources/CompositeDatasource-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('CompositeDatasource', function () {
9191
itShouldExecute(getDatasource,
9292
'a query for an existing predicate',
9393
{ predicate: 'http://example.org/p1', limit: 10, features: { triplePattern: true, limit: true } },
94-
10, 220 + 110); // 220 is an inexact count from the HDT files, the 110 from the ttl file is exact.
94+
10, 112);
9595

9696
itShouldExecute(getDatasource,
9797
'a query for a non-existing predicate',

0 commit comments

Comments
 (0)