fix: union precision issue

This commit is contained in:
dapan1121 2024-04-12 11:07:26 +08:00
parent 5372988bb4
commit f2c871f2f5
3 changed files with 21 additions and 0 deletions

View File

@ -11093,6 +11093,8 @@ static int32_t setQuery(STranslateContext* pCxt, SQuery* pQuery) {
if (nodeType(pQuery->pRoot) == QUERY_NODE_SELECT_STMT) {
pQuery->precision = extractResultTsPrecision((SSelectStmt*)pQuery->pRoot);
} else if (nodeType(pQuery->pRoot) == QUERY_NODE_SET_OPERATOR) {
pQuery->precision = ((SSetOperator*)pQuery->pRoot)->precision;
}
}

View File

@ -1167,6 +1167,7 @@
,,y,script,./test.sh -f tsim/query/apercentile.sim
,,y,script,./test.sh -f tsim/query/query_count0.sim
,,y,script,./test.sh -f tsim/query/query_count_sliding0.sim
,,y,script,./test.sh -f tsim/query/union_precision.sim
,,y,script,./test.sh -f tsim/qnode/basic1.sim
,,y,script,./test.sh -f tsim/snode/basic1.sim
,,y,script,./test.sh -f tsim/mnode/basic1.sim

View File

@ -0,0 +1,18 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database tt precision 'us';
sql use tt ;
sql CREATE TABLE t_test_table ( ts TIMESTAMP, a NCHAR(80), b NCHAR(80), c NCHAR(80) );
sql insert into t_test_table values('2024-04-07 14:30:22.823','aa','aa', 'aa');
sql select * from t_test_table t union all select * from t_test_table t ;
if $rows != 2 then
return -1
endi
if $data00 != @24-04-07 14:30:22.823000@ then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT