PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #5800

Checks privileges when retrieving tables list

Details

Submitted2005-10-27 21:51 UTC
Fromskeemer+peardev at gmail dot com
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2005-10-27 21:51 UTC] skeemer+peardev at gmail dot com

Description:
------------
DB/Dataproject/Generate halts when it tries to get tableinfo
on a table that doesn't have usage permissions.

This problem arises because in Postgres the getTables()
function returns all tables whether the user has privileges
for them or not.

[2005-10-27 21:59 UTC] skeemer+peardev at gmail dot com

Switch from feature to bug

[2005-10-27 23:49 UTC] skeemer+peardev at gmail dot com

Moved to DB_DataObject

My suggestion is to change in
Generator.php->_CreateTableList():

$defs = $__DB->tableInfo($table);
if (is_a($defs,'PEAR_Error')) {
echo $defs->toString();
exit;
}

to

$defs = $__DB->tableInfo($table);
if (is_a($defs,'PEAR_Error')) {
$this->debug("Ignoring table \"$table\" - ".
$defs->toString());
continue;
}