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 C23322E140 for ; Wed, 15 May 2019 13:34:33 -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 tQaED79vO6bm for ; Wed, 15 May 2019 13:34:33 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 806FD2A0EE for ; Wed, 15 May 2019 13:34:33 -0400 (EDT) From: Kirill Shcherbatov Subject: [tarantool-patches] [PATCH v1 1/3] sql: get rid of SQL_NullCallback flag Date: Wed, 15 May 2019 20:34:28 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, korablev@tarantool.org Cc: Kirill Shcherbatov The SQL_NullCallback flag is never set now so it redundant. Let's get red if it because we are going to pass user_session->sql_flags to parser and use it instead of session instance. Needed for #3691 --- src/box/sql/legacy.c | 6 +----- src/box/sql/sqlInt.h | 2 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/box/sql/legacy.c b/src/box/sql/legacy.c index ee680efe2..a57677e89 100644 --- a/src/box/sql/legacy.c +++ b/src/box/sql/legacy.c @@ -63,7 +63,6 @@ sql_exec(sql * db, /* The database on which the SQL executes */ sql_stmt *pStmt = 0; /* The current SQL statement */ char **azCols = 0; /* Names of result columns */ int callbackIsInit; /* True if callback data is initialized */ - struct session *user_session = current_session(); if (!sqlSafetyCheckOk(db)) return SQL_MISUSE; @@ -94,10 +93,7 @@ sql_exec(sql * db, /* The database on which the SQL executes */ int i; rc = sql_step(pStmt); /* Invoke the callback function if required */ - if (xCallback && (SQL_ROW == rc || - (SQL_DONE == rc && !callbackIsInit - && user_session-> - sql_flags & SQL_NullCallback))) { + if (xCallback != NULL && rc == SQL_ROW) { if (!callbackIsInit) { azCols = sqlDbMallocZero(db, diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h index 997a46535..d2be6701f 100644 --- a/src/box/sql/sqlInt.h +++ b/src/box/sql/sqlInt.h @@ -1498,8 +1498,6 @@ struct sql { #define SQL_CountRows 0x00000080 /* Count rows changed by INSERT, */ /* DELETE, or UPDATE and return */ /* the count using a callback. */ -#define SQL_NullCallback 0x00000100 /* Invoke the callback once if the */ - /* result set is empty */ #define SQL_SqlTrace 0x00000200 /* Debug print SQL as it executes */ #define SQL_SelectTrace 0x00000800 /* Debug info about select statement */ #define SQL_WhereTrace 0x00008000 /* Debug info about optimizer's work */ -- 2.21.0