From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 68C68263C7 for ; Thu, 28 Jun 2018 12:19:12 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KsZ0LbFdPb7y for ; Thu, 28 Jun 2018 12:19:12 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 23F80263B7 for ; Thu, 28 Jun 2018 12:19:12 -0400 (EDT) From: Kirill Shcherbatov Subject: [tarantool-patches] [PATCH v2 2/3] sql: fix SQL Count for vinyl engine Date: Thu, 28 Jun 2018 19:19:05 +0300 Message-Id: <6267859aa2ea6476eeea218408cea5e6fe1ed72d.1530202680.git.kshcherbatov@tarantool.org> In-Reply-To: References: In-Reply-To: References: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: korablev@tarantool.org, Kirill Shcherbatov 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