ZF-7640: Zend_Db_Adapter_Pdo_Pgsql::describeTable() returns length -1 for fields of the type character
Description
problem length field of the type character in Adapter_Pdo_Pgsql.
length returned -1, with the call of the method describeTable
solution, the modified Adapter_Pdo_Pgsql
for
if ($row[$type] == 'varchar' || $row[$type] == 'bpchar' ) {
if (preg_match('/character(?: varying)?(?:\((\d+)\))?/', $row[$complete_type], $matches)) {
if (isset($matches[1])) {
$row[$length] = $matches[1];
} else {
$row[$length] = null; // unlimited
}
}
}
Comments
Posted by Ramon Henrique Ornelas (ramon) on 2009-10-27T12:05:22.000+0000
Return length character type and default value.
Posted by Ramon Henrique Ornelas (ramon) on 2009-10-27T12:09:37.000+0000
Look patch.
Posted by Mickael Perraud (mikaelkael) on 2009-12-18T09:31:50.000+0000
Patch applied and test added with r19751