提交 125636e9 编写于 作者: S slguan

Modify the location of the cache count

上级 d0c37df8
......@@ -20,6 +20,7 @@
extern "C" {
#endif
#include "taosmsg.h"
#include "textbuffer.h"
#include "tinterpolation.h"
#include "tlosertree.h"
......
......@@ -33,7 +33,6 @@
#include <math.h>
#include <string.h>
#include <time.h>
#include <tsclient.h>
#include <unistd.h>
#include <wchar.h>
#include <wordexp.h>
......
......@@ -3949,7 +3949,8 @@ int32_t parseCreateDBOptions(SCreateDBInfo* pCreateDbSql, SSqlCmd* pCmd) {
if (pCreateDbSql->keep != NULL) {
switch (pCreateDbSql->keep->nExpr) {
case 1:pMsg->daysToKeep = htonl(pCreateDbSql->keep->a[0].pVar.i64Key);
case 1:
pMsg->daysToKeep = htonl(pCreateDbSql->keep->a[0].pVar.i64Key);
break;
case 2: {
pMsg->daysToKeep = htonl(pCreateDbSql->keep->a[0].pVar.i64Key);
......
......@@ -521,10 +521,12 @@ void *taosGetDataFromCache(void *handle, char *key) {
pthread_rwlock_rdlock(&pObj->lock);
SDataNode *ptNode = taosGetNodeFromHashTable(handle, key, keyLen);
if (ptNode != NULL) {
ptNode->refCount += 1;
}
pthread_rwlock_unlock(&pObj->lock);
if (ptNode != NULL) {
__sync_add_and_fetch_32(&ptNode->refCount, 1);
__sync_add_and_fetch_32(&pObj->statistics.hitCount, 1);
pTrace("key:%s is retrieved from cache,refcnt:%d", key, ptNode->refCount);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册