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 ...
随机推荐
- java_基础_abstract抽象关键字
java中,当父类中的某些东西不确定时,可以用abstract关键字将此类变成抽象类(也就是说类并不完整,有些东西要等待子类去实现) 注意事项: 1.抽象类中的抽象方法不能有实体,格式如下 publi ...
- keras,tensorflow,numpy,jupyter
docker-tensorflow:https://segmentfault.com/a/1190000015053704 pip install scipy pip install keras do ...
- 4. Scala程序流程控制
4.1 程序流程控制说明 在程序中,程序运行的流程控制决定程序是如何执行的,是我们必须掌握的,主要有三大流程控制语句,顺序控制,粉质控制,循环控制 温馨提示:Scala语言中控制结构和Java语言中的 ...
- Tengine+Lua+GraphicsMagick
狂神声明 : 文章均为自己的学习笔记 , 转载一定注明出处 ; 编辑不易 , 防君子不防小人~共勉 ! 使用 Tengine+Lua+GraphicsMagick 实现图片自动裁剪缩放 需求 : 图片 ...
- odoo 响应下载文件
odoo中如何实现点击按钮下载文件报告.报表到页面左下角 models.py # -*- coding: utf-8 -*-from openerp import models, fields, ap ...
- flex总结一下
display:flex:规定元素是flex布局,里面的元素自然会像浮动一样横向排列: flex-direction:row | row-reverse | column | column-rever ...
- vue-cli 创建项目失败
vue-cli 创建一个vue项目报错 npm code 404. 尝试解决方法都有,我是第3种方法生效 更新npm 重新安装nodejs vue-cli@3.0.1 在创建项目的时候,不能开启其他v ...
- 2018-2019-2 网络对抗技术 20165236 Exp2 后门原理与实践
2018-2019-2 网络对抗技术 20165236 Exp2 后门原理与实践 一.实验内容 (3.5分) (1)使用netcat获取主机操作Shell,cron启动 (0.5分) (2)使用soc ...
- 小程序 滚动wx.pageScrollTo
API:https://developers.weixin.qq.com/miniprogram/dev/api/wx.pageScrollTo.html wx.pageScrollTo 在小程序的开 ...
- 学习animation、transition、transform和@keyframes的使用
当我们需要给页面添加动画效果时,需要用到CSS3的animation样式属性: 例如: animation: test 2s infinite; 其中test是动画的名称,2s是动画的时长,infin ...