diff --git a/src/system/detail/src/vnodeShell.c b/src/system/detail/src/vnodeShell.c index 66cc16d9df..0b7420664d 100644 --- a/src/system/detail/src/vnodeShell.c +++ b/src/system/detail/src/vnodeShell.c @@ -494,7 +494,11 @@ void vnodeExecuteRetrieveReq(SSchedMsg *pSched) { pMsg += sizeof(int32_t); *((int64_t*)pMsg) = htobe64(pQInfo->pObj->uid); pMsg += sizeof(int64_t); - *((TSKEY*)pMsg) = htobe64(pQInfo->query.lastKey); + if (pQInfo->pointsRead > 0) { + *((TSKEY*)pMsg) = htobe64(pQInfo->query.lastKey + 1); + } else { + *((TSKEY*)pMsg) = htobe64(pQInfo->query.lastKey); + } pMsg += sizeof(TSKEY); } diff --git a/tests/examples/c/subscribe.c b/tests/examples/c/subscribe.c index 80efa71dc2..a36de8e010 100644 --- a/tests/examples/c/subscribe.c +++ b/tests/examples/c/subscribe.c @@ -63,6 +63,11 @@ int main(int argc, char *argv[]) { keep = 0; continue; } + if (strncmp(argv[i], "-sql=", 5) == 0) { + sql = argv[i] + 5; + topic = "test-custom"; + continue; + } } // init TAOS