kbmmemtable sorton 报错 : List index out of bounds
同一数据集,不同的排序条件,有的可以,但某一条件,却能100%重现报错。
procedure TkbmIndex.InternalFastQuickSort(const L,R:Integer);
var
I,J:integer;
P:PkbmRecord;
begin
if ((R-L)>) then
// if ((R-L)>0) then
begin
I:=(R+L) div ;
if CompareRecords(FIndexFieldList,PkbmRecord(FReferences[L]),PkbmRecord(FReferences[I]),true,false)> then
InternalSwap(L,I);
if CompareRecords(FIndexFieldList,PkbmRecord(FReferences[L]),PkbmRecord(FReferences[R]),true,false)> then
InternalSwap(L,R);
if CompareRecords(FIndexFieldList,PkbmRecord(FReferences[I]),PkbmRecord(FReferences[R]),true,false)> then
InternalSwap(I,R); J:=R-;
InternalSwap(I,J);
I:=L;
P:=PkbmRecord(FReferences[J]);
while true do
begin
Inc(I);
Dec(J);
while CompareRecords(FIndexFieldList,PkbmRecord(FReferences[I]),P,true,false) < do Inc(I);
while CompareRecords(FIndexFieldList,PkbmRecord(FReferences[J]),P,true,false) > 0 do Dec(J);
if (J<I) then break;
InternalSwap(I,J);
end;
InternalSwap(I,R-);
InternalFastQuickSort(L,J);
InternalFastQuickSort(I+,R);
end;
end;
反复跟代码,发现在 kbmMemTable.PAS中,当J减至0时,FReferences[J] 下标越界
试改为FIndexFieldList.Count>0前判断条件却未解决,说明并非是递减原因,改为大于J,未报错,是否有问题,待应用中再关注。
procedure TkbmIndex.InternalFastQuickSort(const L,R:Integer);
var
I,J:integer;
P:PkbmRecord;
begin
if ((R-L)>) then
// if ((R-L)>0) then
begin
I:=(R+L) div ;
if CompareRecords(FIndexFieldList,PkbmRecord(FReferences[L]),PkbmRecord(FReferences[I]),true,false)> then
InternalSwap(L,I);
if CompareRecords(FIndexFieldList,PkbmRecord(FReferences[L]),PkbmRecord(FReferences[R]),true,false)> then
InternalSwap(L,R);
if CompareRecords(FIndexFieldList,PkbmRecord(FReferences[I]),PkbmRecord(FReferences[R]),true,false)> then
InternalSwap(I,R); J:=R-;
InternalSwap(I,J);
I:=L;
P:=PkbmRecord(FReferences[J]);
while true do
begin
Inc(I);
Dec(J);
while CompareRecords(FIndexFieldList,PkbmRecord(FReferences[I]),P,true,false) < do Inc(I);
while (FIndexFieldList.Count>J )and (CompareRecords(FIndexFieldList,PkbmRecord(FReferences[J]),P,true,false) > ) do Dec(J);
if (J<I) then break;
InternalSwap(I,J);
end;
InternalSwap(I,R-);
InternalFastQuickSort(L,J);
InternalFastQuickSort(I+,R);
end;
end;
kbmmemtable sorton 报错 : List index out of bounds的更多相关文章
- git报错之index.lock
当想回退到某个版本的时候,用git reset --hard commit_id,发现报错,原因是.git目录下多了个index.lock文件,可以通过rm命令删除,然后再回退 rm -f ./.gi ...
- Faster RCNN 运行自己的数据,刚开始正常,后来就报错: Index exceeds matrix dimensions. Error in ori_demo (line 114) boxes_cell{i} = [boxes(:, (1+(i-1)*4):(i*4)), scores(:, i)];
function script_faster_rcnn_demo() close all; clc; clear mex; clear is_valid_handle; % to clear init ...
- 踩坑记录-nuxt引入vuex报错store/index.js should export a method that returns a Vuex instance.
错误 store/index.js代码如下: import Vue from 'vue'; import Vuex from 'vuex'; import city from './moudle/ci ...
- jdbcTemplate异常:like模糊查询报错(Parameter index out of range (1 > number of parameters)
http://cuisuqiang.iteye.com/blog/1480525 模糊查询like要这样写 注意Object参数和like语法 public static void main( ...
- vue打包后刷新页面报错:Unexpected token <
前言 今天遇到了一个很怪的问题,在vue-cli+webpack的项目中,刷新特定页面后页面会变空白,报错为index.html文件中Unexpected token <. 怪点一是开发环境没有 ...
- Maven新建webapp项目index.jsp报错
最近用eclipse新建了一个maven项目,结果刚新建完成index.jsp页面就报错了,先把错误信息贴出来看看 后来就找资料,结果发现两种解决办法,希望可以帮助用得上的人! 第一种:直接在pom. ...
- 报错:org.apache.jasper.JasperException: /index.jsp (line: 1, column: 17) equal symbol expected
现象:写了如下一个jsp文件,导入需要用到的两个包: 运行结果报错:org.apache.jasper.JasperException: /index.jsp (line: 1, column: 17 ...
- mongodb 查询时没有索引报错(too much data for sort() with no index)
报错信息: .... too much data for sort() with no index.... 给对应排序字段加索引就OK 了... 在对应"表"名上,右键--> ...
- eclipse里index.jsp头部报错的原因和解决方法
index.jsp的头<%@这句报错的话,是因为没有引入Tomcat的原因.解决:A:Window---Preferences---server---RuntimeEnviroments--Ad ...
随机推荐
- Linux系统的命令应该如何记?
Linux入门篇: 很多刚入门的同学,就像无头的苍蝇一样,到处找视频.书籍.网站帖子之类的学习方式,视频虽然讲得详细,但是时间的投入也是巨大的,播放时间,练习时间,加起来很吓人,其实啊很少有人能坚持把 ...
- body里面的onload和window.onload,window.load的区别
区别:body里面的onload是在“页面加载完成后执行的动作”window里面的onload是在“页面加载时执行的动作” window.load这个应该只是表明事件方法,但并未执行,比如click表 ...
- 精心调制的Bash主题分享
第一个是米色背景, 一样遵守蓝色为目录的习惯, 字体为浅灰色,代码和终端看起来相对比较清晰 第二个则是 深海蓝的背景风格,字体都选择饱和度较高的颜色,如下图 终端 配置方法,这里以 mintty 也就 ...
- Zookeeper节点增删改查与集群搭建(笔记)
1.上传文件目录说明 上传的文件一般放在 /home/下 安装文件一般在 /usr/local/下 2. 安装zookeeper 2.1将zookeeper-3.4.11.tar.gz拷贝到/home ...
- 工程经验记录yolo框下移引发的思考
事件叙述: 缘起:yolo检测框,在项目开始之前由于在一些场景下观察到yolo的框在大车检测的时候,回归的位置不好,一些车辆的尾部会被漏掉,特别是车牌部分,恰好被框在外面的时候,在后续就无法进行车牌检 ...
- jmeter断言接口响应字段大小
一,有时候断言需要判断接口返回某个字段值是否大于或者小于预期值,此时断言需要用到BeanShell断言 写法如下: import com.alibaba.fastjson.JSONObject; // ...
- linux系统执行mysql脚本:Can't connect to local MySQL server through socket '/tmp/mysql.sock'
问题原因:系统找不到临时文件夹下的.sock文件了 解决办法:看一下是不是其他目录下有mysl的.sock文件,使用命令指定到该文件 mysql --socket=/home/mysql/mysql- ...
- @RequestParam @PathVariable
1.Request参数 在访问各种各样网站时,经常会发现网站的URL的最后一部分形如:?xxxx=yyyy&zzzz=wwww.这就是HTTP协议中的Request参数,它有什么用呢?先来看一 ...
- 在win7上跑基于任少卿作者代码修改的RPN+BF实验
1.前言 之前在win10上成功的跑起来faster-rcnn的实验,并且跑了一下CaltechPedestrian的数据集,但是效果一直不理想,折腾了好久也没弄清楚到底原因出在哪里,直到读了Is F ...
- windows slaver 脚本执行xcopy 报错无效驱动器规格
jenkins上配置的windows slaver机器如下: 我用这台windows 机器作为slaver机器来编译pc的exe包,但是在最后归档包倒ftp上时报错,如下: 但是我直接在windows ...