Zend Framework

Zend_Db_Adapter_Pdo_Pgsql::describeTable() returns length -1 for fields of the type character

Details

  • Type: Patch Patch
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.6
  • Fix Version/s: 1.10.0
  • Component/s: Zend_Db
  • Labels:
    None

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
                    }
                }
            }
  1. Pgsql.php.patch
    27/Oct/09 12:05 PM
    1 kB
    Ramon Henrique Ornelas
  2. table
    18/Dec/09 8:41 AM
    0.1 kB
    Ramon Henrique Ornelas

Activity

Hide
Ramon Henrique Ornelas added a comment -

Return length character type and default value.

Show
Ramon Henrique Ornelas added a comment - Return length character type and default value.
Hide
Ramon Henrique Ornelas added a comment -

Look patch.

Show
Ramon Henrique Ornelas added a comment - Look patch.
Hide
Mickael Perraud added a comment -

Patch applied and test added with r19751

Show
Mickael Perraud added a comment - Patch applied and test added with r19751

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1h
Original Estimate - 1 hour
Remaining:
1h
Remaining Estimate - 1 hour
Logged:
Not Specified
Time Spent - Not Specified