Memory leak in DBD::mysql with server side prepares?
am 30.05.2006 21:31:18 von jasonFirst, here are the perl/mysql versions involved:
MySQL: 4.1.14
Perl: 5.8.0
DBI: 1.50
DBD::mysql: 3.0004
Here is a simple perl script that uses server side prepares (db vars removed):
#!/usr/bin/perl -w
use strict;
use DBI;
my $ssp = 1;
my $count = 0;
my $query = "SELECT * FROM content_class WHERE id = ? LIMIT 1";
my $dbh_l = DBI->connect (
"dbi:mysql:database=$DBName:host=$DBHost:mysql_server_prepar e=$ssp",
$DBUser, $DBPass,
{ RaiseError => 1, PrintError => 0 },
);
my $s_q = $dbh_l->prepare($query);
my $id = 484262734;
while (1) {
$s_q->execute($id);
my @data = $s_q->fetchrow_array();
$s_q->finish;
$count++;
print "ran $count queries\r";
sleep(0.3);
}
This script, when run, will eat about 10M of memory a second. Am I
missing something about server side prepares?
Cheers,
-Jason
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org