【 TiDB 使用环境】 测试
【 TiDB 版本】 5.7.25-TiDB-v7.1.3
执行如下语句报错: index out of range [0] with length 0
SELECT
*
FROM
task_detail_attr
as a
LEFT JOIN task_detail_data AS b ON a.detailId = b.detailId
WHERE 1 AND a.createTime >= ‘2023-12-15’ ORDER BY a.createTime DESC LIMIT 0, 10
两个表都是分区表,如下结构:
– amazon.task_detail_attr definition
CREATE TABLE task_detail_attr
(
finishTime
datetime NOT NULL DEFAULT ‘2000-01-01 00:00:00’ COMMENT ‘完成时间(新数据时间为 2000-01-01)’,
detailId
char(50) COLLATE utf8mb4_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘任务数据ID’,
platformSku
char(50) COLLATE utf8mb4_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘平台sku’,
itemId
char(50) COLLATE utf8mb4_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘itemId’,
type
char(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘类型(publish:刊登,listing:在线)’,
sku
char(50) COLLATE utf8mb4_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘sku编码’,
accountCode
char(10) COLLATE utf8mb4_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘销售账号编码’,
platformCode
char(2) COLLATE utf8mb4_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘平台编码’,
operate
char(50) COLLATE utf8mb4_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘操作类型’,
taskId
char(100) COLLATE utf8mb4_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘关联任务id’,
status
int(10) unsigned NOT NULL DEFAULT ‘0’ COMMENT ‘状态(10初始化,20待执行,30执行中,60已完成,100已取消)’,
hasError
tinyint(3) unsigned NOT NULL DEFAULT ‘0’ COMMENT ‘是否有问题(0:否,1:是)’,
isPause
tinyint(3) unsigned NOT NULL DEFAULT ‘0’ COMMENT ‘是否暂停(0:否,1:是)’,
key
char(50) COLLATE utf8mb4_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘操作数据的唯一id’,
createTime
datetime NOT NULL DEFAULT ‘2000-01-01 00:00:00’ COMMENT ‘创建时间’,
updateTime
datetime NOT NULL DEFAULT ‘2000-01-01 00:00:00’ COMMENT ‘更新时间’,
createUser
char(50) COLLATE utf8mb4_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘创建人’,
updateUser
char(50) COLLATE utf8mb4_general_ci NOT NULL DEFAULT ‘’ COMMENT ‘更新人’,
PRIMARY KEY (finishTime
,detailId
) /*T![clustered_index] CLUSTERED */,
KEY idx_platformSku
(platformSku
),
KEY idx_createTime
(createTime
),
KEY idx_itemId
(itemId
),
KEY idx_accountCode
(accountCode
,operate
,status
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT=‘任务数据属性表’
PARTITION BY RANGE (TO_DAYS(finishTime
))
(PARTITION p0
VALUES LESS THAN (736695),
PARTITION p1
VALUES LESS THAN (736726),
PARTITION p2
VALUES LESS THAN (736754),
PARTITION p3
VALUES LESS THAN (736785),
PARTITION p4
VALUES LESS THAN (736815),
PARTITION p5
VALUES LESS THAN (736846),
PARTITION p6
VALUES LESS THAN (736876),
PARTITION p7
VALUES LESS THAN (736907),
PARTITION p8
VALUES LESS THAN (736938),
PARTITION p9
VALUES LESS THAN (736968),
PARTITION p10
VALUES LESS THAN (736999),
PARTITION p11
VALUES LESS THAN (737029),
PARTITION p12
VALUES LESS THAN (737060),
PARTITION p13
VALUES LESS THAN (737091),
PARTITION p14
VALUES LESS THAN (737119),
PARTITION p15
VALUES LESS THAN (737150),
PARTITION p16
VALUES LESS THAN (737180),
PARTITION p17
VALUES LESS THAN (737211),
PARTITION p18
VALUES LESS THAN (737241),
PARTITION p19
VALUES LESS THAN (737272),
PARTITION p20
VALUES LESS THAN (737303),
PARTITION p21
VALUES LESS THAN (737333),
PARTITION p22
VALUES LESS THAN (737364),
PARTITION p23
VALUES LESS THAN (737394),
PARTITION p24
VALUES LESS THAN (737425),
PARTITION p25
VALUES LESS THAN (737456),
PARTITION p26
VALUES LESS THAN (737484),
PARTITION p27
VALUES LESS THAN (737515),
PARTITION p28
VALUES LESS THAN (737545),
PARTITION p29
VALUES LESS THAN (737576),
PARTITION p30
VALUES LESS THAN (737606),
PARTITION p31
VALUES LESS THAN (737637),
PARTITION p32
VALUES LESS THAN (737668),
PARTITION p33
VALUES LESS THAN (737698),
PARTITION p34
VALUES LESS THAN (737729),
PARTITION p35
VALUES LESS THAN (737759),
PARTITION p36
VALUES LESS THAN (737790),
PARTITION p37
VALUES LESS THAN (737821),
PARTITION p38
VALUES LESS THAN (737850),
PARTITION p39
VALUES LESS THAN (737881),
PARTITION p40
VALUES LESS THAN (737911),
PARTITION p41
VALUES LESS THAN (737942),
PARTITION p42
VALUES LESS THAN (737972),
PARTITION p43
VALUES LESS THAN (738003),
PARTITION p44
VALUES LESS THAN (738034),
PARTITION p45
VALUES LESS THAN (738064),
PARTITION p46
VALUES LESS THAN (738095),
PARTITION p47
VALUES LESS THAN (738125),
PARTITION p48
VALUES LESS THAN (738156),
PARTITION p49
VALUES LESS THAN (738187),
PARTITION p50
VALUES LESS THAN (738215),
PARTITION p51
VALUES LESS THAN (738246),
PARTITION p52
VALUES LESS THAN (738276),
PARTITION p53
VALUES LESS THAN (738307),
PARTITION p54
VALUES LESS THAN (738337),
PARTITION p55
VALUES LESS THAN (738368),
PARTITION p56
VALUES LESS THAN (738399),
PARTITION p57
VALUES LESS THAN (738429),
PARTITION p58
VALUES LESS THAN (738460),
PARTITION p59
VALUES LESS THAN (738490),
PARTITION p60
VALUES LESS THAN (738521),
PARTITION p61
VALUES LESS THAN (738552),
PARTITION p62
VALUES LESS THAN (738580),
PARTITION p63
VALUES LESS THAN (738611),
PARTITION p64
VALUES LESS THAN (738641),
PARTITION p65
VALUES LESS THAN (738672),
PARTITION p66
VALUES LESS THAN (738702),
PARTITION p67
VALUES LESS THAN (738733),
PARTITION p68
VALUES LESS THAN (738764),
PARTITION p69
VALUES LESS THAN (738794),
PARTITION p70
VALUES LESS THAN (738825),
PARTITION p71
VALUES LESS THAN (738855),
PARTITION p72
VALUES LESS THAN (738886),
PARTITION p73
VALUES LESS THAN (738917),
PARTITION p74
VALUES LESS THAN (738945),
PARTITION p75
VALUES LESS THAN (738976),
PARTITION p76
VALUES LESS THAN (739006),
PARTITION p77
VALUES LESS THAN (739037),
PARTITION p78
VALUES LESS THAN (739067),
PARTITION p79
VALUES LESS THAN (739098),
PARTITION p80
VALUES LESS THAN (739129),
PARTITION p81
VALUES LESS THAN (739159),
PARTITION p82
VALUES LESS THAN (739190),
PARTITION p83
VALUES LESS THAN (739220),
PARTITION p84
VALUES LESS THAN (739251),
PARTITION p85
VALUES LESS THAN (739282),
PARTITION p86
VALUES LESS THAN (739311),
PARTITION p87
VALUES LESS THAN (739342),
PARTITION p88
VALUES LESS THAN (739372),
PARTITION p89
VALUES LESS THAN (739403),
PARTITION p90
VALUES LESS THAN (739433),
PARTITION p91
VALUES LESS THAN (739464),
PARTITION p92
VALUES LESS THAN (739495),
PARTITION p93
VALUES LESS THAN (739525),
PARTITION p94
VALUES LESS THAN (739556),
PARTITION p95
VALUES LESS THAN (739586),
PARTITION p96
VALUES LESS THAN (739617),
PARTITION p97
VALUES LESS THAN (739648),
PARTITION p98
VALUES LESS THAN (739676),
PARTITION p99
VALUES LESS THAN (739707),
PARTITION p100
VALUES LESS THAN (739737),
PARTITION p101
VALUES LESS THAN (739768),
PARTITION p102
VALUES LESS THAN (739798),
PARTITION p103
VALUES LESS THAN (739829),
PARTITION p104
VALUES LESS THAN (739860),
PARTITION p105
VALUES LESS THAN (739890),
PARTITION p106
VALUES LESS THAN (739921),
PARTITION p107
VALUES LESS THAN (739951),
PARTITION p108
VALUES LESS THAN (739982),
PARTITION p109
VALUES LESS THAN (740013),
PARTITION p110
VALUES LESS THAN (740041),
PARTITION p111
VALUES LESS THAN (740072),
PARTITION p112
VALUES LESS THAN (740102),
PARTITION p113
VALUES LESS THAN (740133),
PARTITION p114
VALUES LESS THAN (740163),
PARTITION p115
VALUES LESS THAN (740194),
PARTITION p116
VALUES LESS THAN (740225),
PARTITION p117
VALUES LESS THAN (740255),
PARTITION p118
VALUES LESS THAN (740286),
PARTITION p119
VALUES LESS THAN (740316),
PARTITION p120
VALUES LESS THAN (740347),
PARTITION p121
VALUES LESS THAN (740378),
PARTITION p122
VALUES LESS THAN (740406),
PARTITION p123
VALUES LESS THAN (740437),
PARTITION p124
VALUES LESS THAN (740467),
PARTITION p125
VALUES LESS THAN (740498),
PARTITION p126
VALUES LESS THAN (740528),
PARTITION p127
VALUES LESS THAN (740559),
PARTITION p128
VALUES LESS THAN (740590),
PARTITION p129
VALUES LESS THAN (740620),
PARTITION p130
VALUES LESS THAN (740651),
PARTITION p131
VALUES LESS THAN (740681),
PARTITION p132
VALUES LESS THAN (740712),
PARTITION p133
VALUES LESS THAN (740743),
PARTITION p134
VALUES LESS THAN (740772),
PARTITION p135
VALUES LESS THAN (740803),
PARTITION p136
VALUES LESS THAN (740833),
PARTITION p137
VALUES LESS THAN (740864),
PARTITION p138
VALUES LESS THAN (740894),
PARTITION p139
VALUES LESS THAN (740925),
PARTITION p140
VALUES LESS THAN (740956),
PARTITION p141
VALUES LESS THAN (740986),
PARTITION p142
VALUES LESS THAN (741017),
PARTITION p143
VALUES LESS THAN (741047),
PARTITION p144
VALUES LESS THAN (741078),
PARTITION p145
VALUES LESS THAN (741109),
PARTITION p146
VALUES LESS THAN (741137),
PARTITION p147
VALUES LESS THAN (741168),
PARTITION p148
VALUES LESS THAN (741198),
PARTITION p149
VALUES LESS THAN (741229),
PARTITION p150
VALUES LESS THAN (741259),
PARTITION p151
VALUES LESS THAN (741290),
PARTITION p152
VALUES LESS THAN (741321),
PARTITION p153
VALUES LESS THAN (741351),
PARTITION p154
VALUES LESS THAN (741382),
PARTITION p155
VALUES LESS THAN (741412),
PARTITION p156
VALUES LESS THAN (741443),
PARTITION p157
VALUES LESS THAN (741474),
PARTITION p158
VALUES LESS THAN (741502),
PARTITION p159
VALUES LESS THAN (741533),
PARTITION p160
VALUES LESS THAN (741563),
PARTITION p161
VALUES LESS THAN (741594),
PARTITION p162
VALUES LESS THAN (741624),
PARTITION p163
VALUES LESS THAN (741655),
PARTITION p164
VALUES LESS THAN (741686),
PARTITION p165
VALUES LESS THAN (741716),
PARTITION p166
VALUES LESS THAN (741747),
PARTITION p167
VALUES LESS THAN (741777),
PARTITION p168
VALUES LESS THAN (741808),
PARTITION p169
VALUES LESS THAN (741839),
PARTITION p170
VALUES LESS THAN (741867),
PARTITION p171
VALUES LESS THAN (741898),
PARTITION p172
VALUES LESS THAN (741928),
PARTITION p173
VALUES LESS THAN (741959),
PARTITION p174
VALUES LESS THAN (741989),
PARTITION p175
VALUES LESS THAN (742020),
PARTITION p176
VALUES LESS THAN (742051),
PARTITION p177
VALUES LESS THAN (742081),
PARTITION p178
VALUES LESS THAN (742112),
PARTITION p179
VALUES LESS THAN (742142),
PARTITION p180
VALUES LESS THAN (742173),
PARTITION p181
VALUES LESS THAN (742204),
PARTITION p182
VALUES LESS THAN (742233),
PARTITION p183
VALUES LESS THAN (742264),
PARTITION p184
VALUES LESS THAN (742294),
PARTITION p185
VALUES LESS THAN (742325),
PARTITION p186
VALUES LESS THAN (742355),
PARTITION p187
VALUES LESS THAN (742386),
PARTITION p188
VALUES LESS THAN (742417),
PARTITION p189
VALUES LESS THAN (742447),
PARTITION p190
VALUES LESS THAN (742478),
PARTITION p191
VALUES LESS THAN (742508),
PARTITION p192
VALUES LESS THAN (742539),
PARTITION p193
VALUES LESS THAN (742570),
PARTITION p194
VALUES LESS THAN (742598),
PARTITION p195
VALUES LESS THAN (742629),
PARTITION p196
VALUES LESS THAN (742659),
PARTITION p197
VALUES LESS THAN (742690),
PARTITION p198
VALUES LESS THAN (742720),
PARTITION p199
VALUES LESS THAN (742751),
PARTITION p200
VALUES LESS THAN (742782),
PARTITION p201
VALUES LESS THAN (742812),
PARTITION p202
VALUES LESS THAN (742843),
PARTITION p203
VALUES LESS THAN (742873),
PARTITION p204
VALUES LESS THAN (742904),
PARTITION p205
VALUES LESS THAN (742935),
PARTITION p206
VALUES LESS THAN (742963),
PARTITION p207
VALUES LESS THAN (742994),
PARTITION p208
VALUES LESS THAN (743024),
PARTITION p209
VALUES LESS THAN (743055),
PARTITION p210
VALUES LESS THAN (743085),
PARTITION p211
VALUES LESS THAN (743116),
PARTITION p212
VALUES LESS THAN (743147),
PARTITION p213
VALUES LESS THAN (743177),
PARTITION p214
VALUES LESS THAN (743208),
PARTITION p215
VALUES LESS THAN (743238),
PARTITION p216
VALUES LESS THAN (743269),
PARTITION p217
VALUES LESS THAN (743300),
PARTITION p218
VALUES LESS THAN (743328),
PARTITION p219
VALUES LESS THAN (743359),
PARTITION p220
VALUES LESS THAN (743389),
PARTITION p221
VALUES LESS THAN (743420),
PARTITION p222
VALUES LESS THAN (743450),
PARTITION p223
VALUES LESS THAN (743481),
PARTITION p224
VALUES LESS THAN (743512),
PARTITION p225
VALUES LESS THAN (743542),
PARTITION p226
VALUES LESS THAN (743573),
PARTITION p227
VALUES LESS THAN (743603),
PARTITION p228
VALUES LESS THAN (743634),
PARTITION p229
VALUES LESS THAN (743665),
PARTITION p230
VALUES LESS THAN (743694),
PARTITION p231
VALUES LESS THAN (743725),
PARTITION p232
VALUES LESS THAN (743755),
PARTITION p233
VALUES LESS THAN (743786),
PARTITION p234
VALUES LESS THAN (743816),
PARTITION p235
VALUES LESS THAN (743847),
PARTITION p236
VALUES LESS THAN (743878),
PARTITION p237
VALUES LESS THAN (743908),
PARTITION p238
VALUES LESS THAN (743939),
PARTITION p239
VALUES LESS THAN (743969),
PARTITION p240
VALUES LESS THAN (744000),
PARTITION p241
VALUES LESS THAN (744031),
PARTITION p242
VALUES LESS THAN (744059),
PARTITION p243
VALUES LESS THAN (744090),
PARTITION p244
VALUES LESS THAN (744120),
PARTITION p245
VALUES LESS THAN (744151),
PARTITION p246
VALUES LESS THAN (744181),
PARTITION p247
VALUES LESS THAN (744212),
PARTITION p248
VALUES LESS THAN (744243),
PARTITION p249
VALUES LESS THAN (MAXVALUE));
单个表执行select * from table limit 0,10 不会报错,
这个关联SQL指定字段查询不会报错
这个版本第一次执行SQL等待了50多秒出来了结果,后面查询都是报错:index out of range [0] with length 0