From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (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 D172446970E for ; Mon, 30 Dec 2019 17:16:47 +0300 (MSK) Date: Mon, 30 Dec 2019 17:16:47 +0300 From: Sergey Ostanevich Message-ID: <20191230141647.GG1222@tarantool.org> References: <3adc7a07e098182738681e15000a2f5ce6f700ed.1576844632.git.korablev@tarantool.org> <20191225204139.GA53@tarantool.org> <20191230095808.GB29923@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191230095808.GB29923@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v3 19/20] netbox: introduce prepared statements 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! Thanks, LGTM. Sergos On 30 Dec 11:58, Nikita Pettik wrote: > On 25 Dec 23:41, Sergey Ostanevich wrote: > > Hi! > > > > Thanks for the patch, one nit and one question. > > > > Regards, > > Sergos > > > > > > > > On 20 Dec 15:47, Nikita Pettik wrote: > > > @@ -1738,12 +1781,15 @@ tx_process_sql(struct cmsg *m) > > > port_destroy(&port); > > > goto error; > > > } > > > - if (port_dump_msgpack(&port, out) != 0) { > > > + /* Nothing to dump in case of UNPREPARE request. */ > > > + if (! is_unprepare) { > > > > Unary ops - no spaces. > > Ok, fixed. > > > > + if (port_dump_msgpack(&port, out) != 0) { > > > + port_destroy(&port); > > > + obuf_rollback_to_svp(out, &header_svp); > > > + goto error; > > > + } > > > port_destroy(&port); > > > - obuf_rollback_to_svp(out, &header_svp); > > > - goto error; > > > } > > > - port_destroy(&port); > > > iproto_reply_sql(out, &header_svp, msg->header.sync, schema_version); > > > iproto_wpos_create(&msg->wpos, out); > > > return; > > > diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua > > > index c2e1bb9c4..b4811edfa 100644 > > > --- a/src/box/lua/net_box.lua > > > +++ b/src/box/lua/net_box.lua > > > @@ -104,6 +104,8 @@ local method_encoder = { > > > upsert = internal.encode_upsert, > > > select = internal.encode_select, > > > execute = internal.encode_execute, > > > + prepare = internal.encode_prepare, > > > + unprepare = internal.encode_prepare, > > > get = internal.encode_select, > > > min = internal.encode_select, > > > max = internal.encode_select, > > > @@ -128,6 +130,8 @@ local method_decoder = { > > > upsert = decode_nil, > > > select = internal.decode_select, > > > execute = internal.decode_execute, > > > + prepare = internal.decode_prepare, > > > + unprepare = decode_nil, > > No. Result of prepare contains metadata (like names, types etc), > meanwhile result of unprepare contains only response status, > so there's nothing to decode. > > > should it be internal.decode_prepare? > > > > > get = decode_get, > > > min = decode_get, > > > max = decode_get,