Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DBD-Oracle CPAN distribution.

Report information
The Basics
Id: 21920
Status: resolved
Priority: 0/
Queue: DBD-Oracle

People
Owner: champoux [...] pythian.com
Requestors: gareth [...] curtis-home.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.22
Fixed in: 1.23



Subject: Bug with Oracle DBD for Mac OS X Instant Client
Date: Thu, 5 Oct 2006 19:41:17 +0100
To: bug-DBD-Oracle [...] rt.cpan.org
From: Gareth Curtis <gareth [...] curtis-home.co.uk>
Download (untitled) / with headers
text/plain 26.5k

Message body is not shown because it is too large.

Download (untitled) / with headers
text/plain 365b
Seems this may be related tot he type of Instant client you are using. Oracle only has an instant client for PowerPCs and not an Intel or Universal version Here is a link to a blog that sort of solves it. http://www.macosxhints.com/article.php?story=20061021211559813 I will put this as stalled for now until Oracle comes up with a new instant client. cheers
Subject: Load-time issues with DBD Oracle on MacOS (with patch)
From: bitcard [...] filter.paco.to
Download (untitled) / with headers
text/plain 864b
On Mon Dec 11 11:36:39 2006, PYTHIAN wrote: Show quoted text
> > Here is a link to a blog that sort of solves it. > > http://www.macosxhints.com/article.php?story=20061021211559813
Even when someone follows those instructions, it still doesn't work. You can see my comment on that story, but here's the summary. The function dump_env_to_trace() in dbdimp.c makes direct access to the *environ data structure. Apparently that doesn't work in MacOS X since version 10.4 (Leopard, the latest, is 10.5). So, even following those instructions, DBD::Oracle will fail to load because, at load time, the _environ symbol cannot be resolved. Attached is my solution, which is probably not your favorite solution. It removes that function and the 2 references to it. Perhaps an #ifndef DARWIN (or whatever the right preprocessor define is) around this function would be a better solution.
Download dbdimp-mac.patch
text/x-diff 1009b
--- dbdimp.c.orig 2007-12-21 11:03:55.000000000 -0500 +++ dbdimp.c 2008-01-31 14:19:37.000000000 -0500 @@ -56,7 +56,6 @@ static sql_fbh_t ora2sql_type _((imp_fbh_t* fbh)); void ora_free_phs_contents _((phs_t *phs)); -static void dump_env_to_trace(); static sb4 oci_error_get(OCIError *errhp, sword status, char *what, SV *errstr, int debug) @@ -383,9 +382,6 @@ imp_dbh->get_oci_handle = oci_db_handle; - if (DBIS->debug >= 6 ) - dump_env_to_trace(); - if ((svp=DBD_ATTRIB_GET_SVP(attr, "ora_envhp", 9)) && SvOK(*svp)) { if (!SvTRUE(*svp)) { imp_dbh->envhp = NULL; /* force new environment */ @@ -3503,20 +3499,3 @@ } return sql_fbh; } - -static void -dump_env_to_trace() { - dTHX; - PerlIO *fp = DBILOGFP; - int i = 0; - char *p; -#ifndef __BORLANDC__ - extern char **environ; -#endif - PerlIO_printf(fp, "Environment variables:\n"); - do { - p = (char*)environ[i++]; - PerlIO_printf(fp,"\t%s\n",p); - } while ((char*)environ[i] != '\0'); -} -
Subject: Re: [rt.cpan.org #21920] Load-time issues with DBD Oracle on MacOS (with patch)
Date: Fri, 8 Feb 2008 22:34:27 +0000
To: Paco Hope via RT <bug-DBD-Oracle [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
Download (untitled) / with headers
text/plain 1.2k
John, change it to do whatever perl does on access the environment on OS X. Or else use HV *env_hv = GvHVn(PL_envgv) while ... hv_iternextsv ... { ... } Tim. On Thu, Jan 31, 2008 at 03:01:26PM -0500, Paco Hope via RT wrote: Show quoted text
> > Queue: DBD-Oracle > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=21920 > > > On Mon Dec 11 11:36:39 2006, PYTHIAN wrote:
> > > > Here is a link to a blog that sort of solves it. > > > > http://www.macosxhints.com/article.php?story=20061021211559813
> > Even when someone follows those instructions, it still doesn't work. You > can see my comment on that story, but here's the summary. The function > dump_env_to_trace() in dbdimp.c makes direct access to the *environ data > structure. Apparently that doesn't work in MacOS X since version 10.4 > (Leopard, the latest, is 10.5). So, even following those instructions, > DBD::Oracle will fail to load because, at load time, the _environ symbol > cannot be resolved. > > Attached is my solution, which is probably not your favorite solution. > It removes that function and the 2 references to it. Perhaps an #ifndef > DARWIN (or whatever the right preprocessor define is) around this > function would be a better solution.
From: boingolover [...] yahoo.com
Download (untitled) / with headers
text/plain 828b
Here is a diff that I have tested oh RHEL 5.2 x86_64 stock perl (v5.8.8 built for x86_64-linux-thread-multi) and the stock perl on Mac OSX 10.5.5 Intel and it works. I found a note on the old fink site porting notes (had to find it on archive.org) that mentioned how to deal with the _environ missing symbol. Here is a relevant excerpt: The _environ symbol The missing _environ symbol is a common problem when porting to OS X. Here's the standard patch used in several fink packages: +#ifdef __APPLE__ +#include <crt_externs.h> +#define environ (*_NSGetEnviron()) +#else extern char **environ; +#endif I basically shoehorned this bit into the dbdimp.c , I'm not 100% sure this is the cleanest way to handle the issue but it's better than commenting it out entirely - assuming it works for everyone. It works for me, YMMV.
Download dbdimp.diff
text/x-diff 418b
--- dbdimp.c.orig 2008-10-30 22:11:11.000000000 -0500 +++ dbdimp.c 2008-10-30 22:21:47.000000000 -0500 @@ -3852,7 +3852,11 @@ PerlIO *fp = DBILOGFP; int i = 0; char *p; -#ifndef __BORLANDC__ +#if defined (__APPLE__) +#include <crt_externs.h> +#define environ (*_NSGetEnviron()) +#elif defined (__BORLANDC__) +#else extern char **environ; #endif PerlIO_printf(fp, "Environment variables:\n");
From: boingolover [...] yahoo.com
I forgot to mention, this patch against the latest release, 1.22
Download (untitled) / with headers
text/plain 166b
Ok the patch was applied and can be found at http://svn.perl.org/modules/dbd-oracle/trunk the code works with windows and linux but I have not testedt it on mac OS


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.