RE: Problem with DBI::Multiplex



This is embarrassing, the reason it didn't work was as designed. The content needed to be escaped by DBD::mysql. The function do auto escapes things, as well as passing args as parameters to execute. However, If you create the SQL without the placeholders, but don't escape the content then this is what happened.

Peter Halliday
Excelsior Systems
http://www.excelsiorsystems.net
(Phone:) 607-936-2172
(Support:) 607-329-6905
(Fax:) 607-398-7928
-----Original Message-----
From: Tim Bunce [mailto:Tim.Bunce@xxxxxxxxx]
Sent: Friday, May 26, 2006 3:52 AM
To: Peter Halliday
Cc: 'Tim Bunce'; dbi-users@xxxxxxxx; tkishel+perl@xxxxxxxxx
Subject: Re: Problem with DBI::Multiplex

On Thu, May 25, 2006 at 04:03:39PM -0400, Peter Halliday wrote:
Tim and Thomas,

Not sure why this is the case, but I noticed that doing an insert with
an execute via DBD::Multiplex didn't work when using text that
contained latex for example. But a do with the same did work.

What kind of "didn't work"? An error? If not, could you enable tracing
and try to see what happening that way.

After much work I found that calling execute with @_ (even though it was
empty) caused the error. So I added logic to not call it with @_.

So $sth->execute(@_); "didn't work",
but
my @tmp = @_;
$sth->execute(@tmp);
did?

If so, that seems very odd. Can you come up with a small self-contained
test case?

Tim.

Peter Halliday
Excelsior Systems
http://www.excelsiorsystems.net
(Phone:) 607-936-2172
(Support:) 607-329-6905
(Fax:) 607-398-7928

-----Original Message-----
From: Tim Bunce [mailto:Tim.Bunce@xxxxxxxxx]
Sent: Thursday, May 11, 2006 7:44 AM
To: Peter Halliday
Cc: dbi-users@xxxxxxxx
Subject: Re: Problem with DBI::Multiplex

On Tue, May 09, 2006 at 11:07:38AM -0400, Peter Halliday wrote:
I'm trying to load balance reads across two MySQL database that have
replication. The reads are working wonderfully. The inserts actually
do
insert. However, there are some table that use auto increment primary
keys. I can't figure out how to actually get those particular keys
now.

You could patch DBI::Multiplex so the last_insert_id method uses the
same
dbh as the previous operation.

Patches welcome.

Tim.

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.7.1/347 - Release Date:
5/24/2006


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.7.1/347 - Release Date: 5/24/2006





--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.7.1/348 - Release Date: 5/25/2006


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.7.2/349 - Release Date: 5/26/2006


.



Relevant Pages

  • [F8] Local fedora bug reporting system woes?
    ... Subject: Cron /usr/sbin/moodle-cron ... No virus found in this incoming message. ... Checked by AVG Free Edition. ...
    (Fedora)
  • Re: Multiple Subchannel Set Usage
    ... make sure the bases defined as 3390B and the aliases defined as ... No virus found in this outgoing message. ... Checked by AVG Free Edition. ... No virus found in this incoming message. ...
    (bit.listserv.ibm-main)
  • RE: Abuse by Dod?
    ... heh heh. ... No virus found in this outgoing message. ... Checked by AVG Free Edition. ...
    (Fedora)
  • webmail-SquirrelMail Fetcher In Python
    ... Oh well, I'll look for an imap server on the network if I can, but I doubt ... No virus found in this incoming message. ... Checked by AVG Free Edition. ... No virus found in this outgoing message. ...
    (comp.lang.python)
  • Re: [PHP] Alternative/Addition to using a CAPTCHA
    ... Hmm, just wanted to say that Jake, is it because i have my resolution ... >> No virus found in this incoming message. ... >> Checked by AVG Free Edition. ...
    (php.general)