diff -ur qhacc-3.2/ChangeLog qhacc-3.2.1pre/ChangeLog --- qhacc-3.2/ChangeLog 2004-07-31 18:22:29.000000000 -0400 +++ qhacc-3.2.1pre/ChangeLog 2004-08-07 11:15:56.000000000 -0400 @@ -1,3 +1,7 @@ +VERSION 3.2.1 +2004-08-XX + * fixed indexing segfault that affected upgrades, resizing + VERSION 3.2 2004-08-01 * improved auto-completion performance in Transaction Editor Only in qhacc-3.2.1pre: autom4te.cache diff -ur qhacc-3.2/lib/qhacctable.cpp qhacc-3.2.1pre/lib/qhacctable.cpp --- qhacc-3.2/lib/qhacctable.cpp 2004-07-17 14:39:00.000000000 -0400 +++ qhacc-3.2.1pre/lib/qhacctable.cpp 2004-08-07 11:16:01.000000000 -0400 @@ -181,7 +181,6 @@ } void QHaccTable::istopLoad(){ - //if( capacity-size>maxFree ) resizeTo( size+maxFree/2 ); loading=false; std::ostream * str; remake(); @@ -714,9 +713,9 @@ uint QHaccTableIndex::operator[]( uint i ) const { return lookup[i]; } void QHaccTableIndex::remake(){ - uint sizer=data->trows(); // this is total capacity, so we have some empties + lkpsz=data->trows(); // this is total capacity, so we have some empties delete [] lookup; - lookup=new uint[sizer]; + lookup=new uint[lkpsz]; reindex(); } @@ -765,6 +764,11 @@ void QHaccTableIndex::newvalat( uint datapos ){ //cout<<"newvalat "<at( datapos ).toString()<lkpsz ){ + lkpsz=data->trows(); // this is total capacity, so we have some empties + delete [] lookup; + lookup=new uint[lkpsz]; + } fcomp=ftype; ffield=field; @@ -782,77 +786,6 @@ } } -/* -void QHaccTableIndex::qisort( uint lo, uint hi ){ - if( lo>=hi ) return; - uint q=findQ( lo, hi ); - qisort( lo, q ); - qisort( q+1, hi ); -} - -uint QHaccTableIndex::findQ( uint p, uint r ) { - uint pivoti=( p+r )/2; - uint i=p-1; - uint j=r+1; - - if( subfield==-1 ){ - const TableCol& pivot=dat( pivoti ).get( field ); - - while( true ) { - int rslt=0; - do { - j--; - rslt=dat( j )[field].compareTo( pivot, ftype ); - compara++; - } while( rslt>0 ); - - do { - i++; - rslt=dat( i )[field].compareTo( pivot, ftype ); - compara++; - } while( rslt<0 ); - - if( i0 ); - - do { - i++; - rslt=dat( i )[field].compareTo( pivot[field], ftype ); - if( rslt==0 ) { - rslt=dat( i )[subfield].compareTo( pivot[subfield], subtype ); - scompara++; - } - } while( rslt<0 ); - - if( icapacity ) resizeTo( adds+size ); -} +void QHaccResultSet::startLoad( uint adds ){ istartLoad( adds ); } void QHaccResultSet::istopLoad(){} void QHaccResultSet::istartLoad( uint ){} @@ -172,19 +169,8 @@ return VALID; } -void QHaccResultSet::resizeTo( uint ){ - /* - if( newsize