[php-maint] Bug#357098: DECLARE/FETCH completely busted for Postgres

Stephen Frost sfrost at snowman.net
Wed Mar 15 16:39:46 UTC 2006

Package: php-db
Version: 1.7.6-2
Severity: Important


  DECLARE/FETCH doesn't work in PHP-DB because it is foolishly assumed
  that only 'select', 'explain' and 'show' return records.  This is
  certainly not the case as 'fetch' (like, from a cursor) can also
  return rows.  The way to fix this is pretty straight-forward:

  /usr/share/php/db/pgsql.php, line 1097:

} elseif (preg_match('/^\s*\(*\s*(SELECT|EXPLAIN|SHOW)\s/si', $query)) {

  changes to:

} elseif (preg_match('/^\s*\(*\s*(SELECT|EXPLAIN|SHOW|FETCH)\s/si', $query)) {

  Please to be fixing.



More information about the pkg-php-maint mailing list