Issues

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

Return length character type and default value.

Look patch.

Patch applied and test added with r19751