Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005603 [JEDI VCL] 00 JVCL Components minor always 2011-06-21 19:47 2012-09-10 14:15
Reporter stevegr View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.40
Summary 0005603: JvDBUltimGrid - ADO sorting problem.
Description ADO limitation:
Default Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Error on sort when key exists 10 KB.

A simple solution is:

procedure UpdateProp(const PropName: string; const Value: string);
begin
  // ERROR ADO 10 MB key limitation
  try
    SetStrProp(DSet, PropName, Value);
    FSortedFields := FieldsToSort;
    FSortOK := True;
  except
    { }
  end;
end;


Additional Information
Tags No tags attached.
Attached Files

- Relationships
related to 0005806resolvedobones JvDBGrid - DefaultDrawColumnCell and ShowMemos 

-  Notes
(0018925)
obones (administrator)
2011-09-21 11:48

Please provide the zipped sources of a sample application showing this
(0018990)
stevegr (reporter)
2011-09-28 19:49

The try...except block is for general-purpose error handling.

The ADO 10MB key limitation error fires when I try to sort one of the following types using postgres database (Encoding UTF8):
- memo
- character varying(4680) or larger ==> 4680 x 2 = 9360 bytes

MSSQL Server do not allow so large values for char fields. I have not tried other databases but as this is an ADO limitation I believe that should happen with any char field that exceeds this limitation.
(0019017)
obones (administrator)
2011-10-07 16:13

I'm sorry, but we can't silently swallow ALL exceptions, this is very dangerous and can lead to code injection by hackers
There should be another way to deal with this
(0019018)
stevegr (reporter)
2011-10-07 16:59

OK. if there's a way to assist, please let me know.
(0019022)
stevegr (reporter)
2011-10-08 21:23

// That piece of code is working. I tested only with ADO.

procedure TJvDBUltimGrid.Sort(FieldsToSort: TSortFields);
......
var
  DSet: TDataSet;
  SortField: TField; {needed in UpdateProp}

  procedure UpdateProp(const PropName: string; const Value: string);
  var
    Error: Boolean;
  begin
    // ERROR: ADO 10 KB key limitation
    Error:=
      (SortWith = swFields) { swFields: for ADO tables }
      and (SortField.DataType in [ftString, ftWideString])
      and (SortField.DataSize > 9361);

    if not Error then
    begin
      SetStrProp(DSet, PropName, Value);
      FSortedFields := FieldsToSort;
      FSortOK := True;
    end else
      FSortOK := False;

  end;
......
(0019439)
obones (administrator)
2012-02-22 14:42

Someone with DB knowledge would have to look at this
(0019567)
obones (administrator)
2012-02-27 11:33

This is now fixed in SVN

- Issue History
Date Modified Username Field Change
2011-06-21 19:47 stevegr New Issue
2011-09-21 11:48 obones Note Added: 0018925
2011-09-21 11:48 obones Status new => feedback
2011-09-28 19:49 stevegr Note Added: 0018990
2011-10-07 16:13 obones Note Added: 0019017
2011-10-07 16:59 stevegr Note Added: 0019018
2011-10-08 21:23 stevegr Note Added: 0019022
2012-02-22 14:42 obones Note Added: 0019439
2012-02-22 14:42 obones Status feedback => acknowledged
2012-02-27 11:29 obones Relationship added related to 0005806
2012-02-27 11:33 obones Note Added: 0019567
2012-02-27 11:33 obones Status acknowledged => resolved
2012-02-27 11:33 obones Fixed in Version => Daily / SVN
2012-02-27 11:33 obones Resolution open => fixed
2012-02-27 11:33 obones Assigned To => obones
2012-09-10 14:15 obones Fixed in Version Daily / SVN => 3.46


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker