Re: How to use Query Cache with Perl DBI
Well, now that I look at it again, I'm not 100% sure. I thought it would always force a server side prepare, even for statements with no parameter markers. But now that I look at it more closely, it looks like the DBD::mysql driver will not send any statement to be prepared on the server unless this is set. I tested a prepare() with a parameter marker without setting mysql_server_prepare and when I executed it, I saw that it used the query cache:
$dbh= DBI->connect("dbi:mysql:database=test;host=localhost", "", "");
$sth= $dbh->prepare("select * from testaa where b=?");
$sth->execute(1);
This seems to indicate that without this option set, the driver will not prepare the statement, but instead substitute the values in the statement and executes the statement that way. You guys may want to do your own tests to validate what I'm seeing.
-Dave
Subject
Written By
Posted
September 01, 2006 10:20AM
September 01, 2006 10:56AM
September 01, 2006 11:11AM
September 01, 2006 08:38PM
September 02, 2006 11:25AM
September 02, 2006 10:02PM
September 02, 2006 10:37PM
September 03, 2006 12:21AM
September 03, 2006 07:07AM
September 03, 2006 10:25AM
Re: How to use Query Cache with Perl DBI
September 03, 2006 11:15AM
September 03, 2006 09:20PM
September 03, 2006 11:45AM