Re: [Sqlrelay-discussion] [sqlrelay] propagating placeholders (question marks) with DBD::SQLRelay
Brought to you by:
mused
|
From: <b-r...@ro...> - 2009-07-10 15:39:31
|
Thanks (and also to "Lawrence, Gabriel" <gla...@uc...>) for the responses. See inline... On Thu, 9 Jul 2009, David Muse wrote: > [SNIP EXPLANATION] > In the short term, the only easy solution is to add fakebinds=yes to the > db connect string. For example: > > <connection connectionid="mysqltest" > string="user=blah;password=blah;db=blah;fakebinds=yes" metric="1"/> > > In this case, the ?'s will be converted to colon-delimited variables but > SQL Relay will rewrite the query rather than pass the binds directly to > the db. It's less efficient, but may not be too bad. That did not work. Yes, I did restart SQLRelay. There was no change to the results at all. I reverted that change. > Alternatively, you might be able to comment out the line: > > $statement =~ s/\?/":" . ++$count/eg; > > in the installed SQLRelay.pm file, which should be line around 135. > This will disable conversion of ?'s to colon-delimited variables. The > query should be passed directly into the DB as-is with ?'s. > > Give these a shot, let me know if they work for you or not. Yes, the latter did work. I have two identical copies of the file: /usr/lib/perl5/site_perl/5.8.8/DBD/SQLRelay.pm /usr/src/sqlrelay-0.41/src/api/perl/DBD/SQLRelay.pm So, I made the change to both. My next question, then: If I choose to use MySQL's bind variables in the future, how will that be affected? I currently have a kludge in my own code that fairly handily takes care of the '?' problem, though I'd like to remove it in favor of this change just made, but I'd hate to find out that it's either "bind variables and no question mark" or "no bind variables and question mark". I'd like to know that I can have both. R. p.s. And now that I see the list seems to be active, I'll probably repost my earlier queries |