[Tarantool-patches] [PATCH v5 04/52] sql: remove NULL-termination in OP_ResultRow

Mergen Imeev imeevma at tarantool.org
Thu Apr 15 01:37:07 MSK 2021


Thank you for the review. My answer below.

On Thu, Apr 15, 2021 at 12:23:07AM +0200, Vladislav Shpilevoy wrote:
> Thanks for the patch!
> 
> > diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
> > index 4c1cd582b..18806b93f 100644
> > --- a/src/box/sql/vdbe.c
> > +++ b/src/box/sql/vdbe.c
> > @@ -1516,20 +1513,14 @@ case OP_ResultRow: {
> >  	/* Invalidate all ephemeral cursor row caches */
> >  	p->cacheCtr = (p->cacheCtr + 2)|1;
> >  
> > -	/* Make sure the results of the current row are \000 terminated
> > -	 * and have an assigned type.  The results are de-ephemeralized as
> > -	 * a side effect.
> > -	 */
> > -	pMem = p->pResultSet = &aMem[pOp->p1];
> > -	for(i=0; i<pOp->p2; i++) {
> > +	p->pResultSet = &aMem[pOp->p1];
> > +#ifdef SQL_DEBUG
> > +	struct Mem *pMem = p->pResultSet;
> > +	for(int i = 0; i < pOp->p2; i++) {
> 
> Please, add a whitespace after 'for'.
Fixed:


diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
index 18806b93f..acbf72078 100644
--- a/src/box/sql/vdbe.c
+++ b/src/box/sql/vdbe.c
@@ -1516,7 +1516,7 @@ case OP_ResultRow: {
 	p->pResultSet = &aMem[pOp->p1];
 #ifdef SQL_DEBUG
 	struct Mem *pMem = p->pResultSet;
-	for(int i = 0; i < pOp->p2; i++) {
+	for (int i = 0; i < pOp->p2; i++) {
 		assert(memIsValid(&pMem[i]));
 		REGISTER_TRACE(p, pOp->p1+i, &pMem[i]);
 	}


More information about the Tarantool-patches mailing list