[tarantool-patches] [PATCH v1 2/3] sql: fix SQL Count for vinyl engine

Kirill Shcherbatov kshcherbatov at tarantool.org
Tue Jun 26 15:23:58 MSK 2018


As index_size does not match row count for vinyl engine,
it was replaced with index_count that working for
ITER_ALL in memtx same way.

Part of #2199.
---
 src/box/sql.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/box/sql.c b/src/box/sql.c
index 834a437..dc17438 100644
--- a/src/box/sql.c
+++ b/src/box/sql.c
@@ -355,7 +355,8 @@ int tarantoolSqlite3EphemeralCount(struct BtCursor *pCur, i64 *pnEntry)
 	assert(pCur->curFlags & BTCF_TEphemCursor);
 
 	struct index *primary_index = space_index(pCur->space, 0 /* PK */);
-	*pnEntry = index_size(primary_index);
+	*pnEntry = index_count(primary_index, pCur->iter_type, pCur->key,
+			       pCur->nKey);
 	return SQLITE_OK;
 }
 
@@ -363,7 +364,8 @@ int tarantoolSqlite3Count(BtCursor *pCur, i64 *pnEntry)
 {
 	assert(pCur->curFlags & BTCF_TaCursor);
 
-	*pnEntry = index_size(pCur->index);
+	*pnEntry = index_count(pCur->index, pCur->iter_type, pCur->key,
+			       pCur->nKey);
 	return SQLITE_OK;
 }
 
-- 
2.7.4





More information about the Tarantool-patches mailing list