diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index d1136ca4de973c89918d7109e8b5adebf9ff2134..ec7f9d8b4fbfe00c3c79aad0b3c31ec48107c0e8 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -2410,7 +2410,7 @@ static void multiVnodeInsertFinalize(void* param, TAOS_RES* tres, int numOfRows) // record the total inserted rows if (numOfRows > 0) { - pParentObj->res.numOfRows += numOfRows; + atomic_add_fetch_32(&pParentObj->res.numOfRows, numOfRows); } if (taos_errno(tres) != TSDB_CODE_SUCCESS) {