Wordpress适配时服务器必然出现connection running loop panic

为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:

【TiDB 版本】
v5.0.1

【问题描述】
Wordpress 系统,发现在执行下面sql时,必然会出错。
执行explain也同样会报错。

烦请看看是什么问题,如何解决。
谢谢。

详细如下:
SQL:
SELECT wp_6_comments.* FROM wp_6_comments JOIN wp_6_posts ON ( wp_6_comments.comment_post_ID = wp_6_posts.ID ) WHERE ( post_status = ‘publish’ OR ( post_status = ‘inherit’ AND post_type = ‘attachment’ ) ) AND comment_approved = ‘1’ ORDER BY comment_date_gmt DESC LIMIT 10;

explain SELECT wp_6_comments.* FROM wp_6_comments JOIN wp_6_posts ON ( wp_6_comments.comment_post_ID = wp_6_posts.ID ) WHERE ( post_status = ‘publish’ OR ( post_status = ‘inherit’ AND post_type = ‘attachment’ ) ) AND comment_approved = ‘1’ ORDER BY comment_date_gmt DESC LIMIT 10;

ERROR 1105 (HY000): runtime error: invalid memory address or nil pointer dereference

TABLE:

| wp_6_comments | CREATE TABLE wp_6_comments (
comment_ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
comment_post_ID bigint(20) unsigned NOT NULL DEFAULT ‘0’,
comment_author tinytext COLLATE utf8mb4_unicode_ci NOT NULL,
comment_author_email varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘’,
comment_author_url varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘’,
comment_author_IP varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘’,
comment_date datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
comment_date_gmt datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
comment_content text COLLATE utf8mb4_unicode_ci NOT NULL,
comment_karma int(11) NOT NULL DEFAULT ‘0’,
comment_approved varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘1’,
comment_agent varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘’,
comment_type varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘’,
comment_parent bigint(20) unsigned NOT NULL DEFAULT ‘0’,
user_id bigint(20) unsigned NOT NULL DEFAULT ‘0’,
PRIMARY KEY (comment_ID) /*T![clustered_index] CLUSTERED */,
KEY comment_post_ID (comment_post_ID),
KEY comment_approved_date_gmt (comment_approved,comment_date_gmt),
KEY comment_date_gmt (comment_date_gmt),
KEY comment_parent (comment_parent),
KEY comment_author_email (comment_author_email(10))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=15;

| wp_6_posts | CREATE TABLE wp_6_posts (
ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
post_author bigint(20) unsigned NOT NULL DEFAULT ‘0’,
post_date datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
post_date_gmt datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
post_content longtext COLLATE utf8mb4_unicode_ci NOT NULL,
post_title text COLLATE utf8mb4_unicode_ci NOT NULL,
post_excerpt text COLLATE utf8mb4_unicode_ci NOT NULL,
post_status varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘publish’,
comment_status varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘open’,
ping_status varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘open’,
post_password varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘’,
post_name varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘’,
to_ping text COLLATE utf8mb4_unicode_ci NOT NULL,
pinged text COLLATE utf8mb4_unicode_ci NOT NULL,
post_modified datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
post_modified_gmt datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
post_content_filtered longtext COLLATE utf8mb4_unicode_ci NOT NULL,
post_parent bigint(20) unsigned NOT NULL DEFAULT ‘0’,
guid varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘’,
menu_order int(11) NOT NULL DEFAULT ‘0’,
post_type varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘post’,
post_mime_type varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ‘’,
comment_count bigint(20) NOT NULL DEFAULT ‘0’,
PRIMARY KEY (ID) /*T![clustered_index] CLUSTERED */,
KEY post_name (post_name(191)),
KEY type_status_date (post_type,post_status,post_date,ID),
KEY post_parent (post_parent),
KEY post_author (post_author)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=153193

tidb.log如下

[ERROR] [conn.go:736] ["connection running loop panic"] [conn=364767] [lastSQL="SELECT  wp_6_comments.* FROM wp_6_comments JOIN wp_
6_posts ON ( wp_6_comments.comment_post_ID = wp_6_posts.ID ) WHERE ( post_status = 'publish' OR ( post_status = 'inherit' AND post_type = 'attachment' ) ) AND comme
nt_approved = '1'  ORDER BY comment_date_gmt DESC LIMIT 10"] [err="runtime error: invalid memory address or nil pointer dereference"] [stack="goroutine 23959730 [ru
nning]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(0x4004660, 0xc0704e9b60, 0xc155782600)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linu
x-amd/go/src/github.com/pingcap/tidb/server/conn.go:734 +0xee\npanic(0x3597a40, 0x59111a0)\n\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb
/statistics.(*HistColl).Selectivity(0xc07201fe40, 0x405dc80, 0xc06e6112c0, 0xc072031a80, 0x1, 0x1, 0xc072058b70, 0x6, 0x6, 0x0, ...)\n\t/home/jenkins/agent/workspac
e/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/statistics/selectivity.go:245 +0x999\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).constru
ctInnerTableScanTask(0xc047d61880, 0xc07040b900, 0xc072076960, 0xc15dd6fe58, 0x1, 0x1, 0x0, 0x0, 0x3fefffffffffffff, 0x0, ...)\n\t/home/jenkins/agent/workspace/opti
mization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:915 +0x753\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).
buildIndexJoinInner2TableScan(0xc047d61880, 0xc0720a6310, 0xc07040b900, 0xc15dd6fe50, 0x1, 0x1, 0xc15dd6fe48, 0x1, 0x1, 0x0, ...)\n\t/home/jenkins/agent/workspace/o
ptimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:750 +0x31c\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoi
n).getIndexJoinByOuterIdx(0xc047d61880, 0xc0720a6310, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingc
ap/tidb/planner/core/exhaust_physical_plans.go:655 +0x325\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).tryToGetIndexJoin(0xc047d61880, 0xc0720a6310, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:1563 +0xa74\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).exhaustPhysicalPlans(0xc047d61880, 0xc0720a6310, 0xc0720a24e0, 0x18, 0x5f98a00, 0xc07209c650)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:1695 +0x334\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc047d618a0, 0xc0720a60e0, 0x598c388, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:310 +0x1d5\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).enumeratePhysicalPlans4Task(0xc072021ba0, 0xc07209b020, 0x6, 0x6, 0xc07202bf80, 0xc07209c600, 0x598c388, 0x10, 0x36b3440, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:213 +0x70d\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc072021ba0, 0xc07202bf10, 0x598c388, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:343 +0x32f\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).enumeratePhysicalPlans4Task(0xc071757ec0, 0xc07209c620, 0x1, 0x1, 0xc07202bea0, 0xc07202be00, 0xc0cca83160, 0x68, 0x37db3c0, 0xc070e50300, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:213 +0x70d\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc071757ec0, 0xc07202be30, 0xc0cca83160, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:343 +0x32f\ngithub.com/pingcap/tidb/planner/core.physicalOptimize(0x40594a0, 0xc071757ea0, 0xc0cca83160, 0x4058fa0, 0xc072090000, 0x40594a0, 0xc071757ea0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:224 +0x131\ngithub.com/pingcap/tidb/planner/core.DoOptimize(0x4004660, 0xc0720587b0, 0x405dc80, 0xc06e6112c0, 0x18a2, 0x40594a0, 0xc071757ea0, 0x0, 0x0, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingc"]
[ERROR] [conn.go:736] ["connection running loop panic"] [conn=1469] [lastSQL="explain SELECT  wp_6_comments.* FROM wp_6_comments JO
IN wp_6_posts ON ( wp_6_comments.comment_post_ID = wp_6_posts.ID ) WHERE ( post_status = 'publish' OR ( post_status = 'inherit' AND post_type = 'attachment' ) )"] [
err="runtime error: invalid memory address or nil pointer dereference"] [stack="goroutine 412638 [running]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(
0x4004660, 0xc0f86d8c90, 0xc17bcf4d00)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:734 +0xee\np
anic(0x3597a40, 0x59111a0)\n\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb/statistics.(*HistColl).Selectivity(0xc012ef7500, 0x405dc80, 0xc
011e23040, 0xc0090ecb60, 0x1, 0x1, 0xc01a73d920, 0x6, 0x6, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/ti
db/statistics/selectivity.go:245 +0x999\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).constructInnerTableScanTask(0xc17533bdc0, 0xc00dc45900, 0xc012eb7b80, 0
xc1b0fa0790, 0x1, 0x1, 0x0, 0x0, 0x3fefffffffffffff, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/pla
nner/core/exhaust_physical_plans.go:915 +0x753\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).buildIndexJoinInner2TableScan(0xc17533bdc0, 0xc0957f3f10, 0xc00d
c45900, 0xc1b0fa0788, 0x1, 0x1, 0xc1b0fa0780, 0x1, 0x1, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/
planner/core/exhaust_physical_plans.go:750 +0x31c\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).getIndexJoinByOuterIdx(0xc17533bdc0, 0xc0957f3f10, 0x0, 0x0,
0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:655 +0x325\ngithu
b.com/pingcap/tidb/planner/core.(*LogicalJoin).tryToGetIndexJoin(0xc17533bdc0, 0xc0957f3f10, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build
-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:1563 +0xa74\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).exhaustPhysic
alPlans(0xc17533bdc0, 0xc0957f3f10, 0xc0d0053c60, 0x18, 0x5f98a00, 0xc0090ed520)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.co
m/pingcap/tidb/planner/core/exhaust_physical_plans.go:1695 +0x334\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc17533bde0, 0xc0957f3b90,
0x598c388, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go
:310 +0x1d5\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).enumeratePhysicalPlans4Task(0xc0138c6480, 0xc0090ed510, 0x1, 0x1, 0xc0957f3810, 0xc0957f3400, 0
xc03ce43578, 0x68, 0x37db3c0, 0xc07e6e5b00, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find
_best_task.go:213 +0x70d\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc0138c6480, 0xc0957f3490, 0xc03ce43578, 0x0, 0x0, 0x0, 0x0, 0x0)\n\
t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:343 +0x32f\ngithub.com/pingcap/tidb/p
lanner/core.physicalOptimize(0x40594a0, 0xc0138c6460, 0xc03ce43578, 0x40594a0, 0xc0138c6460, 0x40594a0, 0xc0138c6460, 0x0)\n\t/home/jenkins/agent/workspace/optimiza
tion-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:224 +0x131\ngithub.com/pingcap/tidb/planner/core.DoOptimize(0x4004660, 0xc01a73d4
d0, 0x405dc80, 0xc011e23040, 0x10a2, 0x40594a0, 0xc0138c6460, 0x0, 0x0, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.c
om/pingcap/tidb/planner/core/optimizer.go:143 +0x13a\ngithub.com/pingcap/tidb/planner.optimize(0x4004660, 0xc01a73d4d0, 0x405dc80, 0xc011e23040, 0x40233e0, 0xc12803
6900, 0x404fae0, 0xc00dffed20, 0x0, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/optimize.go:
288 +0x66c\ngithub.com/pingcap/tidb/planner.Optimize(0x4004660, 0xc01a73d4d0, 0x405dc80, 0xc011e23040, 0x40233e0, 0xc128036900, 0x404fae0, 0xc00dffed20, 0x0, 0x0, .
..)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/optimize.go"]

若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。

目前没有发现这个问题,正在内部排查问题。

麻烦在日志里面过滤一下有没有 index out of range 的错误
看起来有点像 https://github.com/pingcap/tidb/pull/23844,需要更多的日志进行排查。

感谢回复。

执行上面的explain语句,日志中就只会出现一条前面这个错误,没有其他任何信息了。

另外,集群之前是5.0.0版本创建的,前2天遇到一个索引相关的bug,刚刚升级到5.0.1.
新建的时候修改过的全局设置如下:
SET GLOBAL allow_auto_random_explicit_insert=1;
SET GLOBAL innodb_lock_wait_timeout=3600;
SET GLOBAL sql_mode=‘NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’;
SET GLOBAL tidb_enable_index_merge=1;
SET GLOBAL tidb_enable_noop_functions=1;
SET GLOBAL tidb_enable_parallel_apply=1;

刚刚试了一下,tidb_enable_index_merge 关闭之后,上面的SQL就可以正常explain了

| Limit_17                             | 1.00    | root      |                                                                                          | offset:0, count:10                                                                                                                                                                                              |
| └─IndexJoin_71                       | 1.00    | root      |                                                                                          | inner join, inner:TableReader_67, outer key:wordpress.wp_6_comments.comment_post_id, inner key:wordpress.wp_6_posts.id, equal cond:eq(wordpress.wp_6_comments.comment_post_id, wordpress.wp_6_posts.id) |
|   ├─IndexLookUp_77(Build)            | 1.00    | root      |                                                                                          |                                                                                                                                                                                                                 |
|   │ ├─IndexRangeScan_75(Build)       | 1.00    | cop[tikv] | table:wp_6_comments, index:comment_approved_date_gmt(comment_approved, comment_date_gmt) | range:["1","1"], keep order:true, desc                                                                                                                                                                          |
|   │ └─TableRowIDScan_76(Probe)       | 1.00    | cop[tikv] | table:wp_6_comments                                                                      | keep order:false                                                                                                                                                                                                |
|   └─TableReader_67(Probe)            | 0.25    | root      |                                                                                          | data:Selection_66                                                                                                                                                                                               |
|     └─Selection_66                   | 0.25    | cop[tikv] |                                                                                          | or(eq(wordpress.wp_6_posts.post_status, "publish"), and(eq(wordpress.wp_6_posts.post_status, "inherit"), eq(wordpress.wp_6_posts.post_type, "attachment")))                                               |
|       └─TableRangeScan_65            | 1.00    | cop[tikv] | table:wp_6_posts                                                                         | range: decided by [wordpress.wp_6_comments.comment_post_id], keep order:false

谢谢,我们将反馈一下这个问题

为了进一步排查问题,方便提供一下 tidb 的 log 吗?

早期wordpress配置错误的时候有过index out of range
原因是插件里面固定了utf8和程序不一致,修改后就没问题了。
原始错误日志如下:

[2021/04/26 12:20:35.171 +09:00] [ERROR] [conn.go:736] ["connection running loop panic"] [conn=624503] [lastSQL="SELECT COUNT(*) FROM wp_wfLiveTrafficHuman WHERE IP = '\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\ufffd\ufffd\u0012\ufffd\ufffd\u0013' AND identifier = '\u0012\ufffdX=\ufffd[\ufffd\ufffdd#\ufffd\ufffdL\ufffd\ufffd\ufffdq\ufffd\ufffd\ufffdV\ufffdyu\u000e\u001fX\ufffdT\u00162\ufffd' AND expiration >= UNIX_TIMESTAMP()"] [err="runtime error: index out of range [32] with length 32"] [stack="goroutine 119863942 [running]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(0x3ff6060, 0xc07dd21950, 0xc09eba5b00)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:734 +0xee\npanic(0x378df20, 0xc015435b60)\n\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb/util/collate.decodeRune(0xc0ff4632f6, 0x20, 0x1f, 0x32, 0x1f)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/util/collate/collate.go:266 +0x121\ngithub.com/pingcap/tidb/util/collate.(*unicodeCICollator).Compare(0x5f82ce0, 0xc0ff4632f6, 0x20, 0xc0ff4632f6, 0x20, 0x34f7b80)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/util/collate/unicode_ci.go:44 +0x127\ngithub.com/pingcap/tidb/types.CompareString(0xc0ff4632f6, 0x20, 0xc0ff4632f6, 0x20, 0x39b862c, 0x12, 0x7f6f99f86d98)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/types/compare.go:118 +0x71\ngithub.com/pingcap/tidb/types.(*Datum).compareString(0xc0ffaa3d40, 0xc0ff995200, 0xc0ff4632f6, 0x20, 0x39b862c, 0x12, 0x0, 0x0, 0x4)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/types/datum.go:666 +0x112\ngithub.com/pingcap/tidb/types.(*Datum).CompareDatum(0xc0ffaa3d40, 0xc0ff995200, 0xc0ffaa3d40, 0x5, 0x0, 0x39b862c)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/types/datum.go:566 +0x28c\ngithub.com/pingcap/tidb/expression.(*Constant).Equal(0xc0ffaa3d40, 0x404ec80, 0xc09f6c3f00, 0x407b480, 0xc0ffaa3d40, 0x1)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/expression/constant.go:339 +0x10e\ngithub.com/pingcap/tidb/expression.(*baseBuiltinFunc).equal(0xc0ffc66210, 0x405eb00, 0xc0ffc66210, 0x240d300)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/expression/builtin.go:400 +0xd3\ngithub.com/pingcap/tidb/expression.(*ScalarFunction).Equal(0xc0551ec320, 0x404ec80, 0xc09f6c3f00, 0x407b700, 0xc0551ec320, 0xffffffffffffff00)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/expression/scalar_function.go:301 +0xb4\ngithub.com/pingcap/tidb/statistics.getMaskAndRanges(0x404ec80, 0xc09f6c3f00, 0xc00d657620, 0x3, 0x3, 0x1, 0x0, 0x0, 0x0, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/statistics/selectivity.go:388 +0x1bd\ngithub.com/pingcap/tidb/statistics.(*HistColl).Selectivity(0xc0f56e8d40, 0x404ec80, 0xc09f6c3f00, 0xc0f56e8d00, 0x3, 0x4, 0xc06c4905c0, 0x3, 0x4, 0x1, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/statistics/selectivity.go:218 +0x4c2\ngithub.com/pingcap/tidb/planner/core.(*DataSource).deriveStatsByFilter(0xc0ff312f00, 0xc0f56e8d00, 0x3, 0x4, 0xc06c4905c0, 0x3, 0x4, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/stats.go:240 +0xae\ngithub.com/pingcap/tidb/planner/core.(*DataSource).DeriveStats(0xc0ff312f00, 0x5f82ce0, 0x0, 0x0, 0xc0551ec1e0, 0x5f82ce0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/stats.go:277 +0x1f3\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).recursiveDeriveStats(0xc0ff312f20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/stats.go:125 +0x2fc\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).recursiveDeriveStats(0xc0ff8f4ca0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/stats.go:118 +0x1a1\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).recursiveDeriveStats(0xc0ff801de0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/gith"]

服务器日志等级是warn,本次出错前后日志中就只有ERROR本身~ 没有出现index out of range的信息。
(不好意思,不太方便发完整日志文件)

[2021/05/22 10:16:08.245 +09:00] [WARN] [client_batch.go:768] ["wait response is cancelled"] [to=172.30.3.77:20160] [cause="context canceled"]
[2021/05/22 11:05:55.726 +09:00] [WARN] [client_batch.go:768] ["wait response is cancelled"] [to=172.30.3.77:20160] [cause="context canceled"]
[2021/05/22 11:15:51.921 +09:00] [WARN] [client_batch.go:768] ["wait response is cancelled"] [to=172.30.3.77:20160] [cause="context canceled"]
[2021/05/22 11:32:10.235 +09:00] [WARN] [client_batch.go:768] ["wait response is cancelled"] [to=172.30.3.77:20160] [cause="context canceled"]
[2021/05/22 11:53:38.650 +09:00] [WARN] [client_batch.go:768] ["wait response is cancelled"] [to=172.30.3.77:20160] [cause="context canceled"]
[2021/05/22 12:09:32.284 +09:00] [WARN] [client_batch.go:768] ["wait response is cancelled"] [to=172.30.3.77:20160] [cause="context canceled"]
[2021/05/22 12:15:16.724 +09:00] [WARN] [client_batch.go:768] ["wait response is cancelled"] [to=172.30.3.77:20160] [cause="context canceled"]
[2021/05/22 12:35:30.853 +09:00] [WARN] [client_batch.go:768] ["wait response is cancelled"] [to=172.30.3.77:20160] [cause="context canceled"]
[2021/05/22 12:57:55.359 +09:00] [WARN] [client_batch.go:768] ["wait response is cancelled"] [to=172.30.3.77:20160] [cause="context canceled"]
[2021/05/22 13:18:39.414 +09:00] [WARN] [client_batch.go:768] ["wait response is cancelled"] [to=172.30.3.77:20160] [cause="context canceled"]
[2021/05/22 13:24:29.085 +09:00] [ERROR] [conn.go:736] ["connection running loop panic"] [conn=364315] [lastSQL="SELECT  wp_6_comments.* FROM wp_6_comments JOIN wp_6_posts ON ( wp_6_comments.comment_post_ID
= wp_6_posts.ID ) WHERE ( post_status = 'publish' OR ( post_status = 'inherit' AND post_type = 'attachment' ) ) AND comment_approved = '1'  ORDER BY comment_date_gmt DESC LIMIT 10"] [err="runtime error: inva
lid memory address or nil pointer dereference"] [stack="goroutine 105123380 [running]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(0x4004660, 0xc1739178c0, 0xc1a802af00)\n\t/home/jenkins/agent/wo
rkspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:734 +0xee\npanic(0x3597a40, 0x59111a0)\n\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb/statis
tics.(*HistColl).Selectivity(0xc02749f700, 0x405dc80, 0xc0256e1180, 0xc0079e4640, 0x1, 0x1, 0xc20006d920, 0x6, 0x6, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.
com/pingcap/tidb/statistics/selectivity.go:245 +0x999\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).constructInnerTableScanTask(0xc19189d180, 0xc026a0ca00, 0xc027623540, 0xc0eb9bda30, 0x1, 0x1, 0x0, 0
x0, 0x3fefffffffffffff, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:915 +0x753\ngithub.com/pingcap/tidb/
planner/core.(*LogicalJoin).buildIndexJoinInner2TableScan(0xc19189d180, 0xc046ffb6c0, 0xc026a0ca00, 0xc0eb9bda28, 0x1, 0x1, 0xc0eb9bda20, 0x1, 0x1, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-bui
ld-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:750 +0x31c\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).getIndexJoinByOuterIdx(0xc19189d180, 0xc046ffb6c0, 0x0,
 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:655 +0x325\ngithub.com/pingcap/tidb/planner/core.(*Log
icalJoin).tryToGetIndexJoin(0xc19189d180, 0xc046ffb6c0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_pla
ns.go:1563 +0xa74\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).exhaustPhysicalPlans(0xc19189d180, 0xc046ffb6c0, 0xc0c4e4a5c0, 0x18, 0x5f98a00, 0xc0079e5280)\n\t/home/jenkins/agent/workspace/optimizat
ion-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:1695 +0x334\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc19189d1a0, 0xc046ffb260, 0x
598c388, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:310 +0x1d5\ngithub.com/pingcap/tidb/planner/
core.(*baseLogicalPlan).enumeratePhysicalPlans4Task(0xc026ab5110, 0xc1c7c317a0, 0x6, 0x6, 0xc046ffafc0, 0xc0079e5200, 0x598c388, 0x10, 0x36b3440, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build
-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:213 +0x70d\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc026ab5110, 0xc046ffaee0, 0x598c388, 0x0, 0x0,
 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:343 +0x32f\ngithub.com/pingcap/tidb/planner/core.(*baseLogical
Plan).enumeratePhysicalPlans4Task(0xc027328e20, 0xc0079e5250, 0x1, 0x1, 0xc046ffae00, 0xc046ffad00, 0xc11aa70220, 0x68, 0x37db3c0, 0xc0270f6300, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-
linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:213 +0x70d\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc027328e20, 0xc046ffad20, 0xc11aa70220, 0x0, 0x0, 0x
0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:343 +0x32f\ngithub.com/pingcap/tidb/planner/core.physicalOptimize
(0x40594a0, 0xc027328e00, 0xc11aa70220, 0x4058fa0, 0xc027328ee0, 0x40594a0, 0xc027328e00, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/o
ptimizer.go:224 +0x131\ngithub.com/pingcap/tidb/planner/core.DoOptimize(0x4004660, 0xc20006d560, 0x405dc80, 0xc0256e1180, 0x18a2, 0x40594a0, 0xc027328e00, 0x0, 0x0, 0x0, ...)\n\t/home/jenkins/agent/workspace
/optimization-build-tidb-linux-amd/go/src/github.com/ping"]
[2021/05/22 13:24:56.099 +09:00] [ERROR] [conn.go:736] ["connection running loop panic"] [conn=364367] [lastSQL="SELECT  wp_6_comments.* FROM wp_6_comments JOIN wp_6_posts ON ( wp_6_comments.comment_post_ID
= wp_6_posts.ID ) WHERE ( post_status = 'publish' OR ( post_status = 'inherit' AND post_type = 'attachment' ) ) AND comment_approved = '1'  ORDER BY comment_date_gmt DESC LIMIT 10"] [err="runtime error: inva
lid memory address or nil pointer dereference"] [stack="goroutine 105127670 [running]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(0x4004660, 0xc0cbbb6f00, 0xc17ba53900)\n\t/home/jenkins/agent/wo
rkspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:734 +0xee\npanic(0x3597a40, 0x59111a0)\n\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb/statis
tics.(*HistColl).Selectivity(0xc04e714200, 0x405dc80, 0xc04b5eb040, 0xc04dbed820, 0x1, 0x1, 0xc1af0ee720, 0x6, 0x6, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.
com/pingcap/tidb/statistics/selectivity.go:245 +0x999\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).constructInnerTableScanTask(0xc03c167880, 0xc04a710c80, 0xc04e67dcc0, 0xc0d6462ef0, 0x1, 0x1, 0x0, 0
x0, 0x3fefffffffffffff, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:915 +0x753\ngithub.com/pingcap/tidb/
planner/core.(*LogicalJoin).buildIndexJoinInner2TableScan(0xc03c167880, 0xc1c2c069a0, 0xc04a710c80, 0xc0d6462ee8, 0x1, 0x1, 0xc0d6462ee0, 0x1, 0x1, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:750 +0x31c\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).getIndexJoinByOuterIdx(0xc03c167880, 0xc1c2c069a0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:655 +0x325\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).tryToGetIndexJoin(0xc03c167880, 0xc1c2c069a0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:1563 +0xa74\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).exhaustPhysicalPlans(0xc03c167880, 0xc1c2c069a0, 0xc051bc11c0, 0x18, 0x5f98a00, 0xc04e74a3f0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:1695 +0x334\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc03c1678a0, 0xc1c2c06770, 0x598c388, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:310 +0x1d5\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).enumeratePhysicalPlans4Task(0xc04e63add0, 0xc04e74c660, 0x6, 0x6, 0xc1c2c065b0, 0xc04e74a300, 0x598c388, 0x10, 0x36b3440, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:213 +0x70d\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc04e63add0, 0xc1c2c06540, 0x598c388, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:343 +0x32f\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).enumeratePhysicalPlans4Task(0xc04c82e1e0, 0xc04e74a3c0, 0x1, 0x1, 0xc1c2c064d0, 0xc1c2c06400, 0xc0d992ba50, 0x68, 0x37db3c0, 0xc04e7d8300, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:213 +0x70d\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc04c82e1e0, 0xc1c2c06460, 0xc0d992ba50, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:343 +0x32f\ngithub.com/pingcap/tidb/planner/core.physicalOptimize(0x40594a0, 0xc04c82e1c0, 0xc0d992ba50, 0x4058fa0, 0xc04c82e2a0, 0x40594a0, 0xc04c82e1c0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:224 +0x131\ngithub.com/pingcap/tidb/planner/core.DoOptimize(0x4004660, 0xc1af0ee360, 0x405dc80, 0xc04b5eb040, 0x18a2, 0x40594a0, 0xc04c82e1c0, 0x0, 0x0, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/ping"]
[2021/05/22 13:25:21.981 +09:00] [WARN] [client_batch.go:768] ["wait response is cancelled"] [to=172.30.3.77:20160] [cause="context canceled"]
[2021/05/22 13:25:36.756 +09:00] [ERROR] [conn.go:736] ["connection running loop panic"] [conn=364459] [lastSQL="SELECT  wp_6_comments.* FROM wp_6_comments JOIN wp_6_posts ON ( wp_6_comments.comment_post_ID = wp_6_posts.ID ) WHERE ( post_status = 'publish' OR ( post_status = 'inherit' AND post_type = 'attachment' ) ) AND comment_approved = '1'  ORDER BY comment_date_gmt DESC LIMIT 10"] [err="runtime error: invalid memory address or nil pointer dereference"] [stack="goroutine 105133808 [running]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(0x4004660, 0xc0b254d950, 0xc0b21b1a00)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/server/conn.go:734 +0xee\npanic(0x3597a40, 0x59111a0)\n\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb/statistics.(*HistColl).Selectivity(0xc0b7ac4880, 0x405dc80, 0xc0b21a5540, 0xc0b761bf10, 0x1, 0x1, 0xc0b772d290, 0x6, 0x6, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/statistics/selectivity.go:245 +0x999\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).constructInnerTableScanTask(0xc0b0dbca80, 0xc0b56d8c80, 0xc0b396c460, 0xc14d97b2e0, 0x1, 0x1, 0x0, 0x0, 0x3fefffffffffffff, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:915 +0x753\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).buildIndexJoinInner2TableScan(0xc0b0dbca80, 0xc0b772be30, 0xc0b56d8c80, 0xc14d97b2d8, 0x1, 0x1, 0xc14d97b2d0, 0x1, 0x1, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:750 +0x31c\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).getIndexJoinByOuterIdx(0xc0b0dbca80, 0xc0b772be30, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:655 +0x325\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).tryToGetIndexJoin(0xc0b0dbca80, 0xc0b772be30, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:1563 +0xa74\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).exhaustPhysicalPlans(0xc0b0dbca80, 0xc0b772be30, 0xc0b7b16540, 0x18, 0x5f98a00, 0xc0b7b08ae0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/exhaust_physical_plans.go:1695 +0x334\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc0b0dbcaa0, 0xc0b772bc00, 0x598c388, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:310 +0x1d5\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).enumeratePhysicalPlans4Task(0xc0b7618a90, 0xc0b7b0d680, 0x6, 0x6, 0xc0b772bab0, 0xc0b7b08a00, 0x598c388, 0x10, 0x36b3440, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:213 +0x70d\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc0b7618a90, 0xc0b772ba40, 0x598c388, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:343 +0x32f\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).enumeratePhysicalPlans4Task(0xc0b6fa78a0, 0xc0b7b08ab0, 0x1, 0x1, 0xc0b772b9d0, 0xc0b772b900, 0xc1475e6410, 0x68, 0x37db3c0, 0xc0b7a72300, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:213 +0x70d\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).findBestTask(0xc0b6fa78a0, 0xc0b772b960, 0xc1475e6410, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/find_best_task.go:343 +0x32f\ngithub.com/pingcap/tidb/planner/core.physicalOptimize(0x40594a0, 0xc0b6fa7880, 0xc1475e6410, 0x4058fa0, 0xc0b6fa7960, 0x40594a0, 0xc0b6fa7880, 0x0)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/planner/core/optimizer.go:224 +0x131\ngithub.com/pingcap/tidb/planner/core.DoOptimize(0x4004660, 0xc0b772ced0, 0x405dc80, 0xc0b21a5540, 0x18a2, 0x40594a0, 0xc0b6fa7880, 0x0, 0x0, 0x0, ...)\n\t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/ping"]

感觉和这个问题也比较相似。
他里面的sql也是 WHERE 后面有跟 OR 的查询逻辑(虽然sql本身写法很奇怪)
https://github.com/pingcap/tidb/issues/23659

看文档里面也说IndexMerge只有OR连接的表达式才生效~~ 供参考~
用 EXPLAIN 查看开启 IndexMerge 的 SQL 执行计划 | PingCAP Docs

现在这个问题有解决吗

1 out of range的错误开始的时候已经通过修改db连接的charset解决了;
2 IndexMerge 问题已经通过关闭 tidb_enable_index_merge 暂时对应了,不过还是希望官方能找到问题所在,后面可以再次打开这个优化~

:+1: 我们也在持续优化这个问题。如果有定位,向您反馈

1赞