Merge pull request #20253 from taosdata/fix/TD-22952

fix: taosc crash caused of ordering by string
This commit is contained in:
Shengliang Guan 2023-03-03 15:12:20 +08:00 committed by GitHub
commit 3d49dd670e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -2797,6 +2797,10 @@ static int32_t translateOrderBy(STranslateContext* pCxt, SSelectStmt* pSelect) {
bool other;
int32_t code = translateOrderByPosition(pCxt, pSelect->pProjectionList, pSelect->pOrderByList, &other);
if (TSDB_CODE_SUCCESS == code) {
if (0 == LIST_LENGTH(pSelect->pOrderByList)) {
NODES_DESTORY_LIST(pSelect->pOrderByList);
return TSDB_CODE_SUCCESS;
}
if (!other) {
return TSDB_CODE_SUCCESS;
}

View File

@ -38,6 +38,7 @@ class TDTestCase:
#tdSql.checkData(0,0,1537146000000)
tdSql.checkData(0,1,10)
tdSql.query(f"select * from {dbname}.stb_1 order by 'aaa' desc")
def stop(self):
tdSql.close()