[tarantool-patches] Re: [PATCH v1 1/4] box: move db->pShchema init to sql_init
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Thu May 31 20:36:50 MSK 2018
Thanks for the patch!
On 31/05/2018 14:22, Kirill Shcherbatov wrote:
> As we are going to call parser on box.cfg() to recreate triggers
> from SQL, we should initialize Schema as it used in sqlite3BeginTrigger.
>
> Part of #3273.
> ---
> src/box/sql.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/box/sql.c b/src/box/sql.c
> index 7379cb4..47d1739 100644
> --- a/src/box/sql.c
> +++ b/src/box/sql.c
> @@ -77,11 +77,18 @@ sql_init()
> panic("failed to initialize SQL subsystem");
>
> assert(db != NULL);
> + /* Initialize pSchema to use SQL parser. */
To use for what? Before what? I see it in the commit message, but lets
explain this in the comment as well.
> + db->pSchema = sqlite3SchemaCreate(db);
> + if (db->pSchema == NULL) {
> + sqlite3_close(db);
> + panic("failed to initialize SQL Schema subsystem");
> + }
> }
>
More information about the Tarantool-patches
mailing list