Subject | Re: ibserver terminated abnormally (-1) |
---|---|
Author | Valentin Voev |
Post date | 2004-01-06T12:19:14Z |
> Perhaps you're using some UDFs that crash the server on Linux?Hi Milan,
Actually I'm using one UDF (ib_uppercase), but I think the code is
clear...
unit my_ib_udf_m;
interface
uses ib_util;
function ib_uppercase(Value: PChar): PChar; cdecl;
function ib_util_malloc(l: integer): pointer; cdecl;
external 'ib_util.dll';
implementation
function ib_uppercase(Value: PChar): PChar;
const
Shift = 32;
var
I: Integer;
begin
I := 0;
while (Value[I] <> #0) do
begin
if (Ord(Value[I]) in [97..122, 224..255]) then
Value[I] := Char(Ord(Value[I]) - Shift);
Inc(I);
end;
Inc(I);
Result := ib_util_malloc(I);
Move(Value^, Result^, I);
end;