Description of problem: Perl-DBD-Oracle has a bug which prevents INSERT/UPDATEs to BLOBs to complete successfully when used on tables accessed via SYNONYMs. Version-Release number of selected component (if applicable): perl-DBD-Oracle-1.23-4.el5sat.x86_64 How reproducible: Always on x86_64, might be different on i386. Additional info: This bug resurfaced again, after it has been reported and apparently fixed twice (!). Here are the CPAN reports: http://rt.cpan.org/Public/Bug/Display.html?id=38267 http://rt.cpan.org/Public/Bug/Display.html?id=36069 The way the bug is fixed is suboptimal, therefore the bug crops up again in 1.23, as well as in SVN trunk. Here's the debug output generated with DBI_TRACE=3: lob refetch using a synonym named=rhnActionScript for RHN.RHNACTIONSCRIPT lob refetch from table RHN.RHNACTIONSCRIPT, 8 columns: lob refetch table col 1: 'ID' otype 2 lob refetch table col 2: 'ACTION_ID' otype 2 lob refetch table col 3: 'USERNAME' otype 1 lob refetch table col 4: 'GROUPNAME' otype 1 lob refetch table col 5: 'SCRIPT' otype 113 lob refetch table col 6: 'TIMEOUT' otype 2 lob refetch table col 7: 'CREATED' otype 12 lob refetch table col 8: 'MODIFIED' otype 12 lob refetch :script param: otype 113, matched field 'SCRIPT' by name (SCRIPT "script") lob refetch sql: select SCRIPT "script" from SCRIPT "script" where rowid = :rid for update The last line shows the incorrectly rendered SQL for LOB update. Further analysis shows the culprit is in incorrectly allocated char buffer used to store the fully qualified table name ("RHN.RHNACTIONSCRIPT" in this case). The buffer is allocated within the inner scope of the if-statement block, which can be, depending on the environment (operating system, compiler used, memory pressure, etc etc), discarded after the control exits the "if" clause, rendering its content random and useless. This is the behavior when executed on at least x86_64 system.
Set to Urgent/Urgent because it's a *showstopper* for RHN PHX2 migration.
Was this opened against satellite intentionally? -Justin
Created attachment 379034 [details] A proposed patch to char buffer allocation problem
(In reply to comment #2) > Was this opened against satellite intentionally? > > -Justin Yes, absolutely. As I said, it's a *showstopper* for RHN PHX2 migration, rendering the Perl part of the RHN Hosted unusable in new environment.
With the proposed patch above, the DBI trace shows different (and correct) output, and the LOB updates no longer fail: lob refetch using a synonym named=rhnActionScript for RHN.RHNACTIONSCRIPT lob refetch from table RHN.RHNACTIONSCRIPT, 8 columns: lob refetch table col 1: 'ID' otype 2 lob refetch table col 2: 'ACTION_ID' otype 2 lob refetch table col 3: 'USERNAME' otype 1 lob refetch table col 4: 'GROUPNAME' otype 1 lob refetch table col 5: 'SCRIPT' otype 113 lob refetch table col 6: 'TIMEOUT' otype 2 lob refetch table col 7: 'CREATED' otype 12 lob refetch table col 8: 'MODIFIED' otype 12 lob refetch :script param: otype 113, matched field 'SCRIPT' by name (SCRIPT "script") lob refetch sql: select SCRIPT "script" from RHN.RHNACTIONSCRIPT where rowid = :rid for update
Patch applied and packages built here: https://brewweb.devel.redhat.com/brew/taskinfo?taskID=2158395 I've done some minimal testing to ensure that the perl pages work.
hi Justin, as a testing scenario (for bug verification): do you have in mind some concrete cases or I can just take random actions on perl pages there? thanks.
The relevant cases would be triggering the Perl code to update BLOB/CLOBs in DB. In Hosted, it can be achieved throughout the process of Proxy activation. I don't know whether it's true for Satellite as well.
Hey Garik, I believe proxy activation is in java in Satellite and I honestly can't find any instances of blob manipulation in perl. I would activate a proxy just to test, and try a few perl pages in different areas to verify they still work. If all that checks out, i think we're good. -Justin
VERIFIED w/ Satellite-5.4.0-RHEL5-re20101001.1 / perl-DBD-Oracle-1.24a-3 * the patch mentioned in the bug report has been applied & used * .pxt pages work without any problem * blob manipulation works ok, used following script to verify: #!/usr/bin/perl use DBI; use DBD::Oracle 'SQLT_BIN'; use strict; use warnings; my $dbh = DBI->connect("dbi:Oracle:rhnsat", "rhnsat", "rhnsat"); $dbh->{LongReadLen} = 20*1024*1024; my $blob = "0101" for 1 .. 1000000; my $sql = "insert into temporary_table_syn values (?)"; my $sth = $dbh->prepare($sql); $sth->bind_param(1, $blob, { ora_type => SQLT_BIN }); $sth->execute(); $dbh->disconnect();
The 5.4.0 RHN Satellite and RHN Proxy release has occurred. This issue has been resolved with this release. RHEA-2010:0801 - RHN Satellite Server 5.4.0 Upgrade https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10332 RHEA-2010:0803 - RHN Tools enhancement update https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10333 RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10334 RHEA-2010:0800 - RHN Satellite Server 5.4.0 https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10335 Docs are available: http://docs.redhat.com/docs/en-US/Red_Hat_Network_Satellite/index.html Regards, Clifford
patch included and applied in spec file, pxt pages works, manipulating with blobs from synonyms works.
The patch will go to DBD::Oracle 1.28: http://svn.perl.org/viewvc/modules?view=revision&revision=14590