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

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

File:
1 edited

Legend:

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

    r20764 r23022  
    4444// +----------------------------------------------------------------------+ 
    4545// 
    46 // $Id: Common.php,v 1.72 2009/01/14 15:00:40 quipo Exp $ 
     46// $Id: Common.php 327310 2012-08-27 15:16:18Z danielc $ 
    4747// 
    4848 
     
    109109    function getFieldDeclarationList($fields) 
    110110    { 
    111         $db =& $this->getDBInstance(); 
    112         if (PEAR::isError($db)) { 
     111        $db = $this->getDBInstance(); 
     112        if (MDB2::isError($db)) { 
    113113            return $db; 
    114114        } 
     
    120120        foreach ($fields as $field_name => $field) { 
    121121            $query = $db->getDeclaration($field['type'], $field_name, $field); 
    122             if (PEAR::isError($query)) { 
     122            if (MDB2::isError($query)) { 
    123123                return $query; 
    124124            } 
     
    141141    function _fixSequenceName($sqn, $check = false) 
    142142    { 
    143         $db =& $this->getDBInstance(); 
    144         if (PEAR::isError($db)) { 
     143        $db = $this->getDBInstance(); 
     144        if (MDB2::isError($db)) { 
    145145            return $db; 
    146146        } 
     
    169169    function _fixIndexName($idx) 
    170170    { 
    171         $db =& $this->getDBInstance(); 
    172         if (PEAR::isError($db)) { 
     171        $db = $this->getDBInstance(); 
     172        if (MDB2::isError($db)) { 
    173173            return $db; 
    174174        } 
     
    196196    function createDatabase($database, $options = array()) 
    197197    { 
    198         $db =& $this->getDBInstance(); 
    199         if (PEAR::isError($db)) { 
     198        $db = $this->getDBInstance(); 
     199        if (MDB2::isError($db)) { 
    200200            return $db; 
    201201        } 
     
    219219    function alterDatabase($database, $options = array()) 
    220220    { 
    221         $db =& $this->getDBInstance(); 
    222         if (PEAR::isError($db)) { 
     221        $db = $this->getDBInstance(); 
     222        if (MDB2::isError($db)) { 
    223223            return $db; 
    224224        } 
     
    240240    function dropDatabase($database) 
    241241    { 
    242         $db =& $this->getDBInstance(); 
    243         if (PEAR::isError($db)) { 
     242        $db = $this->getDBInstance(); 
     243        if (MDB2::isError($db)) { 
    244244            return $db; 
    245245        } 
     
    264264    function _getCreateTableQuery($name, $fields, $options = array()) 
    265265    { 
    266         $db =& $this->getDBInstance(); 
    267         if (PEAR::isError($db)) { 
     266        $db = $this->getDBInstance(); 
     267        if (MDB2::isError($db)) { 
    268268            return $db; 
    269269        } 
     
    278278        } 
    279279        $query_fields = $this->getFieldDeclarationList($fields); 
    280         if (PEAR::isError($query_fields)) { 
     280        if (MDB2::isError($query_fields)) { 
    281281            return $query_fields; 
    282282        } 
     
    354354    { 
    355355        $query = $this->_getCreateTableQuery($name, $fields, $options); 
    356         if (PEAR::isError($query)) { 
     356        if (MDB2::isError($query)) { 
    357357            return $query; 
    358358        } 
    359         $db =& $this->getDBInstance(); 
    360         if (PEAR::isError($db)) { 
     359        $db = $this->getDBInstance(); 
     360        if (MDB2::isError($db)) { 
    361361            return $db; 
    362362        } 
    363363        $result = $db->exec($query); 
    364         if (PEAR::isError($result)) { 
     364        if (MDB2::isError($result)) { 
    365365            return $result; 
    366366        } 
     
    380380    function dropTable($name) 
    381381    { 
    382         $db =& $this->getDBInstance(); 
    383         if (PEAR::isError($db)) { 
     382        $db = $this->getDBInstance(); 
     383        if (MDB2::isError($db)) { 
    384384            return $db; 
    385385        } 
    386386 
    387387        $name = $db->quoteIdentifier($name, true); 
    388         return $db->exec("DROP TABLE $name"); 
     388        $result = $db->exec("DROP TABLE $name"); 
     389        if (MDB2::isError($result)) { 
     390            return $result; 
     391        } 
     392        return MDB2_OK; 
    389393    } 
    390394 
     
    402406    function truncateTable($name) 
    403407    { 
    404         $db =& $this->getDBInstance(); 
    405         if (PEAR::isError($db)) { 
     408        $db = $this->getDBInstance(); 
     409        if (MDB2::isError($db)) { 
    406410            return $db; 
    407411        } 
    408412 
    409413        $name = $db->quoteIdentifier($name, true); 
    410         return $db->exec("DELETE FROM $name"); 
     414        $result = $db->exec("DELETE FROM $name"); 
     415        if (MDB2::isError($result)) { 
     416            return $result; 
     417        } 
     418        return MDB2_OK; 
    411419    } 
    412420 
     
    430438    function vacuum($table = null, $options = array()) 
    431439    { 
    432         $db =& $this->getDBInstance(); 
    433         if (PEAR::isError($db)) { 
     440        $db = $this->getDBInstance(); 
     441        if (MDB2::isError($db)) { 
    434442            return $db; 
    435443        } 
     
    534542    function alterTable($name, $changes, $check) 
    535543    { 
    536         $db =& $this->getDBInstance(); 
    537         if (PEAR::isError($db)) { 
     544        $db = $this->getDBInstance(); 
     545        if (MDB2::isError($db)) { 
    538546            return $db; 
    539547        } 
     
    554562    function listDatabases() 
    555563    { 
    556         $db =& $this->getDBInstance(); 
    557         if (PEAR::isError($db)) { 
     564        $db = $this->getDBInstance(); 
     565        if (MDB2::isError($db)) { 
    558566            return $db; 
    559567        } 
     
    574582    function listUsers() 
    575583    { 
    576         $db =& $this->getDBInstance(); 
    577         if (PEAR::isError($db)) { 
     584        $db = $this->getDBInstance(); 
     585        if (MDB2::isError($db)) { 
    578586            return $db; 
    579587        } 
     
    597605    function listViews($database = null) 
    598606    { 
    599         $db =& $this->getDBInstance(); 
    600         if (PEAR::isError($db)) { 
     607        $db = $this->getDBInstance(); 
     608        if (MDB2::isError($db)) { 
    601609            return $db; 
    602610        } 
     
    618626    function listTableViews($table) 
    619627    { 
    620         $db =& $this->getDBInstance(); 
    621         if (PEAR::isError($db)) { 
     628        $db = $this->getDBInstance(); 
     629        if (MDB2::isError($db)) { 
    622630            return $db; 
    623631        } 
     
    639647    function listTableTriggers($table = null) 
    640648    { 
    641         $db =& $this->getDBInstance(); 
    642         if (PEAR::isError($db)) { 
     649        $db = $this->getDBInstance(); 
     650        if (MDB2::isError($db)) { 
    643651            return $db; 
    644652        } 
     
    659667    function listFunctions() 
    660668    { 
    661         $db =& $this->getDBInstance(); 
    662         if (PEAR::isError($db)) { 
     669        $db = $this->getDBInstance(); 
     670        if (MDB2::isError($db)) { 
    663671            return $db; 
    664672        } 
     
    682690    function listTables($database = null) 
    683691    { 
    684         $db =& $this->getDBInstance(); 
    685         if (PEAR::isError($db)) { 
     692        $db = $this->getDBInstance(); 
     693        if (MDB2::isError($db)) { 
    686694            return $db; 
    687695        } 
     
    703711    function listTableFields($table) 
    704712    { 
    705         $db =& $this->getDBInstance(); 
    706         if (PEAR::isError($db)) { 
     713        $db = $this->getDBInstance(); 
     714        if (MDB2::isError($db)) { 
    707715            return $db; 
    708716        } 
     
    749757    function createIndex($table, $name, $definition) 
    750758    { 
    751         $db =& $this->getDBInstance(); 
    752         if (PEAR::isError($db)) { 
     759        $db = $this->getDBInstance(); 
     760        if (MDB2::isError($db)) { 
    753761            return $db; 
    754762        } 
     
    762770        } 
    763771        $query .= ' ('. implode(', ', $fields) . ')'; 
    764         return $db->exec($query); 
     772        $result = $db->exec($query); 
     773        if (MDB2::isError($result)) { 
     774            return $result; 
     775        } 
     776        return MDB2_OK; 
    765777    } 
    766778 
     
    778790    function dropIndex($table, $name) 
    779791    { 
    780         $db =& $this->getDBInstance(); 
    781         if (PEAR::isError($db)) { 
     792        $db = $this->getDBInstance(); 
     793        if (MDB2::isError($db)) { 
    782794            return $db; 
    783795        } 
    784796 
    785797        $name = $db->quoteIdentifier($db->getIndexName($name), true); 
    786         return $db->exec("DROP INDEX $name"); 
     798        $result = $db->exec("DROP INDEX $name"); 
     799        if (MDB2::isError($result)) { 
     800            return $result; 
     801        } 
     802        return MDB2_OK; 
    787803    } 
    788804 
     
    799815    function listTableIndexes($table) 
    800816    { 
    801         $db =& $this->getDBInstance(); 
    802         if (PEAR::isError($db)) { 
     817        $db = $this->getDBInstance(); 
     818        if (MDB2::isError($db)) { 
    803819            return $db; 
    804820        } 
     
    868884    function createConstraint($table, $name, $definition) 
    869885    { 
    870         $db =& $this->getDBInstance(); 
    871         if (PEAR::isError($db)) { 
     886        $db = $this->getDBInstance(); 
     887        if (MDB2::isError($db)) { 
    872888            return $db; 
    873889        } 
     
    896912            $query .= $this->_getAdvancedFKOptions($definition); 
    897913        } 
    898         return $db->exec($query); 
     914        $result = $db->exec($query); 
     915        if (MDB2::isError($result)) { 
     916            return $result; 
     917        } 
     918        return MDB2_OK; 
    899919    } 
    900920 
     
    913933    function dropConstraint($table, $name, $primary = false) 
    914934    { 
    915         $db =& $this->getDBInstance(); 
    916         if (PEAR::isError($db)) { 
     935        $db = $this->getDBInstance(); 
     936        if (MDB2::isError($db)) { 
    917937            return $db; 
    918938        } 
     
    920940        $table = $db->quoteIdentifier($table, true); 
    921941        $name = $db->quoteIdentifier($db->getIndexName($name), true); 
    922         return $db->exec("ALTER TABLE $table DROP CONSTRAINT $name"); 
     942        $result = $db->exec("ALTER TABLE $table DROP CONSTRAINT $name"); 
     943        if (MDB2::isError($result)) { 
     944            return $result; 
     945        } 
     946        return MDB2_OK; 
    923947    } 
    924948 
     
    935959    function listTableConstraints($table) 
    936960    { 
    937         $db =& $this->getDBInstance(); 
    938         if (PEAR::isError($db)) { 
     961        $db = $this->getDBInstance(); 
     962        if (MDB2::isError($db)) { 
    939963            return $db; 
    940964        } 
     
    957981    function createSequence($seq_name, $start = 1) 
    958982    { 
    959         $db =& $this->getDBInstance(); 
    960         if (PEAR::isError($db)) { 
     983        $db = $this->getDBInstance(); 
     984        if (MDB2::isError($db)) { 
    961985            return $db; 
    962986        } 
     
    9781002    function dropSequence($name) 
    9791003    { 
    980         $db =& $this->getDBInstance(); 
    981         if (PEAR::isError($db)) { 
     1004        $db = $this->getDBInstance(); 
     1005        if (MDB2::isError($db)) { 
    9821006            return $db; 
    9831007        } 
     
    10011025    function listSequences($database = null) 
    10021026    { 
    1003         $db =& $this->getDBInstance(); 
    1004         if (PEAR::isError($db)) { 
     1027        $db = $this->getDBInstance(); 
     1028        if (MDB2::isError($db)) { 
    10051029            return $db; 
    10061030        } 
Note: See TracChangeset for help on using the changeset viewer.