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 3CDD926192 for ; Thu, 14 Jun 2018 12:12:46 -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 teKKl_j-EXJn for ; Thu, 14 Jun 2018 12:12:46 -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 EF27820341 for ; Thu, 14 Jun 2018 12:12:45 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v2 06/11] sql: refactor sql_expr_compile to return AST References: <74d9d3a2f3198fc4821395b91bb7b637b35af5d3.1528535873.git.kshcherbatov@tarantool.org> <01231fae-68d6-f6c3-5ead-8df59efae4cf@tarantool.org> From: Kirill Shcherbatov Message-ID: Date: Thu, 14 Jun 2018 19:12:44 +0300 MIME-Version: 1.0 In-Reply-To: <01231fae-68d6-f6c3-5ead-8df59efae4cf@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: "v.shpilevoy@tarantool.org" > Why not just diag_set(ClientError, ER_SQL, sql_error); ? + char *sql_error; + if (sqlite3RunParser(&parser, stmt, &sql_error) != SQLITE_OK && + parser.rc != SQL_TARANTOOL_ERROR) + diag_set(ClientError, ER_SQL, sql_error); + else + expression = parser.parsed_expr;