fix schemaversion error that caused taosd core dump
This commit is contained in:
parent
fb01043111
commit
3a2ace484c
|
@ -369,6 +369,7 @@ int32_t tscSQLSyntaxErrMsg(char* msg, const char* additionalInfo, const char* s
|
||||||
|
|
||||||
int32_t tscValidateSqlInfo(SSqlObj *pSql, struct SSqlInfo *pInfo);
|
int32_t tscValidateSqlInfo(SSqlObj *pSql, struct SSqlInfo *pInfo);
|
||||||
|
|
||||||
|
int32_t tsSetBlockInfo(SSubmitBlk *pBlocks, const STableMeta *pTableMeta, int32_t numOfRows);
|
||||||
extern int32_t sentinel;
|
extern int32_t sentinel;
|
||||||
extern SHashObj *tscVgroupMap;
|
extern SHashObj *tscVgroupMap;
|
||||||
extern SHashObj *tscTableMetaInfo;
|
extern SHashObj *tscTableMetaInfo;
|
||||||
|
|
|
@ -643,7 +643,7 @@ int32_t tscAllocateMemIfNeed(STableDataBlocks *pDataBlock, int32_t rowSize, int3
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t tsSetBlockInfo(SSubmitBlk *pBlocks, const STableMeta *pTableMeta, int32_t numOfRows) {
|
int32_t tsSetBlockInfo(SSubmitBlk *pBlocks, const STableMeta *pTableMeta, int32_t numOfRows) {
|
||||||
pBlocks->tid = pTableMeta->id.tid;
|
pBlocks->tid = pTableMeta->id.tid;
|
||||||
pBlocks->uid = pTableMeta->id.uid;
|
pBlocks->uid = pTableMeta->id.uid;
|
||||||
pBlocks->sversion = pTableMeta->sversion;
|
pBlocks->sversion = pTableMeta->sversion;
|
||||||
|
|
|
@ -1140,6 +1140,7 @@ void destroySmlDataPoint(TAOS_SML_DATA_POINT* point) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int taos_insert_lines(TAOS* taos, char* lines[], int numLines) {
|
int taos_insert_lines(TAOS* taos, char* lines[], int numLines) {
|
||||||
|
int32_t code = 0;
|
||||||
SArray* lpPoints = taosArrayInit(numLines, sizeof(SLPPoint));
|
SArray* lpPoints = taosArrayInit(numLines, sizeof(SLPPoint));
|
||||||
tscParseLines(lines, numLines, lpPoints, NULL);
|
tscParseLines(lines, numLines, lpPoints, NULL);
|
||||||
|
|
||||||
|
@ -1202,13 +1203,16 @@ int taos_insert_lines(TAOS* taos, char* lines[], int numLines) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
taos_sml_insert(taos, points, (int)numPoints);
|
code = taos_sml_insert(taos, points, (int)numPoints);
|
||||||
|
if (code != 0) {
|
||||||
|
tscError("taos_sml_insert error: %s", tstrerror((code)));
|
||||||
|
}
|
||||||
|
|
||||||
for (int i=0; i<numPoints; ++i) {
|
for (int i=0; i<numPoints; ++i) {
|
||||||
destroySmlDataPoint(points+i);
|
destroySmlDataPoint(points+i);
|
||||||
}
|
}
|
||||||
free(points);
|
free(points);
|
||||||
taosArrayDestroyEx(lpPoints, destroyLPPoint);
|
taosArrayDestroyEx(lpPoints, destroyLPPoint);
|
||||||
return 0;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1560,6 +1560,8 @@ int taos_stmt_set_tbname_tags(TAOS_STMT* stmt, const char* name, TAOS_BIND* tags
|
||||||
SSubmitBlk* pBlk = (SSubmitBlk*) (*t1)->pData;
|
SSubmitBlk* pBlk = (SSubmitBlk*) (*t1)->pData;
|
||||||
pCmd->batchSize = pBlk->numOfRows;
|
pCmd->batchSize = pBlk->numOfRows;
|
||||||
|
|
||||||
|
tsSetBlockInfo(pBlk, (*t1)->pTableMeta, pBlk->numOfRows);
|
||||||
|
|
||||||
taosHashPut(pCmd->insertParam.pTableBlockHashList, (void *)&pStmt->mtb.currentUid, sizeof(pStmt->mtb.currentUid), (void*)t1, POINTER_BYTES);
|
taosHashPut(pCmd->insertParam.pTableBlockHashList, (void *)&pStmt->mtb.currentUid, sizeof(pStmt->mtb.currentUid), (void*)t1, POINTER_BYTES);
|
||||||
|
|
||||||
tscDebug("0x%"PRIx64" table:%s is already prepared, uid:%" PRIu64, pSql->self, name, pStmt->mtb.currentUid);
|
tscDebug("0x%"PRIx64" table:%s is already prepared, uid:%" PRIu64, pSql->self, name, pStmt->mtb.currentUid);
|
||||||
|
|
Loading…
Reference in New Issue