执行update语句报错:1105 - runtime error: index out of range [0] with length 0

执行简单的update语句时报1105 - runtime error: index out of range [0] with length 0错误:
update xxxx set ISPUBLIC=0 where ID=‘4823c1eb-83f4-4466-8740-8110b1e8a80d’

update xxxx set ISPUBLIC=0 where ID=‘4823c1eb-83f4-4466-8740-8110b1e8a80d’

1105 - runtime error: index out of range [0] with length 0
时间: 0.12s

TiDB版本:5.7.25-TiDB-v4.0.8

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

1 个赞

可以提供下建表语句和可以复现的数据么

CREATE TABLE xxxx (
orgid char(36) NOT NULL,
catalogno varchar(50) NOT NULL,
catalogname varchar(50) NOT NULL,
parentname varchar(50) DEFAULT NULL,
parentid char(36) DEFAULT NULL,
description varchar(400) DEFAULT NULL,
catalogroutingnumber varchar(800) NOT NULL,
knowledgecount decimal(38,0) DEFAULT 0,
orderindex decimal(38,0) NOT NULL DEFAULT 100,
createuserid char(36) DEFAULT NULL,
isdeleted decimal(1,0) NOT NULL,
createusername varchar(50) NOT NULL,
createdate datetime NOT NULL,
updateuserid char(36) DEFAULT NULL,
updateusername varchar(50) NOT NULL,
updatedate datetime NOT NULL,
knowledgecatalogtype varchar(400) DEFAULT NULL,
knowledgecatalogtypename varchar(400) DEFAULT NULL,
checkuserid char(36) DEFAULT NULL,
checkusername varchar(20) DEFAULT NULL,
suitablepositionnames varchar(400) DEFAULT NULL,
suitablepositionids varchar(400) DEFAULT NULL,
suitableskillnames varchar(400) DEFAULT NULL,
suitableskillids varchar(400) DEFAULT NULL,
permissiondescription varchar(800) DEFAULT NULL,
readpermission varchar(50) DEFAULT NULL,
readroleids varchar(2000) DEFAULT NULL,
readrolenames varchar(2000) DEFAULT NULL,
downloadpermission varchar(50) DEFAULT NULL,
downloadroleids varchar(2000) DEFAULT NULL,
downloadrolenames varchar(2000) DEFAULT NULL,
copysourceid char(36) DEFAULT NULL,
isaddknowledgetosearch decimal(1,0) DEFAULT 0,
questioncount decimal(18,2) DEFAULT 0,
catalogemail varchar(256) DEFAULT NULL,
isforcedpermission decimal(1,0) DEFAULT 0,
subsidiaryid char(36) DEFAULT NULL,
subsidiaryname varchar(50) DEFAULT NULL,
maintainpermission varchar(2000) DEFAULT NULL,
maintainpermissiondescription varchar(2000) DEFAULT NULL,
dispatchpermission varchar(2000) DEFAULT NULL,
dispatchpermissiondescription varchar(2000) DEFAULT NULL,
checkpermission varchar(2000) DEFAULT NULL,
checkpermissiondescription varchar(2000) DEFAULT NULL,
isneedcheck decimal(1,0) DEFAULT 0,
questionallcount decimal(38,0) DEFAULT 0,
knowledgequestionallcount decimal(38,0) DEFAULT 0,
knowledgequestioncount decimal(38,0) DEFAULT 0,
documentallcount decimal(38,0) DEFAULT 0,
documentcount decimal(38,0) DEFAULT 0,
articleallcount decimal(38,0) DEFAULT 0,
articlecount decimal(38,0) DEFAULT 0,
courseallcount decimal(38,0) DEFAULT 0,
coursecount decimal(38,0) DEFAULT 0,
videoallcount decimal(38,0) DEFAULT 0,
videocount decimal(38,0) DEFAULT 0,
knowledgeallcount decimal(38,0) DEFAULT 0,
sourcecodecount decimal(38,0) DEFAULT 0,
sourcecodeallcount decimal(38,0) DEFAULT 0,
catalogemailpassword varchar(50) DEFAULT NULL,
isdisplayindex decimal(1,0) DEFAULT 1,
industrytemplateids varchar(2000) DEFAULT NULL,
pigeonholepermission varchar(2000) DEFAULT NULL,
pigeonholepermissiondes varchar(2000) DEFAULT NULL,
industrytemplateid char(36) DEFAULT NULL,
industrytemplatename varchar(50) DEFAULT NULL,
isaddprefix decimal(1,0) DEFAULT 0,
prefixname varchar(20) DEFAULT NULL,
isaddsuffix decimal(1,0) DEFAULT 0,
suffixformat decimal(38,0) DEFAULT 0,
expandfield1 varchar(50) DEFAULT NULL,
expandfield2 varchar(20) DEFAULT NULL,
setpermissionstage decimal(38,0) DEFAULT 0,
lastsetpermissiondate datetime DEFAULT NULL,
attentioncount decimal(38,0) DEFAULT 0,
xuanyescount decimal(38,0) DEFAULT NULL,
xuanyesallcount decimal(38,0) DEFAULT NULL,
permissioncatalogid char(36) DEFAULT NULL,
permissioncontrolmode decimal(38,0) DEFAULT 0,
childpermissioncontrolmode decimal(38,0) DEFAULT 0,
id char(36) NOT NULL,
ispublic decimal(1,0) DEFAULT NULL,
ordertype decimal(2,0) DEFAULT -1,
wkmatchcatalog decimal(1,0) DEFAULT NULL,
cid int(11) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

查询这个ID: select * from xxxx where ID=‘4823c1eb-83f4-4466-8740-8110b1e8a80d’ 也报相同的错误

select * from xxxx 报如下错误:

1105 - Unsupported datum flag 2 for Decimal vector
时间: 0.118s

查了一下,好像是tidb的bug

https://github.com/pingcap/tidb/issues/16156

https://github.com/tikv/tikv/issues/8769

1 个赞

嗯呢,也有可能,看看能否升级解决问题,或者规避下,看看这个有没有帮助

CREATE TABLE abc (
id char(36) NOT NULL,
ispublic decimal(1,0) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

insert into abc values(‘4823c1eb-83f4-4466-8740-8110b1e8a80d’,1);

你看这种测试你会不会有问题,我这样是没有问题的,版本4.0.13

我重建表,重新导入数据了,新表已经没问题

好的:+1:

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。