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 21BF721A4D for ; Tue, 26 Jun 2018 08:24:03 -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 vmrL-zjzbO2e for ; Tue, 26 Jun 2018 08:24:03 -0400 (EDT) Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (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 D4C9521A39 for ; Tue, 26 Jun 2018 08:24:02 -0400 (EDT) From: Kirill Shcherbatov Subject: [tarantool-patches] [PATCH v1 2/3] sql: fix SQL Count for vinyl engine Date: Tue, 26 Jun 2018 15:23:58 +0300 Message-Id: <3bebf8a282a1fe23dbc282975458fa93db128bbd.1530015463.git.kshcherbatov@tarantool.org> 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: v.shpilevoy@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