add config
This commit is contained in:
parent
dfe3d5a9bc
commit
af97f9e000
|
@ -158,6 +158,7 @@ extern int32_t tsMetaCacheMaxSize;
|
|||
extern int32_t tsSlowLogThreshold;
|
||||
extern int32_t tsSlowLogScope;
|
||||
extern int32_t tsTimeSeriesThreshold;
|
||||
extern bool tsMultiResultFunctionStarReturnTags;
|
||||
|
||||
// client
|
||||
extern int32_t tsMinSlidingTime;
|
||||
|
|
|
@ -170,6 +170,7 @@ int32_t tsMetaCacheMaxSize = -1; // MB
|
|||
int32_t tsSlowLogThreshold = 3; // seconds
|
||||
int32_t tsSlowLogScope = SLOW_LOG_TYPE_ALL;
|
||||
int32_t tsTimeSeriesThreshold = 50;
|
||||
bool tsMultiResultFunctionStarReturnTags = false;
|
||||
|
||||
/*
|
||||
* denote if the server needs to compress response message at the application layer to client, including query rsp,
|
||||
|
@ -545,6 +546,8 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
|
|||
|
||||
if (cfgAddBool(pCfg, "monitor", tsEnableMonitor, CFG_SCOPE_BOTH, CFG_DYN_BOTH) != 0) return -1;
|
||||
if (cfgAddInt32(pCfg, "monitorInterval", tsMonitorInterval, 1, 200000, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1;
|
||||
|
||||
if (cfgAddBool(pCfg, "multiResultFunctionStarReturnTags", tsMultiResultFunctionStarReturnTags, CFG_SCOPE_CLIENT, CFG_DYN_CLIENT) != 0) return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1103,6 +1106,8 @@ static int32_t taosSetClientCfg(SConfig *pCfg) {
|
|||
tsKeepAliveIdle = cfgGetItem(pCfg, "keepAliveIdle")->i32;
|
||||
|
||||
tsExperimental = cfgGetItem(pCfg, "experimental")->bval;
|
||||
|
||||
tsMultiResultFunctionStarReturnTags = cfgGetItem(pCfg, "multiResultFunctionStarReturnTags")->bval;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1742,7 +1747,8 @@ static int32_t taosCfgDynamicOptionsForClient(SConfig *pCfg, char *name) {
|
|||
{"shellActivityTimer", &tsShellActivityTimer},
|
||||
{"slowLogThreshold", &tsSlowLogThreshold},
|
||||
{"useAdapter", &tsUseAdapter},
|
||||
{"experimental", &tsExperimental}};
|
||||
{"experimental", &tsExperimental},
|
||||
{"multiResultFunctionStarReturnTags", &tsMultiResultFunctionStarReturnTags} };
|
||||
|
||||
if (taosCfgSetOption(debugOptions, tListLen(debugOptions), pItem, true) != 0) {
|
||||
taosCfgSetOption(options, tListLen(options), pItem, false);
|
||||
|
|
|
@ -3368,9 +3368,9 @@ static int32_t createMultiResFuncsParas(STranslateContext* pCxt, SNodeList* pSrc
|
|||
SNode* pPara = NULL;
|
||||
FOREACH(pPara, pSrcParas) {
|
||||
if (nodesIsStar(pPara)) {
|
||||
code = createAllColumns(pCxt, false, &pExprs);
|
||||
code = createAllColumns(pCxt, !tsMultiResultFunctionStarReturnTags, &pExprs);
|
||||
} else if (nodesIsTableStar(pPara)) {
|
||||
code = createTableAllCols(pCxt, (SColumnNode*)pPara, false, &pExprs);
|
||||
code = createTableAllCols(pCxt, (SColumnNode*)pPara, !tsMultiResultFunctionStarReturnTags, &pExprs);
|
||||
} else {
|
||||
code = nodesListMakeStrictAppend(&pExprs, nodesCloneNode(pPara));
|
||||
}
|
||||
|
|
|
@ -298,7 +298,7 @@ if $data01 != 112 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
if $data03 != @tm0@ then
|
||||
if $data02 != @tm0@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -310,7 +310,7 @@ if $data11 != 421 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
if $data13 != @tm1@ then
|
||||
if $data12 != @tm1@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -805,16 +805,16 @@ endi
|
|||
if $data04 != 01 then
|
||||
return -1
|
||||
endi
|
||||
if $data[0][10] != @21-03-01 01:00:00.000@ then
|
||||
if $data05 != @21-03-01 01:00:00.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data[0][11] != 9911 then
|
||||
if $data06 != 9911 then
|
||||
return -1
|
||||
endi
|
||||
if $data[0][12] != 9911.000000000 then
|
||||
if $data07 != 9911.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data[0][13] != 11 then
|
||||
if $data08 != 11 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -837,16 +837,16 @@ endi
|
|||
if $data04 != 05 then
|
||||
return -1
|
||||
endi
|
||||
if $data[0][10] != @21-03-01 05:00:00.000@ then
|
||||
if $data05 != @21-03-01 05:00:00.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data[0][11] != 9915 then
|
||||
if $data06 != 9915 then
|
||||
return -1
|
||||
endi
|
||||
if $data[0][12] != 9915.000000000 then
|
||||
if $data07 != 9915.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data[0][13] != 15 then
|
||||
if $data08 != 15 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -243,11 +243,11 @@ endi
|
|||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != @21-05-12 10:10:12.000@ then
|
||||
if $data05 != @21-05-12 10:10:12.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data07 != @70-01-01 07:59:57.000@ then
|
||||
if $data06 != @70-01-01 07:59:57.000@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -243,11 +243,11 @@ endi
|
|||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != @21-05-12 10:10:12.000@ then
|
||||
if $data05 != @21-05-12 10:10:12.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data07 != @70-01-01 07:59:57.000@ then
|
||||
if $data06 != @70-01-01 07:59:57.000@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -54,13 +54,13 @@ sql select last_row(*), ts, 'abc', 123.981, tbname from m1
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != @19-01-01 01:01:01.000@ then
|
||||
if $data02 != @19-01-01 01:01:01.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != @abc@ then
|
||||
if $data03 != @abc@ then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 123.981000000 then
|
||||
if $data04 != 123.981000000 then
|
||||
print expect 123.981000000, actual: $data04
|
||||
return -1
|
||||
endi
|
||||
|
|
|
@ -33,29 +33,29 @@ if $data06 != tba1 then
|
|||
endi
|
||||
|
||||
sql select last(*) from db1.sta;
|
||||
if $cols != 7 then
|
||||
if $cols != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data06 != tba2 then
|
||||
if $data03 != tba2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select last_row(*) from db1.sta;
|
||||
if $cols != 7 then
|
||||
if $cols != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data06 != tba2 then
|
||||
if $data03 != tba2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select first(*) from db1.sta;
|
||||
if $cols != 7 then
|
||||
if $cols != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data06 != tba1 then
|
||||
if $data03 != tba1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -71,29 +71,29 @@ if $data06 != tba1 then
|
|||
endi
|
||||
|
||||
sql select last(b.*) from db1.sta b;
|
||||
if $cols != 7 then
|
||||
if $cols != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data06 != tba2 then
|
||||
if $data03 != tba2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select last_row(b.*) from db1.sta b;
|
||||
if $cols != 7 then
|
||||
if $cols != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data06 != tba2 then
|
||||
if $data03 != tba2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select first(b.*) from db1.sta b;
|
||||
if $cols != 7 then
|
||||
if $cols != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data06 != tba1 then
|
||||
if $data03 != tba1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -35,12 +35,11 @@ if $data03 != b then
|
|||
return -1
|
||||
endi
|
||||
sql explain select count(*), last(*) from sta;
|
||||
if $data00 != @-> Merge (columns=5 width=230 input_order=unknown output_order=unknown mode=column)@ then
|
||||
print $data00
|
||||
if $data00 != @-> Merge (columns=4 width=226 input_order=unknown output_order=unknown mode=column)@ then
|
||||
return -1
|
||||
endi
|
||||
sql explain select first(f1), last(*) from sta;
|
||||
if $data00 != @-> Merge (columns=5 width=230 input_order=unknown output_order=unknown mode=column)@ then
|
||||
if $data00 != @-> Merge (columns=4 width=226 input_order=unknown output_order=unknown mode=column)@ then
|
||||
return -1
|
||||
endi
|
||||
sql select first(f1), last(*) from sta;
|
||||
|
|
|
@ -152,8 +152,8 @@ class TDTestCase:
|
|||
tdSql.checkRows(1)
|
||||
tdSql.checkData(0, 0, last_ts4)
|
||||
tdSql.checkData(0, 1, 5 * maxRange - 1)
|
||||
tdSql.checkData(0, 3, last_ts4)
|
||||
tdSql.checkData(0, 4, 4 * maxRange + 1)
|
||||
tdSql.checkData(0, 2, last_ts4)
|
||||
tdSql.checkData(0, 3, 4 * maxRange + 1)
|
||||
|
||||
explain_res = self.explain_sql(sql)
|
||||
self.check_explain_res_no_row("Last Row Scan", explain_res, sql)
|
||||
|
@ -302,8 +302,8 @@ class TDTestCase:
|
|||
tdSql.checkRows(1)
|
||||
tdSql.checkData(0, 0, last_ts4)
|
||||
tdSql.checkData(0, 1, 5 * maxRange - 1)
|
||||
tdSql.checkData(0, 3, last_ts4)
|
||||
tdSql.checkData(0, 4, 4 * maxRange + 1)
|
||||
tdSql.checkData(0, 2, last_ts4)
|
||||
tdSql.checkData(0, 3, 4 * maxRange + 1)
|
||||
|
||||
explain_res = self.explain_sql(sql)
|
||||
self.check_explain_res_has_row("Last Row Scan", explain_res, sql)
|
||||
|
@ -453,8 +453,8 @@ class TDTestCase:
|
|||
tdSql.checkRows(1)
|
||||
tdSql.checkData(0, 0, last_ts4)
|
||||
tdSql.checkData(0, 1, 5 * maxRange - 1)
|
||||
tdSql.checkData(0, 3, last_ts4)
|
||||
tdSql.checkData(0, 4, 4 * maxRange + 1)
|
||||
tdSql.checkData(0, 2, last_ts4)
|
||||
tdSql.checkData(0, 3, 4 * maxRange + 1)
|
||||
|
||||
explain_res = self.explain_sql(sql)
|
||||
self.check_explain_res_has_row("Last Row Scan", explain_res, sql)
|
||||
|
@ -587,7 +587,7 @@ class TDTestCase:
|
|||
|
||||
explain_res = self.explain_sql(sql)
|
||||
self.check_explain_res_has_row("Last Row Scan", explain_res, sql)
|
||||
self.check_explain_res_has_row("Table Scan", explain_res, sql)
|
||||
self.check_explain_res_no_row("Table Scan", explain_res, sql)
|
||||
|
||||
sql = f'select last_row(ts), last(ts), last_row(id), last(id) from last_test_both_model.st;'
|
||||
tdSql.query(sql)
|
||||
|
@ -607,7 +607,7 @@ class TDTestCase:
|
|||
tdSql.checkData(0, 0, last_ts4)
|
||||
tdSql.checkData(0, 1, 5 * maxRange - 1)
|
||||
#tdSql.checkData(0, 2, last_ts4)
|
||||
tdSql.checkData(0, 4, 4 * maxRange + 1)
|
||||
tdSql.checkData(0, 3, 4 * maxRange + 1)
|
||||
|
||||
explain_res = self.explain_sql(sql)
|
||||
self.check_explain_res_has_row("Last Row Scan", explain_res, sql)
|
||||
|
|
Loading…
Reference in New Issue