From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp21.mail.ru (smtp21.mail.ru [94.100.179.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id DD7A746970E for ; Wed, 25 Dec 2019 17:36:02 +0300 (MSK) Date: Wed, 25 Dec 2019 17:36:01 +0300 From: Sergey Ostanevich Message-ID: <20191225143601.GP19594@tarantool.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH v3 15/20] sql: introduce sql_stmt_query_str() method List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org Hi! Tahnks for the patch, LGTM. Sergos On 20 Dec 15:47, Nikita Pettik wrote: > It is getter to fetch string of SQL query from prepared statement. > > Needed for #2592 > --- > src/box/execute.h | 6 ++++++ > src/box/sql/vdbeapi.c | 7 +++++++ > 2 files changed, 13 insertions(+) > > diff --git a/src/box/execute.h b/src/box/execute.h > index 2dd4fca03..f3d6c38b3 100644 > --- a/src/box/execute.h > +++ b/src/box/execute.h > @@ -121,6 +121,12 @@ sql_stmt_finalize(struct sql_stmt *stmt); > size_t > sql_stmt_est_size(const struct sql_stmt *stmt); > > +/** > + * Return string of SQL query. > + */ > +const char * > +sql_stmt_query_str(const struct sql_stmt *stmt); > + > /** > * Prepare (compile into VDBE byte-code) statement. > * > diff --git a/src/box/sql/vdbeapi.c b/src/box/sql/vdbeapi.c > index 2ac174112..7278d2ab3 100644 > --- a/src/box/sql/vdbeapi.c > +++ b/src/box/sql/vdbeapi.c > @@ -858,6 +858,13 @@ sql_stmt_est_size(const struct sql_stmt *stmt) > return size; > } > > +const char * > +sql_stmt_query_str(const struct sql_stmt *stmt) > +{ > + const struct Vdbe *v = (const struct Vdbe *) stmt; > + return v->zSql; > +} > + > /******************************* sql_bind_ ************************** > * > * Routines used to attach values to wildcards in a compiled SQL statement. > -- > 2.15.1 >