Skip to content

Commit 47d9bc6

Browse files
authored
fix: group_concat type error (#34443)
1 parent 417916f commit 47d9bc6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

source/libs/function/src/builtinsimpl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ int32_t gconcatFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultI
15571557
}
15581558

15591559
SGconcatRes* pRes = GET_ROWCELL_INTERBUF(pResultInfo);
1560-
(void)memset(pRes, 0, sizeof(SStdRes));
1560+
(void)memset(pRes, 0, sizeof(SGconcatRes));
15611561

15621562
// pRes->separator = varDataVal(pCtx->param[0].param.pz);
15631563

test/cases/11-Functions/02-Aggregate/test_agg_gconcat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def smoking(self):
3636
tdSql.prepare(db, drop=True)
3737
tdSql.execute(f"use {db}")
3838
tdSql.execute(f"create table {tb} (ts timestamp, tbcol varchar(10))")
39+
tdSql.execute(f"CREATE STABLE s_ptr_data (ts TIMESTAMP, test_value DOUBLE, test_flag INT, hi_limit DOUBLE, lo_limit DOUBLE) TAGS (factory VARCHAR(32), fileid VARCHAR(64), testnum INT, testtxt VARCHAR(256), headnum INT, sitenum INT, productid VARCHAR(64), lotid VARCHAR(64), sublotid VARCHAR(64), jobname VARCHAR(128), flowid VARCHAR(32), datatype VARCHAR(10), nodename VARCHAR(32))")
3940

4041
x = 0
4142
while x < rowNum:
@@ -49,3 +50,6 @@ def smoking(self):
4950
tdLog.info(f"===> {tdSql.getData(0,0)}")
5051
tdSql.checkRows(1)
5152
tdSql.checkData(0, 0, '0?1?2?3?4?5?6?7?8?9')
53+
54+
tdSql.query(f"SELECT _wstart as ws, AVG(test_value) as avg_test_value, GROUP_CONCAT(CAST(test_value AS VARCHAR) , ',') FROM s_ptr_data PARTITION BY lotId, subLotId, headNum, siteNum, jobName, testTxt, testNum count_window(100) ;")
55+
tdSql.checkRows(0)

0 commit comments

Comments
 (0)