hsvandrew 23 Posted January 19, 2019 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
hsvandrew 23 Posted January 24, 2019 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
Cristian Peța 103 Posted January 24, 2019 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 103 Posted January 25, 2019 Just tested on Ubuntu and now I see that you already tested console app. Looks like under Apache (supposing ICU is available) collation Strength or Case_Level is other that expected. See "Case Ordering" here: http://userguide.icu-project.org/collation/concepts Share this post Link to post
hsvandrew 23 Posted January 25, 2019 @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