From a93e4876364cff2d7d09528090071703e765ae80 Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Fri, 22 Nov 2019 10:27:50 +0800 Subject: [PATCH] [tbase-1212] --- src/inc/sql.y | 2 +- src/system/detail/src/vnodeMeter.c | 8 +++----- src/util/src/sql.c | 4 +++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/inc/sql.y b/src/inc/sql.y index 453485b0d9..0fb7f6ef60 100644 --- a/src/inc/sql.y +++ b/src/inc/sql.y @@ -218,7 +218,7 @@ comp(Y) ::= COMP INTEGER(X). { Y = X; } prec(Y) ::= PRECISION STRING(X). { Y = X; } %type db_optr {SCreateDBInfo} -db_optr ::= . {} +db_optr(Y) ::= . {memset(&Y, 0, sizeof(SCreateDBInfo));} db_optr(Y) ::= db_optr(Z) tables(X). { Y = Z; Y.tablesPerVnode = strtol(X.z, NULL, 10); } db_optr(Y) ::= db_optr(Z) cache(X). { Y = Z; Y.cacheBlockSize = strtol(X.z, NULL, 10); } db_optr(Y) ::= db_optr(Z) replica(X). { Y = Z; Y.replica = strtol(X.z, NULL, 10); } diff --git a/src/system/detail/src/vnodeMeter.c b/src/system/detail/src/vnodeMeter.c index 42353c36a4..74d72b4c67 100644 --- a/src/system/detail/src/vnodeMeter.c +++ b/src/system/detail/src/vnodeMeter.c @@ -596,7 +596,7 @@ int vnodeInsertPoints(SMeterObj *pObj, char *cont, int contLen, char source, voi } pData = pSubmit->payLoad; - code = 0; + code = TSDB_CODE_SUCCESS; TSKEY firstKey = *((TSKEY *)pData); TSKEY lastKey = *((TSKEY *)(pData + pObj->bytesPerPoint * (numOfPoints - 1))); @@ -613,8 +613,7 @@ int vnodeInsertPoints(SMeterObj *pObj, char *cont, int contLen, char source, voi goto _over; } - for (i = 0; i < numOfPoints; ++i) { - // meter will be dropped, abort current insertion + for (i = 0; i < numOfPoints; ++i) { // meter will be dropped, abort current insertion if (pObj->state >= TSDB_METER_STATE_DELETING) { dWarn("vid:%d sid:%d id:%s, meter is dropped, abort insert, state:%d", pObj->vnode, pObj->sid, pObj->meterId, pObj->state); @@ -656,10 +655,9 @@ int vnodeInsertPoints(SMeterObj *pObj, char *cont, int contLen, char source, voi pVnode->version++; pthread_mutex_unlock(&(pVnode->vmutex)); + vnodeClearMeterState(pObj, TSDB_METER_STATE_INSERT); _over: - vnodeClearMeterState(pObj, TSDB_METER_STATE_INSERT); - dTrace("vid:%d sid:%d id:%s, %d out of %d points are inserted, lastKey:%ld source:%d, vnode total storage: %ld", pObj->vnode, pObj->sid, pObj->meterId, points, numOfPoints, pObj->lastKey, source, pVnode->vnodeStatistic.totalStorage); diff --git a/src/util/src/sql.c b/src/util/src/sql.c index f67af9b046..2922fd8672 100644 --- a/src/util/src/sql.c +++ b/src/util/src/sql.c @@ -1934,7 +1934,6 @@ static void yy_reduce( /********** Begin reduce actions **********************************************/ YYMINORTYPE yylhsminor; case 0: /* program ::= cmd */ - case 79: /* db_optr ::= */ yytestcase(yyruleno==79); {} break; case 1: /* cmd ::= SHOW DATABASES */ @@ -2146,6 +2145,9 @@ static void yy_reduce( case 78: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==78); { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } break; + case 79: /* db_optr ::= */ +{memset(&yymsp[1].minor.yy398, 0, sizeof(SCreateDBInfo));} + break; case 80: /* db_optr ::= db_optr tables */ case 94: /* alter_db_optr ::= alter_db_optr tables */ yytestcase(yyruleno==94); { yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.tablesPerVnode = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -- GitLab