Author: byterock
Date: Fri Oct 31 08:07:55 2008
New Revision: 12016
Modified:
dbd-oracle/trunk/Changes
dbd-oracle/trunk/Oracle.pm
dbd-oracle/trunk/oci8.c
Log:
Fix for rt.cpan.org Ticket #=38267 Inserts/Updates to BLOB's via synonyms fails from John Scoles also a fix for pod text
Modified: dbd-oracle/trunk/Changes
==============================================================================
--- dbd-oracle/trunk/Changes (original)
+++ dbd-oracle/trunk/Changes Fri Oct 31 08:07:55 2008
@@ -1,4 +1,5 @@
=head1 Changes in DBD-Oracle 1.23(svn rev #####)
+ Fix for rt.cpan.org Ticket #=38267: Inserts/Updates to BLOB's via synonyms fails from John Scoles
Fix for rt.cpan.org Ticket #=39603 build problem and fix missing functions in oci.def from Zoltán Sebestyén
Fix for rt.cpan.org Ticket #=39374 Makefile.PL: error when reducing echo messages from make from Tippa
Fix for rt.cpan.org Ticket #=39232 binding large XMLTYPE fails on 64-bit perl from Jeff Klein
Modified: dbd-oracle/trunk/Oracle.pm
==============================================================================
--- dbd-oracle/trunk/Oracle.pm (original)
+++ dbd-oracle/trunk/Oracle.pm Fri Oct 31 08:07:55 2008
@@ -3811,7 +3811,7 @@
For example, assume you have the existing PL/SQL Package :
-CREATE OR REPLACE PACKAGE Array_Example AS
+ CREATE OR REPLACE PACKAGE Array_Example AS
--
TYPE tRec IS RECORD (
Col1 NUMBER,
@@ -3822,25 +3822,25 @@
--
FUNCTION Array_Func RETURN taRec ;
--
-END Array_Example ;
+ END Array_Example ;
-CREATE OR REPLACE PACKAGE BODY Array_Example AS
---
-FUNCTION Array_Func RETURN taRec AS
---
+ CREATE OR REPLACE PACKAGE BODY Array_Example AS
+ --
+ FUNCTION Array_Func RETURN taRec AS
+ --
l_Ret taRec ;
---
-BEGIN
+ --
+ BEGIN
FOR i IN 1 .. 5 LOOP
l_Ret (i).Col1 := i ;
l_Ret (i).Col2 := 'Row : ' || i ;
l_Ret (i).Col3 := TRUNC (SYSDATE) + i ;
END LOOP ;
RETURN l_Ret ;
-END ;
---
-END Array_Example ;
-/
+ END ;
+ --
+ END Array_Example ;
+ /
Currently, there is no way to directly call the function
Array_Example.Array_Func from DBI. However, by making the following relatively
Modified: dbd-oracle/trunk/oci8.c
==============================================================================
--- dbd-oracle/trunk/oci8.c (original)
+++ dbd-oracle/trunk/oci8.c Fri Oct 31 08:07:55 2008
@@ -3403,6 +3403,7 @@
if (status == OCI_SUCCESS) { /* There is a synonym, get the schema */
char *syn_schema=NULL, *syn_name=NULL;
char new_tablename[100];
+
ub4 syn_schema_len = 0, syn_name_len = 0,tn_len;
OCIAttrGet_log_stat(imp_sth->dschp, OCI_HTYPE_DESCRIBE,
&parmhp, 0, OCI_ATTR_PARAM, errhp, status);
@@ -3412,11 +3413,12 @@
&syn_name, &syn_name_len, OCI_ATTR_OBJ_NAME, errhp, status);
OCIAttrGet_log_stat(parmhp, OCI_DTYPE_PARAM,
&tablename, &tn_len, OCI_ATTR_NAME, errhp, status);
- strcpy(new_tablename,syn_schema);
- strcat(new_tablename, ".");
- strncat(new_tablename, tablename,tn_len);
- tablename=new_tablename;
+ strncpy(new_tablename,syn_schema,syn_schema_len);
+ new_tablename[syn_schema_len+1] = '\0';
+ new_tablename[syn_schema_len]='.';
+ strncat(new_tablename, tablename,tn_len);
+ tablename=new_tablename;
if (DBIS->debug >= 3 || dbd_verbose >= 3)
PerlIO_printf(DBILOGFP, " lob refetching a synonym named=%s for %s \n", syn_name,tablename);
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.