|
|
sybperl-l Archive
Up Prev Next
From: "Fred Strauss" <fred_strauss at ap dot org>
Subject: Bad free
Date: Oct 25 2000 5:05PM
I'm consistently getting the following error when trying to execute an SQL
statement:
Bad free() ignored at /usr/local/lib/perl5/perl5db.pl line 1134.
SybUtils::exec_sql('SCALAR(0xa8857c)', 'select tm.ext_team_id,
ti.team_id, ti.name, ti.nickname, ti.poll...') called at
/usr/local/lib/perl5/site_perl/StatsInc/Utils.pm line 114
StatsInc::Utils::find_team_info('SCALAR(0xa8857c)', 'BKC', 58200,
'AP') called at
/aptools/appl/sportsprod/ver2.0/bin/update_stats_email_scores.pl line 185
I'm using the routine below to retrieve results from an sql statement:
sub exec_sql {
my $db_handle = shift;
my $sql = shift;
my $row_count;
my @result_rows;
my $result_type;
$row_count = $$db_handle->ct_execute($sql);
while (($row_count = $$db_handle->ct_results($result_type)) ==
CS_SUCCEED) {
if ($result_type == CS_CMD_FAIL) {
printf STDERR "Error in SQL: %s\n", $sql;
}
next unless $$db_handle->ct_fetchable($result_type);
# output this player
my $data;
while ($data = $$db_handle->ct_fetch(CS_TRUE, CS_TRUE)) {
push(@result_rows, {%$data});
}
}
# return reference to result set or bad status
if ($row_count == CS_FAIL) {
return $row_count;
}
else {
return \@result_rows;
}
}
The SQL statement in question is:
select tm.ext_team_id, ti.team_id, ti.name, ti.nickname, ti.poll_rank,
conf_name = c.name,
slug_name = tir.slug_name, text_name = tir.text_name
from team_map tm, team_info ti, conf_div cd, conferences c, team_info_report
tir
where tm.team_id = 58200 and tm.origin = "STATS" and
ti.team_id = tm.team_id and ti.team_id *= tir.team_id and
ti.confdiv_id = cd.confdiv_id and cd.conf_id *= c.conf_id
Any idea on why the "Bad Free" or what might cause it?
Thanks,
Fred
|