#1 2017-03-03 10:33:45

ASiwon
Member
From: Poland
Registered: 2015-01-30
Posts: 82

Access Violation while preparing SQL query

Hello,

few days ago I have migrate to the current version of mORMot. Today an Access Violation exception occured in my code:

  lWagonyPobyty := Client.RetrieveList<TBkWagonPobyt>('% in (%)', [cGxPropId, lValues],
    [], RawUTF8ArrayToCSV([cGxPropId, cBkWagPobytPrzybycieCzas]));

I'm not sure but probably this problem occurs only when I'm working with external database (Oracle) Unfortunatelly in my case lValues was empty string. So where clause was generated as: 'id in ()'. It is not correct of course but I expect to occur HTTP_BADREQUEST error in this situation rather than Access Violation. I think the problem exists in function GetWhereValues in SynCommons.pas unit. Now the first condition in function is:

  if Where.ValueSQLLen<2 then
    exit;

I think the first condition in function should looks like:

  if Where.ValueSQLLen<=2 then
    exit;

Last edited by ASiwon (2017-03-03 10:34:50)


best regards
Adam Siwon

Offline

#2 2017-03-03 12:13:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,165
Website

Re: Access Violation while preparing SQL query

Offline

Board footer

Powered by FluxBB