[Tarantool-patches] [PATCH 5/6] sql: extend result set with autoincrement
Sergey Ostanevich
sergos at tarantool.org
Wed Dec 18 18:17:45 MSK 2019
Hi!
Thanks for the patch, the latest version in branch LGTM.
Just one nit regarding readability below - not relevant to the patch
itself.
regards,
Sergos
> diff --git a/src/box/sql/select.c b/src/box/sql/select.c
> index b772bcead..f40178194 100644
> --- a/src/box/sql/select.c
> +++ b/src/box/sql/select.c
> @@ -1841,6 +1841,12 @@ generate_column_metadata(struct Parse *pParse, struct SrcList *pTabList,
> if (p->op == TK_COLUMN)
> vdbe_set_metadata_col_nullability(v, i,
> is_nullable);
> + if (pTabList->a[j].space->sequence != NULL) {
The 'j' variable is a liveout from a loop that searches for the table
the expression in progress refers to. Renaming it to something like
'current_table' would save some time during review and further
development.
> + int afno =
> + pTabList->a[j].space->sequence_fieldno;
> + if (afno == iCol)
> + vdbe_set_metadata_col_autoincrement(v, i);
> + }
> } else {
> const char *z = pEList->a[i].zSpan;
> if (z == NULL)
More information about the Tarantool-patches
mailing list