Oracle 12.1.0.1 Client, Output Parameters returning junk data

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
jdorlon
Posts: 185
Joined: Fri 05 Jan 2007 22:07

Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by jdorlon » Mon 24 May 2021 18:49

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.
Last edited by jdorlon on Tue 13 Jul 2021 17:00, edited 1 time in total.

MaximG
Devart Team
Posts: 1699
Joined: Mon 06 Jul 2015 11:34

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by MaximG » Fri 18 Jun 2021 11:51

Sorry for the late reply. We will investigate the described issue and let you know the results shortly.

paulzip
Posts: 37
Joined: Mon 02 Oct 2006 13:13

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by paulzip » Tue 13 Jul 2021 16:52

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.

MaximG
Devart Team
Posts: 1699
Joined: Mon 06 Jul 2015 11:34

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by MaximG » Thu 15 Jul 2021 14:36

Please test the described behavior using the latest version of ODAC 11.4.4 (15-Jul-2021) and let us know about the results.

jdorlon
Posts: 185
Joined: Fri 05 Jan 2007 22:07

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by jdorlon » Thu 15 Jul 2021 17:04

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

jdorlon
Posts: 185
Joined: Fri 05 Jan 2007 22:07

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by jdorlon » Tue 27 Jul 2021 19:06

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

MaximG
Devart Team
Posts: 1699
Joined: Mon 06 Jul 2015 11:34

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by MaximG » Wed 28 Jul 2021 20:24

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?

jdorlon
Posts: 185
Joined: Fri 05 Jan 2007 22:07

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by jdorlon » Wed 28 Jul 2021 21:00

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.

jdorlon
Posts: 185
Joined: Fri 05 Jan 2007 22:07

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by jdorlon » Wed 28 Jul 2021 21:39

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

paulzip
Posts: 37
Joined: Mon 02 Oct 2006 13:13

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by paulzip » Tue 03 Aug 2021 16:34

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?

jdorlon
Posts: 185
Joined: Fri 05 Jan 2007 22:07

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by jdorlon » Wed 04 Aug 2021 02:03

More information:

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

Thank you.

John Dorlon

MaximG
Devart Team
Posts: 1699
Joined: Mon 06 Jul 2015 11:34

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by MaximG » Thu 12 Aug 2021 14:26

Thank you for your patience. We have reproduced the issue and will investigate its origin.

jdorlon
Posts: 185
Joined: Fri 05 Jan 2007 22:07

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by jdorlon » Thu 12 Aug 2021 14:38

That's great! Thank you for the update.

paulzip
Posts: 37
Joined: Mon 02 Oct 2006 13:13

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by paulzip » Tue 31 Aug 2021 09:24

@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???

MaximG
Devart Team
Posts: 1699
Joined: Mon 06 Jul 2015 11:34

Re: Oracle 12.1.0.1 Client, Output Parameters returning junk data

Post by MaximG » Mon 06 Sep 2021 11:35

We've reproduced the issue and fixed it. The fix will be included in the next build of our product.

Post Reply