TD-17502: Oracle Long Raw data trunc. on ANSI data

Report TD 5.x and 6.x bugs and possible workarounds.
Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2900
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

TD-17502: Oracle Long Raw data trunc. on ANSI data

Post by Dave Rabelink » 24 Mar 2012, 12:30

There are some threads on the forum concerned with issues on several databases (incl Oracle) having Long Raw columns and
data which is truncated.
Some reports this issue after some SPs on TD6. And there are mentioned EMP's which are released to solve it.
(is it solved?).

I have the same issue now (TD6.0 SP5 and TD6.1) having Oracle 10 server and client on Long Raw type columns.

When I insert UNICODE strings, there is no issue.
But when converting strings to ANSI, the string is saved in the database with a truncation of 1 character.
The select of the database is ok. So correct ANSI data in the database are fetched correctly.
So the issue is only TD->Oracle.

I have created a simple testcase which inserts "12345" string. After insert, the database contains "1234".
Selection from TD application fetched "1234".

I created a video while debugging this testcase. This clearly shows the truncation which is in all cases 1 character at the end.
https://samples.tdcommunity.net/index.p ... cation.wmv

Having read the threads on truncation issues, Unify states that it is recommended to use Blob types.
This is true, but we are here in a legacy environment which needs this Long Raw not only from our TD apps but many other tools/apps use the database.
Conversion is also not possible.

Right now, this is a blocking issue which stops the current conversion to TD61.
I hope Unify can find the issue quickly and offer some kind of patch to both TD6.0 and also the newest TD6.1
OracleBlobTruncation_TD61.zip
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Jeff Luther

[DEFECT ADDED] Oracle Long Raw data trunc. on ANSI data

Post by Jeff Luther » 28 Mar 2012, 00:13

WORKAROUND:
** I see that when I increase the ANSI string's buffer length by 1 before the INSERT:
Call SalSetBufferLength( lsBlob, SalGetBufferLength( lsBlob )+1 )

and then decrease buff. len by 1 after the FETCH and before the convert back to Unicode, "12345" inserted, "12345" fetched back.

There's a mod. to your test case I made showing this. I'll attach it here. Mod. prompts to add +1 to ANSI buf. len or not. Couple BPs in the test + I keep 1 connect going the entire test and create/drop the DB test table.
You do not have the required permissions to view the files attached to this post.

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2900
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

[DEFECT ADDED] Oracle Long Raw data trunc. on ANSI data

Post by Dave Rabelink » 28 Mar 2012, 07:12

Thanks Jeff for supplying the workaround.
In fact it is a working-around, as this fixes the truncation !!!

I will mark the added workaround in the code with TD-17502 so when Unify releases the hotfix/SP I can easily remove them later on.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Jeff Luther

[DEFECT ADDED] Oracle Long Raw data trunc. on ANSI data

Post by Jeff Luther » 28 Mar 2012, 16:08

this fixes the truncation !!!
Yes, it does. TD internally is lopping off 2 bytes -- assuming it is a Unicode string -- to remove the end-of-string char. So... we just give it an extra byte to lop off (2 total now) so a real ANSI char. doesn't get the 'axe.' I'm glad to hear it worked for you, Dave.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 0 guests