同一数据集,不同的排序条件,有的可以,但某一条件,却能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的更多相关文章

  1. git报错之index.lock

    当想回退到某个版本的时候,用git reset --hard commit_id,发现报错,原因是.git目录下多了个index.lock文件,可以通过rm命令删除,然后再回退 rm -f ./.gi ...

  2. 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 ...

  3. 踩坑记录-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 ...

  4. jdbcTemplate异常:like模糊查询报错(Parameter index out of range (1 > number of parameters)

    http://cuisuqiang.iteye.com/blog/1480525   模糊查询like要这样写 注意Object参数和like语法   public static void main( ...

  5. vue打包后刷新页面报错:Unexpected token <

    前言 今天遇到了一个很怪的问题,在vue-cli+webpack的项目中,刷新特定页面后页面会变空白,报错为index.html文件中Unexpected token <. 怪点一是开发环境没有 ...

  6. Maven新建webapp项目index.jsp报错

    最近用eclipse新建了一个maven项目,结果刚新建完成index.jsp页面就报错了,先把错误信息贴出来看看 后来就找资料,结果发现两种解决办法,希望可以帮助用得上的人! 第一种:直接在pom. ...

  7. 报错:org.apache.jasper.JasperException: /index.jsp (line: 1, column: 17) equal symbol expected

    现象:写了如下一个jsp文件,导入需要用到的两个包: 运行结果报错:org.apache.jasper.JasperException: /index.jsp (line: 1, column: 17 ...

  8. mongodb 查询时没有索引报错(too much data for sort() with no index)

    报错信息: .... too much data for sort() with no index.... 给对应排序字段加索引就OK 了... 在对应"表"名上,右键--> ...

  9. eclipse里index.jsp头部报错的原因和解决方法

    index.jsp的头<%@这句报错的话,是因为没有引入Tomcat的原因.解决:A:Window---Preferences---server---RuntimeEnviroments--Ad ...

随机推荐

  1. 微信小程序里如何用阿里云上传视频,图片。。

    纯手写,踩了半天多的坑干出来了... 网上也有对于阿里云如何在微信小程序里使用,但是很不全,包括阿里云文档的最佳实践里. 话不多说上代码了. upvideo(){ var aliOssParams = ...

  2. DevPress GridControl的使用

      XtraGrid使用方法 XtraGrid的关键类就是:GridControl和GridView.GridControl本身不显示数据,数据都是显示在GridView/CardView/XXXXV ...

  3. Ehcache 3.7文档—基础篇—GettingStarted

    为了使用Ehcache,你需要配置CacheManager和Cache,有两种方式可以配置java编程配置或者XML文件配置 一. 通过java编程配置 CacheManager cacheManag ...

  4. CentOS / RHEL 7 : How to setup yum repository using locally mounted DVD

    1. Mount the RHEL 7 installation media ISO to some directory. For example /mnt : # mount -o loop rhe ...

  5. F#周报2019年第16期

    新闻 Ionide试验版本 FSharp路线图介绍 Blazor官方预览 .NET Framework 4.8发布 .NET Core 3 Preview 4发布 需要来自FSharp.Data.Sq ...

  6. Pycharm 自定义文件模板

    Pycharm 自定义文件模板 每次新建文件都有相同的代码框架,每次重复敲浪费了程序员的寿命啊 按照下面方式自定义自己的模板:

  7. 常用Java技术社区

      Java生态圈知识链: 求职平台 阿里巴巴社招平台 杭州网易社招平台 微店社招平台 银联社招平台 百度社招平台 Java生态圈知识链: 个人优秀博客 腾讯_运维工程师_刘天斯 阿里_Android ...

  8. pc端字体大小自适应几种方法

    $(window).resize(function ()// 绑定到窗口的这个事件中 {  var whdef = 100/1920;// 表示1920的设计图,使用100PX的默认值  var wH ...

  9. Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

    很长的报错,截取   ERROR c.a.d.p.DruidDataSource - discard connection   com.mysql.jdbc.exceptions.jdbc4.Comm ...

  10. C#设计模式(13)——代理模式(Proxy Pattern)(转)

    一.引言 在软件开发过程中,有些对象有时候会由于网络或其他的障碍,以至于不能够或者不能直接访问到这些对象,如果直接访问对象给系统带来不必要的复杂性,这时候可以在客户端和目标对象之间增加一层中间层,让代 ...