From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: tarantool-patches@freelists.org, Kirill Shcherbatov <kshcherbatov@tarantool.org> Subject: [tarantool-patches] Re: [PATCH v7 3/7] sql: introduce expr_len for sql_expr_compile Date: Thu, 24 May 2018 22:26:34 +0300 [thread overview] Message-ID: <14b9b088-c650-e233-167a-24e9f35dfa8c@tarantool.org> (raw) In-Reply-To: <074eb3156b959d1a5cc8534ec104b0bb6fc20034.1527084287.git.kshcherbatov@tarantool.org> Thanks for the patch! See 2 comments below. On 23/05/2018 17:05, Kirill Shcherbatov wrote: > As we need to use parser in the cases with not null-terminated > strings expr_len argument for sql_expr_compile is required. > > Part of #3272. > --- > src/box/alter.cc | 1 + > src/box/sql.h | 4 +++- > src/box/sql/tokenize.c | 7 ++++--- > 3 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/src/box/alter.cc b/src/box/alter.cc > index e87bbce..e4780da 100644 > --- a/src/box/alter.cc > +++ b/src/box/alter.cc > @@ -408,6 +408,7 @@ field_def_decode(struct field_def *field, const char **data, > > if (field->default_value != NULL && > sql_expr_compile(sql_get(), field->default_value, > + strlen(field->default_value), > &field->default_value_expr) != 0) > diag_raise(); > } > diff --git a/src/box/sql.h b/src/box/sql.h > index ff8ab6f..a7f2500 100644 > --- a/src/box/sql.h > +++ b/src/box/sql.h > @@ -74,12 +74,14 @@ struct Table; > * stuct Select and return it. > * @param db SQL context handle. > * @param expr Expression to parse. > + * @param expr_len Expression to parse length. 1. Looks like expr_len is the expression that is intended to parse a length. Do you mean this?: "Length of @an expr." > * @param[out] result Result: AST structure. > * > * @retval Error code if any. > */ > int > -sql_expr_compile(struct sqlite3 *db, const char *expr, struct Expr **result); > +sql_expr_compile(struct sqlite3 *db, const char *expr, int expr_len, > + struct Expr **result); 2. Bad indentation.
next prev parent reply other threads:[~2018-05-24 19:26 UTC|newest] Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-05-23 14:05 [tarantool-patches] [PATCH v7 0/7] sql: remove Checks to server Kirill Shcherbatov 2018-05-23 14:05 ` [tarantool-patches] [PATCH v7 1/7] sql: remove parser construct, destruct to sql.h Kirill Shcherbatov 2018-05-23 17:46 ` [tarantool-patches] " Konstantin Osipov 2018-05-24 19:26 ` Vladislav Shpilevoy 2018-05-25 12:05 ` Kirill Shcherbatov 2018-05-23 14:05 ` [tarantool-patches] [PATCH v7 2/7] box: introduce OPT_ARRAY opt_type to decode arrays Kirill Shcherbatov 2018-05-23 17:53 ` [tarantool-patches] " Konstantin Osipov 2018-05-24 7:32 ` Kirill Shcherbatov 2018-05-24 19:26 ` Vladislav Shpilevoy 2018-05-25 11:54 ` Kirill Shcherbatov 2018-05-23 14:05 ` [tarantool-patches] [PATCH v7 3/7] sql: introduce expr_len for sql_expr_compile Kirill Shcherbatov 2018-05-24 19:26 ` Vladislav Shpilevoy [this message] 2018-05-25 11:54 ` [tarantool-patches] " Kirill Shcherbatov 2018-05-23 14:05 ` [tarantool-patches] [PATCH v7 4/7] sql: rename sql_expr_free to sql_expr_delete Kirill Shcherbatov 2018-05-23 18:00 ` [tarantool-patches] " Konstantin Osipov 2018-05-24 19:26 ` Vladislav Shpilevoy 2018-05-25 11:54 ` Kirill Shcherbatov 2018-05-23 14:05 ` [tarantool-patches] [PATCH v7 5/7] sql: change sqlite3AddCheckConstraint signature Kirill Shcherbatov 2018-05-23 18:01 ` [tarantool-patches] " Konstantin Osipov 2018-05-24 19:26 ` Vladislav Shpilevoy 2018-05-25 11:53 ` Kirill Shcherbatov 2018-05-29 11:51 ` n.pettik 2018-05-30 8:32 ` Kirill Shcherbatov 2018-05-23 14:05 ` [tarantool-patches] [PATCH v7 6/7] sql: export funcs defined on Expr, ExprList to sql.h Kirill Shcherbatov 2018-05-23 18:15 ` [tarantool-patches] " Konstantin Osipov 2018-05-24 7:33 ` Kirill Shcherbatov 2018-05-24 19:26 ` Vladislav Shpilevoy 2018-05-25 11:53 ` Kirill Shcherbatov 2018-05-28 11:19 ` Vladislav Shpilevoy 2018-05-28 14:59 ` Kirill Shcherbatov 2018-05-23 14:05 ` [tarantool-patches] [PATCH v7 7/7] sql: remove Checks to server Kirill Shcherbatov 2018-05-24 19:26 ` [tarantool-patches] " Vladislav Shpilevoy 2018-05-25 11:53 ` Kirill Shcherbatov 2018-05-28 11:19 ` Vladislav Shpilevoy 2018-05-28 14:59 ` Kirill Shcherbatov 2018-05-28 18:50 ` Vladislav Shpilevoy 2018-05-29 11:49 ` n.pettik 2018-05-30 8:32 ` Kirill Shcherbatov 2018-05-30 10:42 ` n.pettik 2018-05-25 12:04 ` [tarantool-patches] Re: [PATCH v7 0/7] " Kirill Shcherbatov 2018-05-28 11:19 ` Vladislav Shpilevoy 2018-05-30 11:03 ` n.pettik 2018-05-31 17:44 ` Kirill Yukhin
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=14b9b088-c650-e233-167a-24e9f35dfa8c@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=kshcherbatov@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH v7 3/7] sql: introduce expr_len for sql_expr_compile' \ /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