Ignore:
Timestamp:
2013/08/02 13:22:57 (11 years ago)
Author:
Seasoft
Message:

#2322 (セッションのGC処理がエラーとなる)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13-dev/data/module/MDB2/Driver/Reverse/pgsql.php

    r20764 r23022  
    4444// +----------------------------------------------------------------------+ 
    4545// 
    46 // $Id: pgsql.php,v 1.75 2008/08/22 16:36:20 quipo Exp $ 
     46// $Id: pgsql.php 327310 2012-08-27 15:16:18Z danielc $ 
    4747 
    4848require_once 'MDB2/Driver/Reverse/Common.php'; 
     
    7070    function getTableFieldDefinition($table_name, $field_name) 
    7171    { 
    72         $db =& $this->getDBInstance(); 
    73         if (PEAR::isError($db)) { 
     72        $db = $this->getDBInstance(); 
     73        if (MDB2::isError($db)) { 
    7474            return $db; 
    7575        } 
    7676 
    7777        $result = $db->loadModule('Datatype', null, true); 
    78         if (PEAR::isError($result)) { 
     78        if (MDB2::isError($result)) { 
    7979            return $result; 
    8080        } 
     
    123123                ORDER BY a.attnum"; 
    124124        $column = $db->queryRow($query, null, MDB2_FETCHMODE_ASSOC); 
    125         if (PEAR::isError($column)) { 
     125        if (MDB2::isError($column)) { 
    126126            return $column; 
    127127        } 
     
    134134        $column = array_change_key_case($column, CASE_LOWER); 
    135135        $mapped_datatype = $db->datatype->mapNativeDatatype($column); 
    136         if (PEAR::isError($mapped_datatype)) { 
     136        if (MDB2::isError($mapped_datatype)) { 
    137137            return $mapped_datatype; 
    138138        } 
     
    144144        $default = null; 
    145145        if ($column['atthasdef'] === 't' 
     146            && strpos($column['default'], 'NULL') !== 0 
    146147            && !preg_match("/nextval\('([^']+)'/", $column['default']) 
    147148        ) { 
    148149            $pattern = '/^\'(.*)\'::[\w ]+$/i'; 
    149150            $default = $column['default'];#substr($column['adsrc'], 1, -1); 
    150             if (is_null($default) && $notnull) { 
     151            if ((null === $default) && $notnull) { 
    151152                $default = ''; 
    152153            } elseif (!empty($default) && preg_match($pattern, $default)) { 
     
    160161        } 
    161162        $definition[0] = array('notnull' => $notnull, 'nativetype' => $column['type']); 
    162         if (!is_null($length)) { 
     163        if (null !== $length) { 
    163164            $definition[0]['length'] = $length; 
    164165        } 
    165         if (!is_null($unsigned)) { 
     166        if (null !== $unsigned) { 
    166167            $definition[0]['unsigned'] = $unsigned; 
    167168        } 
    168         if (!is_null($fixed)) { 
     169        if (null !== $fixed) { 
    169170            $definition[0]['fixed'] = $fixed; 
    170171        } 
     
    199200    function getTableIndexDefinition($table_name, $index_name) 
    200201    { 
    201         $db =& $this->getDBInstance(); 
    202         if (PEAR::isError($db)) { 
     202        $db = $this->getDBInstance(); 
     203        if (MDB2::isError($db)) { 
    203204            return $db; 
    204205        } 
     
    212213        $index_name_mdb2 = $db->getIndexName($index_name); 
    213214        $row = $db->queryRow(sprintf($query, $db->quote($index_name_mdb2, 'text')), null, MDB2_FETCHMODE_ASSOC); 
    214         if (PEAR::isError($row) || empty($row)) { 
     215        if (MDB2::isError($row) || empty($row)) { 
    215216            // fallback to the given $index_name, without transformation 
    216217            $row = $db->queryRow(sprintf($query, $db->quote($index_name, 'text')), null, MDB2_FETCHMODE_ASSOC); 
    217218        } 
    218         if (PEAR::isError($row)) { 
     219        if (MDB2::isError($row)) { 
    219220            return $row; 
    220221        } 
     
    257258    function getTableConstraintDefinition($table_name, $constraint_name) 
    258259    { 
    259         $db =& $this->getDBInstance(); 
    260         if (PEAR::isError($db)) { 
     260        $db = $this->getDBInstance(); 
     261        if (MDB2::isError($db)) { 
    261262            return $db; 
    262263        } 
     
    303304        $constraint_name_mdb2 = $db->getIndexName($constraint_name); 
    304305        $row = $db->queryRow(sprintf($query, $db->quote($constraint_name_mdb2, 'text')), null, MDB2_FETCHMODE_ASSOC); 
    305         if (PEAR::isError($row) || empty($row)) { 
     306        if (MDB2::isError($row) || empty($row)) { 
    306307            // fallback to the given $index_name, without transformation 
    307308            $constraint_name_mdb2 = $constraint_name; 
    308309            $row = $db->queryRow(sprintf($query, $db->quote($constraint_name_mdb2, 'text')), null, MDB2_FETCHMODE_ASSOC); 
    309310        } 
    310         if (PEAR::isError($row)) { 
     311        if (MDB2::isError($row)) { 
    311312            return $row; 
    312313        } 
     
    333334            $constraint_name_mdb2 = $db->getIndexName($constraint_name); 
    334335            $row = $db->queryRow(sprintf($query, $db->quote($constraint_name_mdb2, 'text')), null, MDB2_FETCHMODE_ASSOC); 
    335             if (PEAR::isError($row) || empty($row)) { 
     336            if (MDB2::isError($row) || empty($row)) { 
    336337                // fallback to the given $index_name, without transformation 
    337338                $constraint_name_mdb2 = $constraint_name; 
    338339                $row = $db->queryRow(sprintf($query, $db->quote($constraint_name_mdb2, 'text')), null, MDB2_FETCHMODE_ASSOC); 
    339340            } 
    340             if (PEAR::isError($row)) { 
     341            if (MDB2::isError($row)) { 
    341342                return $row; 
    342343            } 
     
    388389                     AND t.relname = ' . $db->quote($table, 'text'); 
    389390        $fields = $db->queryCol(sprintf($query, $db->quote($constraint_name_mdb2, 'text')), null); 
    390         if (PEAR::isError($fields)) { 
     391        if (MDB2::isError($fields)) { 
    391392            return $fields; 
    392393        } 
     
    407408                         AND t.relname = ' . $db->quote($definition['references']['table'], 'text'); 
    408409            $foreign_fields = $db->queryCol(sprintf($query, $db->quote($constraint_name_mdb2, 'text')), null); 
    409             if (PEAR::isError($foreign_fields)) { 
     410            if (MDB2::isError($foreign_fields)) { 
    410411                return $foreign_fields; 
    411412            } 
     
    444445    function getTriggerDefinition($trigger) 
    445446    { 
    446         $db =& $this->getDBInstance(); 
    447         if (PEAR::isError($db)) { 
     447        $db = $this->getDBInstance(); 
     448        if (MDB2::isError($db)) { 
    448449            return $db; 
    449450        } 
     
    518519        } 
    519520 
    520         $db =& $this->getDBInstance(); 
    521         if (PEAR::isError($db)) { 
     521        $db = $this->getDBInstance(); 
     522        if (MDB2::isError($db)) { 
    522523            return $db; 
    523524        } 
     
    556557            ); 
    557558            $mdb2type_info = $db->datatype->mapNativeDatatype($res[$i]); 
    558             if (PEAR::isError($mdb2type_info)) { 
     559            if (MDB2::isError($mdb2type_info)) { 
    559560               return $mdb2type_info; 
    560561            } 
Note: See TracChangeset for help on using the changeset viewer.