Jump to content
Sign in to follow this  
hsvandrew

Linux + Delphi + Apache problem on 10.3

Recommended Posts

We are having a problem with a devart control which may in the end be something funny they did wrong but the behaviour seems strange and more like a low level issue.

Basically, the standard SQL Query control contains a simple SQL statement i.e. 

thisQuery.SQL.text := 'select * from emp where job = :PARAMname';
thisQuery.ParamByName('paramNAME').asString := 'new';
thisQuery.open;

 

On Windows VCL, console etc and on Linux as a console app this works as expected (param is case insensitive as expected)

When the exact same code is compiled into a generic brand new Delphi Apache Module and ran on the exact same machine as the console test app, the query fails unless the param is the same case in the SQL statement as it is in the ParamByName function.

 

This seems strange to me.

 

Does anyone know of any kind of Linux operating system quirk where the host application could override a function in such a way that you might expect this type of behaviour?
 

Share this post


Link to post

This issue has now been updated to show the offending function. Under the operating environment above, the result of this code is -1

 

Does anyone know why this might happen?

 

procedure TWebModule1.WebModule1DefaultHandlerAction(Sender: TObject;
  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
  response.contentType := 'text/plain';
  response.content := 'AnsiCompareText(''PARAMname'',''paramNAME'') ) = ' + inttostr(AnsiCompareText('PARAMname','paramNAME'));
end;

Share this post


Link to post

I have an Ubuntu installation that I tested in 10.2.

But have you tested a simple console app?

uses
  System.SysUtils;

begin
  Writeln(AnsiCompareText('PARAMname','paramNAME'));
  Readln;
end.

 

Share this post


Link to post

@Cristian Peța From what I can see ICU is available (IsICUAvailable returns true)

 

As many Delphi developers we have a knowledge base of all the quirks on Windows. I feel this is going to be a learning experience to discover the quirks of Linux.

This to me is a dangerous issue that needs to be understood because it could have all sorts of unintended and very hard to track down bugs, especially when the problem disappears as soon as you run it on Windows or Linux console.

I suspect the same problem will be affecting many string handling functions and probably other functions as well.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×