Merge pull request #27066 from taosdata/fix/TD-31285-3.0

fix: handle error code
This commit is contained in:
Hongze Cheng 2024-08-08 12:35:59 +08:00 committed by GitHub
commit 7eda50065d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 5 deletions

View File

@ -355,7 +355,9 @@ _query:
version = ((SUidIdxVal *)pData)[0].version;
(void)tdbTbGet(pMeta->pTbDb, &(STbDbKey){.uid = uid, .version = version}, sizeof(STbDbKey), &pData, &nData);
if (tdbTbGet(pMeta->pTbDb, &(STbDbKey){.uid = uid, .version = version}, sizeof(STbDbKey), &pData, &nData) != 0) {
goto _err;
}
SMetaEntry me = {0};
tDecoderInit(&dc, pData, nData);
@ -385,7 +387,9 @@ _query:
}
tDecoderInit(&dc, pData, nData);
(void)tDecodeSSchemaWrapperEx(&dc, &schema);
if (tDecodeSSchemaWrapperEx(&dc, &schema) != 0) {
goto _err;
}
pSchema = tCloneSSchemaWrapper(&schema);
tDecoderClear(&dc);

View File

@ -194,7 +194,11 @@ int tdbBtreeInsert(SBTree *pBt, const void *pKey, int kLen, const void *pVal, in
int idx;
int c;
(void)tdbBtcOpen(&btc, pBt, pTxn);
ret = tdbBtcOpen(&btc, pBt, pTxn);
if (ret) {
tdbError("tdb/btree-insert: btc open failed with ret: %d.", ret);
return ret;
}
tdbTrace("tdb insert, btc: %p, pTxn: %p", &btc, pTxn);
@ -235,7 +239,11 @@ int tdbBtreeDelete(SBTree *pBt, const void *pKey, int kLen, TXN *pTxn) {
int c;
int ret;
(void)tdbBtcOpen(&btc, pBt, pTxn);
ret = tdbBtcOpen(&btc, pBt, pTxn);
if (ret) {
tdbError("tdb/btree-delete: btc open failed with ret: %d.", ret);
return ret;
}
/*
btc.coder.ofps = taosArrayInit(8, sizeof(SPage *));
// btc.coder.ofps = taosArrayInit(8, sizeof(SPgno));
@ -337,7 +345,11 @@ int tdbBtreePGet(SBTree *pBt, const void *pKey, int kLen, void **ppKey, int *pkL
void *pTVal = NULL;
SCellDecoder cd = {0};
(void)tdbBtcOpen(&btc, pBt, NULL);
ret = tdbBtcOpen(&btc, pBt, NULL);
if (ret) {
tdbError("tdb/btree-pget: btc open failed with ret: %d.", ret);
return ret;
}
tdbTrace("tdb pget, btc: %p", &btc);