diff --git a/src/system/detail/src/vnodeShell.c b/src/system/detail/src/vnodeShell.c index 66cc16d9dfca6137af6498a47eec68e92fcb6219..0b7420664d261f2b78b178c96e957be3e74cdaa7 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 80efa71dc2a9288e318318a4129a146f20a9c345..a36de8e01064a4d40d9af9c5bacfa61da85459ee 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