Page 1 of 2

Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Mon 24 May 2021 18:49
by jdorlon
Hello,

Using Delphi 10.1, compiling in 64 bit, Oracle Client 12.1.0.1, ODAC 11.4.3.

I have reproduced this using Oracle Server 19c UTF8 character set, and 18c WE8MSWIN1252 character set. So I believe it will happen with any server version and any character set.

Code: Select all

var
  OraSession1: TOraSession;
  SmartQuery1: TSmartQuery;
begin
  OraSession1 := TOraSession.Create(nil);
  SmartQuery1 := TSmartQuery.Create(nil);
  SmartQuery1.Session := OraSession1;
  OraSession1.Username := 'jdorlon';
  OraSession1.Password := 'jdorlon';
  OraSession1.Server := 'azure_19c_plug'; // database version does not matter.
  OraSession1.LoginPrompt := False;
  OraSession1.Connect;

  SmartQuery1.SQL.Clear;
  SmartQuery1.SQL.Add('BEGIN');
  SmartQuery1.SQL.Add('  :my_user := user;');
  SmartQuery1.SQL.Add('  :test_param := ''ABC'';');
  SmartQuery1.SQL.Add('END;');
  SmartQuery1.ParamByName('my_user').ParamType := ptOutput;
  SmartQuery1.ParamByName('my_user').DataType := ftWideString;
  SmartQuery1.ParamByName('test_param').ParamType := ptOutput;
  SmartQuery1.ParamByName('test_param').DataType := ftWideString;
  SmartQuery1.Execute;

  Memo1.Lines.Add(SmartQuery1.ParamByName('my_user').asString);
  Memo1.Lines.Add(SmartQuery1.ParamByName('test_param').asString);

end;
TOraParam.AsString, is including some garbage characters at the end for output variables. It starts with #0, so GUI elements are hiding it, but you can see it in the debugger. See Screen shot: https://imgur.com/a/J2W3u5A

In that screen shot, the extra characters are all #0, but this is not always the case. For example, one of our users reported that "18.0.0.0 timesta" was being returned instead of just "18.0.0.0". The extra data is inconsistent and seems like random bits of memory.

This only happens with Oracle Client 12.1.0.1. It does not happen with Oracle Client 12.1.0.2 or newer. It was not a problem in ODAC version 11.3.2. I do not know exactly which ODAC version broke this, but I believe the relevant changes are in TOraParamDesc.GetItemAsWideString.

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Fri 18 Jun 2021 11:51
by MaximG
Sorry for the late reply. We will investigate the described issue and let you know the results shortly.

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Tue 13 Jul 2021 16:52
by paulzip
Any news on this? It's been almost a month without a reply from you, and this mangling of data is a serious bug on any metric.

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Thu 15 Jul 2021 14:36
by MaximG
Please test the described behavior using the latest version of ODAC 11.4.4 (15-Jul-2021) and let us know about the results.

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Thu 15 Jul 2021 17:04
by jdorlon
Hi Maxim,

Thanks for the reply. Unfortuntely, the problem still exists in 11.4.4.

The top image shows when connected with 12.1.0.1. The bottom image shows when connected with 18c.
https://imgur.com/a/1ghGPXU

If you want me to do any more tests, please do not hesitate to contact me via email with code changes to try.

Thanks,

-John

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Tue 27 Jul 2021 19:06
by jdorlon
Hello again Maxim,

I'm sorry to nag, but a lot of customers are reporting this problem. Will you please increase it's priority?

I have tried to fix it myself in our copy of your source but so far I have been unsuccessful.

Thanks

John

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Wed 28 Jul 2021 20:24
by MaximG
We couldn't reproduce the issue in test environment, using Oracle Client 12.1.0.1 and different versions of Oracle Server.
What encoding do you use in Oracle Client (the registry parameter NLS_LANG)? What Windows local do you have?

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Wed 28 Jul 2021 21:00
by jdorlon
In the registry I have NLS_LANG = AMERICAN_AMERICA.WE8MSWIN1252

Windows System Locale is: English (United States)

I will try to make a better demo app. The problem is much more pronounced in our regular app than in the demo.

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Wed 28 Jul 2021 21:39
by jdorlon
Ok, I built a better demo

It looks like the following when I run it:
https://imgur.com/a/ipKyiYH

Demo, with compiled executable, is here:
https://www.dropbox.com/s/fcoj2k7qveppp ... o.zip?dl=0

The 12.1.0.1 client that I am using is zipped up here:
https://www.dropbox.com/s/8srmpkx9s57kv ... 2.zip?dl=0

I have connected to 19c and 18c database with NLS Characterset = AL32UTF8.

Please let me know if this helps.

Thank you.

-John

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Tue 03 Aug 2021 16:34
by paulzip
This bug was logged nearly two and a half months ago, so are we ever going to get an update or fix?!!!!

This problem didn't exist with older versions of ODAC, so it's obviously been broken with recent changes. Why don't you get your developers to check their source control to have some idea when the problem was introduced?

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Wed 04 Aug 2021 02:03
by jdorlon
More information:

The problem began in ODAC version 11.4.1. It did not exist in 11.3.2.

Thank you.

John Dorlon

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Thu 12 Aug 2021 14:26
by MaximG
Thank you for your patience. We have reproduced the issue and will investigate its origin.

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Thu 12 Aug 2021 14:38
by jdorlon
That's great! Thank you for the update.

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Tue 31 Aug 2021 09:24
by paulzip
@MaximG It's been 100 days since this bug was logged and I still don't see a fix, only a "we have reproduced..". Do you think taking 100 days to fix a bug is good support? Any news when you will release a fix???

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Posted: Mon 06 Sep 2021 11:35
by MaximG
We've reproduced the issue and fixed it. The fix will be included in the next build of our product.