[Tarantool-patches] [PATCH 5/6] sql: extend result set with autoincrement

Nikita Pettik korablev at tarantool.org
Tue Dec 24 03:47:41 MSK 2019


On 18 Dec 18:17, Sergey Ostanevich wrote:
> 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.

I try to avoid mixing functional changes and pure refactoring -
it simplifies review and makes git history way cleaner.
In this case, I consider renaming j to something more meaningful
to be a pure refactoring.
 
> > +				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