同一数据集,不同的排序条件,有的可以,但某一条件,却能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. react路由

    针对多个列表导航公用一个组建,然后 有两种路由方式 1.import {HashRouter as Router,Route,Link} from 'react-router-dom' 不过这个路由中 ...

  2. checkbox 用css改变默认的样式

    <!--html--> <label class="bl_input_checkbox click_checkbox" che_data="10&quo ...

  3. 一个简单的分布式session框架

    该代码只是用来学习原理的,有很多不完善之处. 代码:  git@github.com:sicw/EasySpringSession.git 一. 整体设置 1. 实现Filter,封装新的reques ...

  4. 关于JDBC的批量操作executeBatch()所引发sql语句异常

    java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that correspon ...

  5. PHP 简易聊天室 利用redis的订阅发布功能

    demo:http://www.200ok.fun:8083/api/chat/list 前言:这个种方式太耗redis连接数,每次订阅都会新起一个进程,仅供练手使用,切勿用于生产环境. 原理:1.P ...

  6. Tengine+Lua+GraphicsMagick

    狂神声明 : 文章均为自己的学习笔记 , 转载一定注明出处 ; 编辑不易 , 防君子不防小人~共勉 ! 使用 Tengine+Lua+GraphicsMagick 实现图片自动裁剪缩放 需求 : 图片 ...

  7. Exp3 免杀原理与实践 20164320 王浩

    一.实验内容 1.1 正确使用msf编码器(0.5分),msfvenom生成如jar之类的其他文件(0.5分),veil-evasion(0.5分),加壳工具(0.5分),使用shellcode编程( ...

  8. Python001-操作MSSQL(Microsoft sql server)基础示例(一)

    Python操作mssql server数据库可以通过pymssql或pyodbc实现的.此文以pymssql为例.Python操作MSSQL基本操作步骤如下所示: 获取数据库连接Connection ...

  9. kubernetes安装

    本文主要参考自: https://blog.csdn.net/real_myth/article/details/78719244 还有一份更适合在生产环境使用的超强高可用(多master,nginx ...

  10. matlab工作空间数据导入simulink

    使用的是其中一种方式: 第一步在工作命令区  ,写命令: 第二步:保证导入simulink区,及from worker设置:  其中注意设置你的采样时间, 第三步设置scop  : 采样时承接数据线上 ...