Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Problems with bind variables with DBD::Oracle 1.21 on Leopard (MacOSX 10.5.2)
With Oracle having finally come out with native Intel drivers for
MacOS, I tried to install these to get rid of having to use a Rosetta-
ized version of perl to run Oracle things through, but kept running
into a problem where sometimes bind variables would work, and
sometimes I would get things like:

ORA-00911: invalid character (DBD ERROR: error possibly near <*>
indicator at char 77 in '
SELECT
System_User_ID,
'1' Hey
FROM
System_User
WHERE
Login LIKE <*>? ESCAPE '\'

After more investigation, I determined that any query that contained a
literal quote would die like this, and any query that did not was
fine.  It seems that there is an error in dbdimp.c where is_literal is
defined as a bool but then used as a char.  This triggers the
behavior, at least GCC 4.0.1 on the Mac and possibly other GCC4
platforms, where is_literal will get the value 1, and not the value of
the literal type, so that the end of the literal is never seen.  The
following patches this so that the behavior is correct and things work:

*** dbdimp.c.orig	Mon Apr 28 12:08:50 2008
--- dbdimp.c	Mon Apr 28 12:09:07 2008
***************
*** 1096,1102 ****
{
dTHX;
D_imp_dbh_from_sth;
!     bool in_literal = FALSE;
char in_comment = '\0';
char *src, *start, *dest;
phs_t phs_tpl;
--- 1096,1102 ----
{
dTHX;
D_imp_dbh_from_sth;
!     char in_literal = '\0';
char in_comment = '\0';
char *src, *start, *dest;
phs_t phs_tpl;

-- Matt

Report this thread to moderator Post Follow-up to this message
Old Post
Matthew Ragan
04-29-08 12:23 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL DBI archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:32 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.