From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org, korablev@tarantool.org
Cc: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [tarantool-patches] [PATCH v1 1/3] sql: get rid of SQL_NullCallback flag
Date: Wed, 15 May 2019 20:34:28 +0300 [thread overview]
Message-ID: <f2bd63ab2c358f9f1ba98332bb6ecf028d6ea0d8.1557941573.git.kshcherbatov@tarantool.org> (raw)
In-Reply-To: <cover.1557941573.git.kshcherbatov@tarantool.org>
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
next prev parent reply other threads:[~2019-05-15 17:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-15 17:34 [tarantool-patches] [PATCH v1 0/3] box: local sql_flags for parser and vdbe Kirill Shcherbatov
2019-05-15 17:34 ` Kirill Shcherbatov [this message]
2019-05-16 23:08 ` [tarantool-patches] Re: [PATCH v1 1/3] sql: get rid of SQL_NullCallback flag n.pettik
2019-05-15 17:34 ` [tarantool-patches] [PATCH v1 2/3] sql: ban sql functions coinciding with builtins Kirill Shcherbatov
2019-05-16 23:12 ` [tarantool-patches] " n.pettik
2019-05-17 8:22 ` Kirill Shcherbatov
2019-05-17 15:20 ` n.pettik
2019-05-17 8:22 ` Kirill Shcherbatov
2019-05-15 17:34 ` [tarantool-patches] [PATCH v1 3/3] box: local sql_flags for parser and vdbe Kirill Shcherbatov
2019-05-15 18:54 ` [tarantool-patches] " Kirill Shcherbatov
2019-05-16 23:08 ` n.pettik
2019-05-17 8:22 ` Kirill Shcherbatov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f2bd63ab2c358f9f1ba98332bb6ecf028d6ea0d8.1557941573.git.kshcherbatov@tarantool.org \
--to=kshcherbatov@tarantool.org \
--cc=korablev@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='Re: [tarantool-patches] [PATCH v1 1/3] sql: get rid of SQL_NullCallback flag' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox