【 TiDB 使用环境】测试/ Poc
【 TiDB 版本】7.1.1
【遇到的问题:问题现象及影响】5.0.4版本执行没问题,7.1.1版本执行查询报错。
- sql
SELECT `estimate_year_month`,
`a_manager_yid` AS `manager_yid`,
`real_t1_volume`,
`real_t0_volume`,
`a_estimate_volume` + IFNULL(`b_estimate_volume`, 0) AS `estimate_volume`,
IFNULL(`a`.`increase_sum`, 0) + IFNULL(`b`.`increase_sum`, 0) AS `increase_sum`,
IFNULL(`a`.`decrease_sum`, 0) + IFNULL(`b`.`decrease_sum`, 0) AS `decrease_sum`
FROM (SELECT `estimate_year_month`,
`manager_yid` AS `a_manager_yid`,
SUM(`real_t1_volume`) AS `real_t1_volume`,
SUM(`real_t0_volume`) AS `real_t0_volume`,
SUM(`estimate_volume`) AS `a_estimate_volume`,
SUM(IF(`estimate_volume` > `real_t1_volume`,
`estimate_volume` - `real_t1_volume`,
0)) AS `increase_sum`,
SUM(IF(`estimate_volume` <`real_t1_volume`,
`estimate_volume` - `real_t1_volume`,
0)) AS `decrease_sum`
FROM `rd_crm`.`signed_estimate_volume`
WHERE `estimate_year_month` = DATE_FORMAT(NOW(), _UTF8MB4'%Y%m')
AND `is_dropped` = 0
AND `data_type` = 1
GROUP BY `manager_yid`) AS `a`
LEFT JOIN (SELECT `manager_yid` AS `b_manager_yid`,
SUM(`estimate_volume`) AS `b_estimate_volume`,
SUM(`estimate_volume`) AS `increase_sum`,
0 AS `decrease_sum`
FROM `rd_crm`.`unsigned_estimate_volume`
WHERE `estimate_year_month` = DATE_FORMAT(NOW(), _UTF8MB4'%Y%m')
AND `is_dropped` = 0
AND `data_type` = 1
GROUP BY `manager_yid`) AS `b`
ON a.`a_manager_yid` = b.`b_manager_yid`
【附件:截图/日志/监控】
错误日志:
[2023/08/02 16:46:46.037 +08:00] [ERROR] [adapter.go:148] ["execute sql panic"] [conn=844026906930753967] [sql="SELECT `estimate_year_month`,\n `a_manager_yid`
AS `manager_yid`,\n `real_t1_volume`,\n `real_t0_volume`,\n `a_estimate_volume` + IFNULL(`b_estimate_volume`, 0)
AS `estimate_volume`,\n IFNULL(`a`.`increase_sum`, 0) + IFNULL(`b`.`increase_sum`, 0) AS `increase_sum`,\n IFNULL(`a`.`decrease_sum`, 0) + IFNULL(`b`.`decr
ease_sum`, 0) AS `decrease_sum`\nFROM (SELECT `estimate_year_month`,\n `manager_yid` AS `a_manager_yid`,\n SUM(`real_t1_volume`) AS `real_t
1_volume`,\n SUM(`real_t0_volume`) AS `real_t0_volume`,\n SUM(`estimate_volume`) AS `a_estimate_volume`,\n SUM(IF(`estimate_volume` > `r
eal_t1_volume`,\n `estimate_volume` - `real_t1_volume`,\n 0)) AS `increase_sum`,\n SUM(IF(`estimate_volume` <`
real_t1_volume`,\n `estimate_volume` - `real_t1_volume`,\n 0)) AS `decrease_sum`\n FROM `rd_crm`.`signed_estimate_volu
me`\n WHERE `estimate_year_month` = DATE_FORMAT(NOW(), _UTF8MB4'%Y%m')\n AND `is_dropped` = 0\n AND `data_type` = 1\n GROUP BY `manager_yid`) AS `a`\
n LEFT JOIN (SELECT `manager_yid` AS `b_manager_yid`,\n SUM(`estimate_volume`) AS `b_estimate_volume`,\n
SUM(`estimate_volume`) AS `increase_sum`,\n 0 AS `decrease_sum`\n FROM `rd_crm`.`unsigned_estimate_volume`
\n WHERE `estimate_year_month` = DATE_FORMAT(NOW(), _UTF8MB4'%Y%m')\n AND `is_dropped` = 0\n AND `data_type` = 1
\n GROUP BY `manager_yid`) AS `b`\n ON a.`a_manager_yid` = b.`b_manager_yid`"] [stack="github.com/pingcap/tidb/executor.(*recordSet).Nex
t.func1\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/executor/adapter.go:148\nruntime.gopanic\n\t/usr/local/go/src/runtime/panic.go:884\nrunt
ime.goPanicIndex\n\t/usr/local/go/src/runtime/panic.go:113\ngithub.com/pingcap/tidb/util/chunk.(*Column).IsNull\n\t/home/jenkins/agent/workspace/build-common/go/src/github.c
om/pingcap/tidb/util/chunk/column.go:169\ngithub.com/pingcap/tidb/expression.(*builtinIfNullIntSig).vecEvalInt\n\t/home/jenkins/agent/workspace/build-common/go/src/github.co
m/pingcap/tidb/expression/builtin_control_vec_generated.go:846\ngithub.com/pingcap/tidb/expression.(*ScalarFunction).VecEvalInt\n\t/home/jenkins/agent/workspace/build-common
/go/src/github.com/pingcap/tidb/expression/scalar_function.go:48\ngithub.com/pingcap/tidb/expression.(*builtinCastIntAsDecimalSig).vecEvalDecimal\n\t/home/jenkins/agent/work
space/build-common/go/src/github.com/pingcap/tidb/expression/builtin_cast_vec.go:1081\ngithub.com/pingcap/tidb/expression.(*ScalarFunction).VecEvalDecimal\n\t/home/jenkins/a
gent/workspace/build-common/go/src/github.com/pingcap/tidb/expression/scalar_function.go:63\ngithub.com/pingcap/tidb/expression.(*builtinArithmeticPlusDecimalSig).vecEvalDec
imal\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/expression/builtin_arithmetic_vec.go:994\ngithub.com/pingcap/tidb/expression.(*ScalarFuncti
on).VecEvalDecimal\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/expression/scalar_function.go:63\ngithub.com/pingcap/tidb/expression.evalOneV
ec\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/expression/chunk_executor.go:163\ngithub.com/pingcap/tidb/expression.(*defaultEvaluator).run\
n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/expression/evaluator.go:53\ngithub.com/pingcap/tidb/expression.(*EvaluatorSuite).Run\n\t/home/je
nkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/expression/evaluator.go:125\ngithub.com/pingcap/tidb/executor.(*ProjectionExec).unParallelExecute\n\t/home/
jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/executor/projection.go:205\ngithub.com/pingcap/tidb/executor.(*ProjectionExec).Next\n\t/home/jenkins/agen
t/workspace/build-common/go/src/github.com/pingcap/tidb/executor/projection.go:183\ngithub.com/pingcap/tidb/executor.Next\n\t/home/jenkins/agent/workspace/build-common/go/sr
c/github.com/pingcap/tidb/executor/executor.go:326\ngithub.com/pingcap/tidb/executor.(*ExecStmt).next\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap
/tidb/executor/adapter.go:1202\ngithub.com/pingcap/tidb/executor.(*recordSet).Next\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/executor/adap
ter.go:151\ngithub.com/pingcap/tidb/server.(*tidbResultSet).Next\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/driver_tidb.go:469\ngith
ub.com/pingcap/tidb/server.(*clientConn).writeChunks\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:2313\ngithub.com/pingcap/tid
b/server.(*clientConn).writeResultSet\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:2256\ngithub.com/pingcap/tidb/server.(*clie
ntConn).handleStmt\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:2124\ngithub.com/pingcap/tidb/server.(*clientConn).handleQuery
\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:1885\ngithub.com/pingcap/tidb/server.(*clientConn).dispatch\n\t/home/jenkins/age
nt/workspace/build-common/go/src/github.com/pingcap/tidb/server/conn.go:1372\ngithub.com/pingcap/tidb/server.(*clientConn).Run\n\t/home/jenkins/agent/workspace/build-common/
go/src/github.com/pingcap/tidb/server/conn.go:1153\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/t
idb/server/server.go:677"]