TZAbstractRODataset.InternalLocate problem

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
klchin
Senior Boarder
Senior Boarder
Posts: 65
Joined: 02.09.2005, 06:27

TZAbstractRODataset.InternalLocate problem

Post by klchin »

Hi,

Could this a bug or limitation or compatible issue between 6.6x and 6.1x.

Here the table structure

---------------------------------------------
CREATE TABLE `ctsstkotmst` (
`somRnID` BIGINT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`somDtTm` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`somPsID` VARCHAR(32) NOT NULL DEFAULT '',
`somPsON` VARCHAR(32) NOT NULL DEFAULT '',
`prdDsgn` VARCHAR(32) NOT NULL DEFAULT '',
`somFlag` VARCHAR(4) NULL DEFAULT 'NO',
`somRems` TEXT NULL,
PRIMARY KEY (`somRnID`),
UNIQUE INDEX `somRnID` (`somRnID`),
INDEX `somRnID_2` (`somRnID`),
INDEX `somDtTm` (`somDtTm`),
INDEX `somPsID` (`somPsID`),
INDEX `somPsON` (`somPsON`),
INDEX `prdDsgn` (`prdDsgn`)
)
COLLATE=latin1_swedish_ci
ENGINE=MyISAM
ROW_FORMAT=DYNAMIC
AUTO_INCREMENT=3081
AVG_ROW_LENGTH=53

---------------------------------------------

dtsMast->DataSet->Locate( 'somPsID','0000003710',TLocateOptions( ) << loCaseInsensitive << loPartialKey );

under version 6.1x this work fine, for 6.6x the '0000003710' cannot be locate but '3710' was OK.

I have checked the CompareFieldsFromResultSet, because of the 'loPartialKey', the result become false.

It is better to chcek again, if the field is integer or decimal first?

---------------------------------------------
Changes

if CaseInsensitive then
Value2 := AnsiUpperCase(Value2);
Result := AnsiStrLComp(PChar(Value2), PChar(Value1), Length(Value1)) = 0;
if ( false = Result ) then
case CurrentType of
stByte,
stShort,
stInteger,
stLong:
begin
Result := KeyValues[I].VInteger =
ResultSet.GetLong(ColumnIndex);
end;
stFloat,
stDouble,
stBigDecimal:
begin
Result := Abs(KeyValues[I].VFloat -
ResultSet.GetBigDecimal(ColumnIndex)) < FLOAT_COMPARE_PRECISION;
end;
end;

---------------------------------------------


Regards,
KL Chin
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi KL Chin,

Can you just show a diff for the changes you did. The current code in Testing branch seems to look a little different, so I'm not sure what you changed exactly.

Mark
Image
Post Reply