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 2532A25442 for ; Tue, 26 Feb 2019 09:48:26 -0500 (EST) 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 fRd4_Z0iYvNK for ; Tue, 26 Feb 2019 09:48:26 -0500 (EST) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 D635125434 for ; Tue, 26 Feb 2019 09:48:25 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: [tarantool-patches] Re: [PATCH v2 5/5] sql: remove field nErr of struct Parse From: "n.pettik" In-Reply-To: <4189982e3c44b8dcdd1fe3358c1b42f30fa6d6d2.1551114402.git.imeevma@gmail.com> Date: Tue, 26 Feb 2019 17:48:23 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <92EF85EB-D241-49D8-9AA6-7D9BD3160B04@tarantool.org> References: <4189982e3c44b8dcdd1fe3358c1b42f30fa6d6d2.1551114402.git.imeevma@gmail.com> 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: Imeev Mergen > diff --git a/src/box/sql/build.c b/src/box/sql/build.c > index 6afca4a..6621af4 100644 > --- a/src/box/sql/build.c > +++ b/src/box/sql/build.c > @@ -92,7 +92,6 @@ save_record(struct Parse *parser, uint32_t space_id, = int reg_key, > diag_set(OutOfMemory, sizeof(*record), "region_alloc", > "record"); > parser->rc =3D SQL_TARANTOOL_ERROR; > - parser->nErr++; > return; > } > record->space_id =3D space_id; > @@ -145,9 +144,11 @@ sql_finish_coding(struct Parse *parse_context) > "Exit with an error if CREATE statement = fails")); > } >=20 > - if (db->mallocFailed || parse_context->nErr !=3D 0) { > - if (parse_context->rc =3D=3D SQL_OK) > - parse_context->rc =3D SQL_ERROR; > + if (parse_context->rc =3D=3D SQL_TARANTOOL_ERROR) rc =3D=3D 0 / ! abort > + return; > + if (db->mallocFailed) { > + diag_set(ClientError, ER_SQL_PARSER_GENERIC, "Out of = memory=E2=80=9D); Why generic when it is OOM error? > + parse_context->rc =3D SQL_TARANTOOL_ERROR; rc =3D -1 / abort =3D true > return; > } > /* > @@ -189,13 +190,13 @@ sql_finish_coding(struct Parse *parse_context) > sqlVdbeGoto(v, 1); > } > /* Get the VDBE program ready for execution. */ > - if (parse_context->nErr =3D=3D 0 && !db->mallocFailed) { > + if (parse_context->rc !=3D SQL_TARANTOOL_ERROR && = !db->mallocFailed) { > assert(parse_context->iCacheLevel =3D=3D 0); > sqlVdbeMakeReady(v, parse_context); > parse_context->rc =3D SQL_DONE; > - } else { > - if (parse_context->rc !=3D SQL_TARANTOOL_ERROR) > - parse_context->rc =3D SQL_ERROR; > + } else if (parse_context->rc !=3D SQL_TARANTOOL_ERROR) { > + diag_set(ClientError, ER_SQL_PARSER_GENERIC, "Out of = memory"); > + parse_context->rc =3D SQL_TARANTOOL_ERROR; The same is here and in other places .