Welcome, Guest
Username: Password: Remember me
Components and Libraries for Database Development, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

'External: SIGSEGV'. Zeos DB 5 years 2 months ago #13155

  • Randall
  • Randall's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 1
this is the code fragment that I have
ZSPCostosCombustible.Params.ParamByName('AUX_DESDE').AsDate:=DateTimePicker1.Date;
ZSPCostosCombustible.Params.ParamByName('AUX_HASTA').AsDate:=DateTimePicker2.Date;
ZSPCostosCombustible.Params.ParamByName('ACTIVO_DESDE').AsString:=MaskEdit1.Text;
ZSPCostosCombustible.Params.ParamByName('ACTIVO_HASTA').AsString:=MaskEdit2.Text;
ZSPCostosCombustible.Open;

this is the exception
Error: El proyecto Gesagric 2018 ha lanzado una excepción de la clase 'External: SIGSEGV'.

En archivo '.\source\parsesql\ZGenericSqlAnalyser.pas' en linea 357:
if (Tokens[i].P^ = '(') and (Tokens[i].L = 1) then

It contains a Mysql stored procedure that is called: RPT_COSTOS_CONSUMOS_COMBUSTIBLE
and the sentence is:
BEGIN
if AUX_TIPO_RPT = 'Hist x Dates' then
select
ecc.date as Date,
dcc.idplaca as 'Id Active',
concat (ifnull (ati.marca, ''), '', ifnull (ati.modelo, ''), '', ifnull (ati.serie, '')) as Descripcion,
concat (dcc.idarticulo, '-', art.descripcion) as 'Articulo',
dcc.litros as Liters,
dcc.horim_kilom as 'Hr / Km'
from enc_consumo_combustible as ecc
inner join det_consumo_combustible as dcc
on ecc.idboleta = dcc.idboleta
inner join activosti as ati
on ati.idplaca = dcc.idplaca
inner join articles as art
on art.idarticulo = dcc.idarticulo
where ecc.date between AUX_DESDE and AUX_HASTA
order by dcc.idarticulo, ecc.fecha, dcc.idplaca;
else
if AUX_TIPO_RPT = 'Hist x Dates x Assets' then
select
ecc.date as Date,
dcc.idplaca as 'Id Active',
concat (ifnull (ati.marca, ''), '', ifnull (ati.modelo, ''), '', ifnull (ati.serie, '')) as Descripcion,
concat (dcc.idarticulo, '-', art.descripcion) as 'Articulo',
dcc.litros as Liters,
dcc.horim_kilom as 'Hr / Km'
from enc_consumo_combustible as ecc
inner join det_consumo_combustible as dcc
on ecc.idboleta = dcc.idboleta
inner join activosti as ati
on ati.idplaca = dcc.idplaca
inner join articles as art
on art.idarticulo = dcc.idarticulo
where ecc.date between AUX_DESDE and AUX_HASTA
and dcc.idplaca between ACTIVO_DEZDE and ACTIVO_HASTA
order by dcc.idplaca, ecc.date, dcc.horim_kilom;
end if;
end if;
END

the exception occurs in these lines of the ZGenericSqlAnalyser.pas
if not FoundSection and (TokenIndex < Tokens.Count) then begin
      BracketCount := 0;
      repeat
        Elements.Add(Tokens[TokenIndex]^);
        if (Tokens[i].P^ = '(') and (Tokens[i].L = 1) then
          Inc(BracketCount)
        else if (Tokens[i].P^ = ')') and (Tokens[i].L = 1) then
          Dec(BracketCount);
        Inc(TokenIndex);
      until (BracketCount <= 0) or (TokenIndex >= Tokens.Count);
    end;

Please Log in or Create an account to join the conversation.

'External: SIGSEGV'. Zeos DB 5 years 2 months ago #13156

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
My suggestion
is to post a project with the problem
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

'External: SIGSEGV'. Zeos DB 5 years 2 months ago #13157

  • Randall
  • Randall's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 1
In the ZGenericSqlAnalyser.pas unit, the function
function TZGenericStatementAnalyser.SplitSections ({$ IFDEF AUTOREFCOUNT} const {$ ENDIF} Tokens: TZTokenList): TObjectList;

must be replaced with this section of code, it is already tested and works correctly, corrects the problem
function TZGenericStatementAnalyser.SplitSections({$IFDEF AUTOREFCOUNT}const{$ENDIF}
  Tokens: TZTokenList): TObjectList;
var
  I: Integer;
  Keyword: string;
  WordCount: Integer;
  TokenIndex: Integer;
  Elements: TZTokenList;
  FoundSection: Boolean;
  BracketCount: Integer;
begin
  Result := TObjectList.Create;
  TokenIndex := 0;
  FoundSection := True;
  Elements := nil;
  CheckForKeyword(Tokens, TokenIndex, SectionNames, Keyword{%H-}, WordCount{%H-});

  while TokenIndex < Tokens.Count do begin
    if FoundSection then begin
      Elements := TZTokenList.Create;
      for I := 0 to WordCount - 1 do
        Elements.Add(Tokens[TokenIndex + I]^);
      Inc(TokenIndex, WordCount);
      Result.Add(TZStatementSection.Create(Keyword, Elements));
    end;
    FoundSection := CheckForKeyword(Tokens, TokenIndex, SectionNames,
      Keyword, WordCount);
    if not FoundSection and (TokenIndex < Tokens.Count) then begin
      BracketCount := 0;
      repeat
        Elements.Add(Tokens[TokenIndex]^);
        if (Tokens[TokenIndex].L = 1) then
          if (Tokens[TokenIndex].P^ = '(') then
            Inc(BracketCount)
          else if (Tokens[TokenIndex].P^ = ')') then
            Dec(BracketCount);
        Inc(TokenIndex);
      until (BracketCount <= 0) or (TokenIndex >= Tokens.Count);
    end;
  end;
end;
The following user(s) said Thank You: universe

Please Log in or Create an account to join the conversation.

Last edit: by Randall.

'External: SIGSEGV'. Zeos DB 5 years 2 months ago #13158

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Done, in LAB CT 6.80
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

'External: SIGSEGV'. Zeos DB 5 years 2 months ago #13159

  • Randall
  • Randall's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 1
excellent, trying a little I managed to find the solution

Please Log in or Create an account to join the conversation.

  • Page:
  • 1