Merge pull request #6694 from taosdata/hotfix/td-4986

[TD-4986]<fix>:fix core when no ts column returned from subquery
This commit is contained in:
Haojun Liao 2021-07-01 19:16:18 +08:00 committed by GitHub
commit 5f62c311c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -1575,7 +1575,7 @@ static void last_function(SQLFunctionCtx *pCtx) {
memcpy(pCtx->pOutput, data, pCtx->inputBytes);
TSKEY ts = GET_TS_DATA(pCtx, i);
TSKEY ts = pCtx->ptsList ? GET_TS_DATA(pCtx, i) : 0;
DO_UPDATE_TAG_COLUMNS(pCtx, ts);
pResInfo->hasResult = DATA_SET_FLAG;
@ -1590,7 +1590,7 @@ static void last_function(SQLFunctionCtx *pCtx) {
continue;
}
TSKEY ts = GET_TS_DATA(pCtx, i);
TSKEY ts = pCtx->ptsList ? GET_TS_DATA(pCtx, i) : 0;
char* buf = GET_ROWCELL_INTERBUF(pResInfo);
if (pResInfo->hasResult != DATA_SET_FLAG || (*(TSKEY*)buf) < ts) {

View File

@ -82,5 +82,9 @@ endi
if $data01 != NULL then
return -1
endi
sql select last_row(*) from (select f from lr_nested)
if $rows != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT