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/Manager/mysql.php

    r20764 r23022  
    4343// +----------------------------------------------------------------------+ 
    4444// 
    45 // $Id: mysql.php,v 1.113 2008/11/23 20:30:29 quipo Exp $ 
     45// $Id: mysql.php 327310 2012-08-27 15:16:18Z danielc $ 
    4646// 
    4747 
     
    7272    function createDatabase($name, $options = array()) 
    7373    { 
    74         $db =& $this->getDBInstance(); 
    75         if (PEAR::isError($db)) { 
     74        $db = $this->getDBInstance(); 
     75        if (MDB2::isError($db)) { 
    7676            return $db; 
    7777        } 
     
    102102    function alterDatabase($name, $options = array()) 
    103103    { 
    104         $db =& $this->getDBInstance(); 
    105         if (PEAR::isError($db)) { 
     104        $db = $this->getDBInstance(); 
     105        if (MDB2::isError($db)) { 
    106106            return $db; 
    107107        } 
     
    129129    function dropDatabase($name) 
    130130    { 
    131         $db =& $this->getDBInstance(); 
    132         if (PEAR::isError($db)) { 
     131        $db = $this->getDBInstance(); 
     132        if (MDB2::isError($db)) { 
    133133            return $db; 
    134134        } 
     
    205205    function createTable($name, $fields, $options = array()) 
    206206    { 
    207         $db =& $this->getDBInstance(); 
    208         if (PEAR::isError($db)) { 
     207        $db = $this->getDBInstance(); 
     208        if (MDB2::isError($db)) { 
    209209            return $db; 
    210210        } 
     
    223223                } 
    224224            } 
    225             if (!is_null($autoincrement) && count($pk_fields) > 1) { 
     225            if ((null !== $autoincrement) && count($pk_fields) > 1) { 
    226226                $options['primary'] = $pk_fields; 
    227227            } else { 
     
    232232 
    233233        $query = $this->_getCreateTableQuery($name, $fields, $options); 
    234         if (PEAR::isError($query)) { 
     234        if (MDB2::isError($query)) { 
    235235            return $query; 
    236236        } 
    237237 
    238         if (!is_null($autoincrement)) { 
     238        if (null !== $autoincrement) { 
    239239            // we have to remove the PK clause added by _getIntegerDeclaration() 
    240240            $query = str_replace('AUTO_INCREMENT PRIMARY KEY', 'AUTO_INCREMENT', $query); 
     
    268268        } 
    269269        $result = $db->exec($query); 
    270         if (PEAR::isError($result)) { 
     270        if (MDB2::isError($result)) { 
    271271            return $result; 
    272272        } 
     
    286286    function dropTable($name) 
    287287    { 
    288         $db =& $this->getDBInstance(); 
    289         if (PEAR::isError($db)) { 
     288        $db = $this->getDBInstance(); 
     289        if (MDB2::isError($db)) { 
    290290            return $db; 
    291291        } 
     
    293293        //delete the triggers associated to existing FK constraints 
    294294        $constraints = $this->listTableConstraints($name); 
    295         if (!PEAR::isError($constraints) && !empty($constraints)) { 
     295        if (!MDB2::isError($constraints) && !empty($constraints)) { 
    296296            $db->loadModule('Reverse', null, true); 
    297297            foreach ($constraints as $constraint) { 
    298298                $definition = $db->reverse->getTableConstraintDefinition($name, $constraint); 
    299                 if (!PEAR::isError($definition) && !empty($definition['foreign'])) { 
     299                if (!MDB2::isError($definition) && !empty($definition['foreign'])) { 
    300300                    $result = $this->_dropFKTriggers($name, $constraint, $definition['references']['table']); 
    301                     if (PEAR::isError($result)) { 
     301                    if (MDB2::isError($result)) { 
    302302                        return $result; 
    303303                    } 
     
    322322    function truncateTable($name) 
    323323    { 
    324         $db =& $this->getDBInstance(); 
    325         if (PEAR::isError($db)) { 
     324        $db = $this->getDBInstance(); 
     325        if (MDB2::isError($db)) { 
    326326            return $db; 
    327327        } 
    328328 
    329329        $name = $db->quoteIdentifier($name, true); 
    330         return $db->exec("TRUNCATE TABLE $name"); 
     330        $result = $db->exec("TRUNCATE TABLE $name"); 
     331        if (MDB2::isError($result)) { 
     332            return $result; 
     333        } 
     334        return MDB2_OK; 
    331335    } 
    332336 
     
    350354    function vacuum($table = null, $options = array()) 
    351355    { 
    352         $db =& $this->getDBInstance(); 
    353         if (PEAR::isError($db)) { 
     356        $db = $this->getDBInstance(); 
     357        if (MDB2::isError($db)) { 
    354358            return $db; 
    355359        } 
     
    357361        if (empty($table)) { 
    358362            $table = $this->listTables(); 
    359             if (PEAR::isError($table)) { 
     363            if (MDB2::isError($table)) { 
    360364                return $table; 
    361365            } 
     
    371375         
    372376        $result = $db->exec('OPTIMIZE TABLE '.$table); 
    373         if (PEAR::isError($result)) { 
     377        if (MDB2::isError($result)) { 
    374378            return $result; 
    375379        } 
    376380        if (!empty($options['analyze'])) { 
    377             return $db->exec('ANALYZE TABLE '.$table); 
     381            $result = $db->exec('ANALYZE TABLE '.$table); 
     382            if (MDB2::isError($result)) { 
     383                return $result; 
     384            } 
    378385        } 
    379386        return MDB2_OK; 
     
    475482    function alterTable($name, $changes, $check) 
    476483    { 
    477         $db =& $this->getDBInstance(); 
    478         if (PEAR::isError($db)) { 
     484        $db = $this->getDBInstance(); 
     485        if (MDB2::isError($db)) { 
    479486            return $db; 
    480487        } 
     
    562569 
    563570        $name = $db->quoteIdentifier($name, true); 
    564         return $db->exec("ALTER TABLE $name $query"); 
     571        $result = $db->exec("ALTER TABLE $name $query"); 
     572        if (MDB2::isError($result)) { 
     573            return $result; 
     574        } 
     575        return MDB2_OK; 
    565576    } 
    566577 
     
    576587    function listDatabases() 
    577588    { 
    578         $db =& $this->getDBInstance(); 
    579         if (PEAR::isError($db)) { 
     589        $db = $this->getDBInstance(); 
     590        if (MDB2::isError($db)) { 
    580591            return $db; 
    581592        } 
    582593 
    583594        $result = $db->queryCol('SHOW DATABASES'); 
    584         if (PEAR::isError($result)) { 
     595        if (MDB2::isError($result)) { 
    585596            return $result; 
    586597        } 
     
    602613    function listUsers() 
    603614    { 
    604         $db =& $this->getDBInstance(); 
    605         if (PEAR::isError($db)) { 
     615        $db = $this->getDBInstance(); 
     616        if (MDB2::isError($db)) { 
    606617            return $db; 
    607618        } 
     
    621632    function listFunctions() 
    622633    { 
    623         $db =& $this->getDBInstance(); 
    624         if (PEAR::isError($db)) { 
     634        $db = $this->getDBInstance(); 
     635        if (MDB2::isError($db)) { 
    625636            return $db; 
    626637        } 
     
    633644        */ 
    634645        $result = $db->queryCol($query); 
    635         if (PEAR::isError($result)) { 
     646        if (MDB2::isError($result)) { 
    636647            return $result; 
    637648        } 
     
    654665    function listTableTriggers($table = null) 
    655666    { 
    656         $db =& $this->getDBInstance(); 
    657         if (PEAR::isError($db)) { 
     667        $db = $this->getDBInstance(); 
     668        if (MDB2::isError($db)) { 
    658669            return $db; 
    659670        } 
    660671 
    661672        $query = 'SHOW TRIGGERS'; 
    662         if (!is_null($table)) { 
     673        if (null !== $table) { 
    663674            $table = $db->quote($table, 'text'); 
    664675            $query .= " LIKE $table"; 
    665676        } 
    666677        $result = $db->queryCol($query); 
    667         if (PEAR::isError($result)) { 
     678        if (MDB2::isError($result)) { 
    668679            return $result; 
    669680        } 
     
    686697    function listTables($database = null) 
    687698    { 
    688         $db =& $this->getDBInstance(); 
    689         if (PEAR::isError($db)) { 
     699        $db = $this->getDBInstance(); 
     700        if (MDB2::isError($db)) { 
    690701            return $db; 
    691702        } 
    692703 
    693704        $query = "SHOW /*!50002 FULL*/ TABLES"; 
    694         if (!is_null($database)) { 
     705        if (null !== $database) { 
    695706            $query .= " FROM $database"; 
    696707        } 
     
    698709 
    699710        $table_names = $db->queryAll($query, null, MDB2_FETCHMODE_ORDERED); 
    700         if (PEAR::isError($table_names)) { 
     711        if (MDB2::isError($table_names)) { 
    701712            return $table_names; 
    702713        } 
     
    726737    function listViews($database = null) 
    727738    { 
    728         $db =& $this->getDBInstance(); 
    729         if (PEAR::isError($db)) { 
     739        $db = $this->getDBInstance(); 
     740        if (MDB2::isError($db)) { 
    730741            return $db; 
    731742        } 
    732743 
    733744        $query = 'SHOW FULL TABLES'; 
    734         if (!is_null($database)) { 
     745        if (null !== $database) { 
    735746            $query.= " FROM $database"; 
    736747        } 
     
    738749 
    739750        $result = $db->queryCol($query); 
    740         if (PEAR::isError($result)) { 
     751        if (MDB2::isError($result)) { 
    741752            return $result; 
    742753        } 
     
    760771    function listTableFields($table) 
    761772    { 
    762         $db =& $this->getDBInstance(); 
    763         if (PEAR::isError($db)) { 
     773        $db = $this->getDBInstance(); 
     774        if (MDB2::isError($db)) { 
    764775            return $db; 
    765776        } 
     
    767778        $table = $db->quoteIdentifier($table, true); 
    768779        $result = $db->queryCol("SHOW COLUMNS FROM $table"); 
    769         if (PEAR::isError($result)) { 
     780        if (MDB2::isError($result)) { 
    770781            return $result; 
    771782        } 
     
    816827    function createIndex($table, $name, $definition) 
    817828    { 
    818         $db =& $this->getDBInstance(); 
    819         if (PEAR::isError($db)) { 
     829        $db = $this->getDBInstance(); 
     830        if (MDB2::isError($db)) { 
    820831            return $db; 
    821832        } 
     
    833844        } 
    834845        $query .= ' ('. implode(', ', $fields) . ')'; 
    835         return $db->exec($query); 
     846        $result = $db->exec($query); 
     847        if (MDB2::isError($result)) { 
     848            return $result; 
     849        } 
     850        return MDB2_OK; 
    836851    } 
    837852 
     
    849864    function dropIndex($table, $name) 
    850865    { 
    851         $db =& $this->getDBInstance(); 
    852         if (PEAR::isError($db)) { 
     866        $db = $this->getDBInstance(); 
     867        if (MDB2::isError($db)) { 
    853868            return $db; 
    854869        } 
     
    856871        $table = $db->quoteIdentifier($table, true); 
    857872        $name = $db->quoteIdentifier($db->getIndexName($name), true); 
    858         return $db->exec("DROP INDEX $name ON $table"); 
     873        $result = $db->exec("DROP INDEX $name ON $table"); 
     874        if (MDB2::isError($result)) { 
     875            return $result; 
     876        } 
     877        return MDB2_OK; 
    859878    } 
    860879 
     
    871890    function listTableIndexes($table) 
    872891    { 
    873         $db =& $this->getDBInstance(); 
    874         if (PEAR::isError($db)) { 
     892        $db = $this->getDBInstance(); 
     893        if (MDB2::isError($db)) { 
    875894            return $db; 
    876895        } 
     
    891910        $query = "SHOW INDEX FROM $table"; 
    892911        $indexes = $db->queryAll($query, null, MDB2_FETCHMODE_ASSOC); 
    893         if (PEAR::isError($indexes)) { 
     912        if (MDB2::isError($indexes)) { 
    894913            return $indexes; 
    895914        } 
     
    935954    function createConstraint($table, $name, $definition) 
    936955    { 
    937         $db =& $this->getDBInstance(); 
    938         if (PEAR::isError($db)) { 
     956        $db = $this->getDBInstance(); 
     957        if (MDB2::isError($db)) { 
    939958            return $db; 
    940959        } 
     
    9811000            // @see http://forums.mysql.com/read.php?22,19755,226009 
    9821001            $result = $this->createIndex($table, $name.'_fkidx', $definition); 
    983             if (PEAR::isError($result)) { 
     1002            if (MDB2::isError($result)) { 
    9841003                return $result; 
    9851004            } 
    9861005        } 
    9871006        $res = $db->exec($query); 
    988         if (PEAR::isError($res)) { 
     1007        if (MDB2::isError($res)) { 
    9891008            return $res; 
    9901009        } 
     
    10091028    function dropConstraint($table, $name, $primary = false) 
    10101029    { 
    1011         $db =& $this->getDBInstance(); 
    1012         if (PEAR::isError($db)) { 
     1030        $db = $this->getDBInstance(); 
     1031        if (MDB2::isError($db)) { 
    10131032            return $db; 
    10141033        } 
     
    10161035        if ($primary || strtolower($name) == 'primary') { 
    10171036            $query = 'ALTER TABLE '. $db->quoteIdentifier($table, true) .' DROP PRIMARY KEY'; 
    1018             return $db->exec($query); 
     1037            $result = $db->exec($query); 
     1038            if (MDB2::isError($result)) { 
     1039                return $result; 
     1040            } 
     1041            return MDB2_OK; 
    10191042        } 
    10201043 
     
    10221045        $db->loadModule('Reverse', null, true); 
    10231046        $definition = $db->reverse->getTableConstraintDefinition($table, $name); 
    1024         if (!PEAR::isError($definition) && !empty($definition['foreign'])) { 
     1047        if (!MDB2::isError($definition) && !empty($definition['foreign'])) { 
    10251048            //first drop the FK enforcing triggers 
    10261049            $result = $this->_dropFKTriggers($table, $name, $definition['references']['table']); 
    1027             if (PEAR::isError($result)) { 
     1050            if (MDB2::isError($result)) { 
    10281051                return $result; 
    10291052            } 
     
    10321055            $name = $db->quoteIdentifier($db->getIndexName($name), true); 
    10331056            $query = "ALTER TABLE $table DROP FOREIGN KEY $name"; 
    1034             return $db->exec($query); 
     1057            $result = $db->exec($query); 
     1058            if (MDB2::isError($result)) { 
     1059                return $result; 
     1060            } 
     1061            return MDB2_OK; 
    10351062        } 
    10361063 
     
    10381065        $name = $db->quoteIdentifier($db->getIndexName($name), true); 
    10391066        $query = "ALTER TABLE $table DROP INDEX $name"; 
    1040         return $db->exec($query); 
     1067        $result = $db->exec($query); 
     1068        if (MDB2::isError($result)) { 
     1069            return $result; 
     1070        } 
     1071        return MDB2_OK; 
    10411072    } 
    10421073 
     
    10591090    function _createFKTriggers($table, $foreign_keys) 
    10601091    { 
    1061         $db =& $this->getDBInstance(); 
    1062         if (PEAR::isError($db)) { 
     1092        $db = $this->getDBInstance(); 
     1093        if (MDB2::isError($db)) { 
    10631094            return $db; 
    10641095        } 
     
    11041135                    $conditions2[]  = 'NEW.'.$referenced_fields[$i] .' <> OLD.'.$referenced_fields[$i]; 
    11051136                } 
    1106                 $restrict_action .= implode(' AND ', $conditions).') IS NOT NULL' 
    1107                                 .' AND (' .implode(' OR ', $conditions2) .')' 
    1108                                 .' THEN CALL %s_ON_TABLE_'.$table.'_VIOLATES_FOREIGN_KEY_CONSTRAINT();' 
    1109                                 .' END IF;'; 
     1137 
     1138                $restrict_action .= implode(' AND ', $conditions).') IS NOT NULL'; 
     1139                $restrict_action2 = empty($conditions2) ? '' : ' AND (' .implode(' OR ', $conditions2) .')'; 
     1140                $restrict_action3 = ' THEN CALL %s_ON_TABLE_'.$table.'_VIOLATES_FOREIGN_KEY_CONSTRAINT();' 
     1141                                   .' END IF;'; 
     1142 
     1143                $restrict_action_update = $restrict_action . $restrict_action2 . $restrict_action3; 
     1144                $restrict_action_delete = $restrict_action . $restrict_action3; // There is no NEW row in on DELETE trigger 
    11101145 
    11111146                $cascade_action_update = 'UPDATE '.$table_quoted.' SET '.implode(', ', $new_values) .' WHERE '.implode(' AND ', $conditions). ';'; 
     
    11181153                    foreach ($table_fields as $table_field) { 
    11191154                        $field_definition = $db->reverse->getTableFieldDefinition($table, $field); 
    1120                         if (PEAR::isError($field_definition)) { 
     1155                        if (MDB2::isError($field_definition)) { 
    11211156                            return $field_definition; 
    11221157                        } 
     
    11381173                    $sql_update = sprintf($query, $trigger_names['pk_update'], 'BEFORE UPDATE', 'update') . $setdefault_action; 
    11391174                } elseif ('NO ACTION' == $fkdef['onupdate']) { 
    1140                     $sql_update = sprintf($query.$restrict_action, $trigger_names['pk_update'], 'AFTER UPDATE', 'update'); 
     1175                    $sql_update = sprintf($query.$restrict_action_update, $trigger_names['pk_update'], 'AFTER UPDATE', 'update'); 
    11411176                } elseif ('RESTRICT' == $fkdef['onupdate']) { 
    1142                     $sql_update = sprintf($query.$restrict_action, $trigger_names['pk_update'], 'BEFORE UPDATE', 'update'); 
     1177                    $sql_update = sprintf($query.$restrict_action_update, $trigger_names['pk_update'], 'BEFORE UPDATE', 'update'); 
    11431178                } 
    11441179                if ('CASCADE' == $fkdef['ondelete']) { 
     
    11491184                    $sql_delete = sprintf($query, $trigger_names['pk_delete'], 'BEFORE DELETE', 'delete') . $setdefault_action; 
    11501185                } elseif ('NO ACTION' == $fkdef['ondelete']) { 
    1151                     $sql_delete = sprintf($query.$restrict_action, $trigger_names['pk_delete'], 'AFTER DELETE', 'delete'); 
     1186                    $sql_delete = sprintf($query.$restrict_action_delete, $trigger_names['pk_delete'], 'AFTER DELETE', 'delete'); 
    11521187                } elseif ('RESTRICT' == $fkdef['ondelete']) { 
    1153                     $sql_delete = sprintf($query.$restrict_action, $trigger_names['pk_delete'], 'BEFORE DELETE', 'delete'); 
     1188                    $sql_delete = sprintf($query.$restrict_action_delete, $trigger_names['pk_delete'], 'BEFORE DELETE', 'delete'); 
    11541189                } 
    11551190                $sql_update .= ' SET FOREIGN_KEY_CHECKS = 1; END;'; 
     
    11621197                $db->popExpect(); 
    11631198                $db->popErrorHandling(); 
    1164                 if (PEAR::isError($result)) { 
     1199                if (MDB2::isError($result)) { 
    11651200                    if ($result->getCode() != MDB2_ERROR_CANNOT_CREATE) { 
    11661201                        return $result; 
     
    11731208                $db->popExpect(); 
    11741209                $db->popErrorHandling(); 
    1175                 if (PEAR::isError($result) && $result->getCode() != MDB2_ERROR_CANNOT_CREATE) { 
     1210                if (MDB2::isError($result) && $result->getCode() != MDB2_ERROR_CANNOT_CREATE) { 
    11761211                    if ($result->getCode() != MDB2_ERROR_CANNOT_CREATE) { 
    11771212                        return $result; 
     
    11991234    function _dropFKTriggers($table, $fkname, $referenced_table) 
    12001235    { 
    1201         $db =& $this->getDBInstance(); 
    1202         if (PEAR::isError($db)) { 
     1236        $db = $this->getDBInstance(); 
     1237        if (MDB2::isError($db)) { 
    12031238            return $db; 
    12041239        } 
     
    12061241        $triggers  = $this->listTableTriggers($table); 
    12071242        $triggers2 = $this->listTableTriggers($referenced_table); 
    1208         if (!PEAR::isError($triggers2) && !PEAR::isError($triggers)) { 
     1243        if (!MDB2::isError($triggers2) && !MDB2::isError($triggers)) { 
    12091244            $triggers = array_merge($triggers, $triggers2); 
    12101245            $pattern = '/^'.$fkname.'(_pk)?_(insert|update|delete)_trg$/i'; 
     
    12121247                if (preg_match($pattern, $trigger)) { 
    12131248                    $result = $db->exec('DROP TRIGGER '.$trigger); 
    1214                     if (PEAR::isError($result)) { 
     1249                    if (MDB2::isError($result)) { 
    12151250                        return $result; 
    12161251                    } 
     
    12331268    function listTableConstraints($table) 
    12341269    { 
    1235         $db =& $this->getDBInstance(); 
    1236         if (PEAR::isError($db)) { 
     1270        $db = $this->getDBInstance(); 
     1271        if (MDB2::isError($db)) { 
    12371272            return $db; 
    12381273        } 
     
    12521287        $query = 'SHOW INDEX FROM ' . $db->quoteIdentifier($table, true); 
    12531288        $indexes = $db->queryAll($query, null, MDB2_FETCHMODE_ASSOC); 
    1254         if (PEAR::isError($indexes)) { 
     1289        if (MDB2::isError($indexes)) { 
    12551290            return $indexes; 
    12561291        } 
     
    12731308        $query = 'SHOW CREATE TABLE '. $db->escape($table); 
    12741309        $definition = $db->queryOne($query, 'text', 1); 
    1275         if (!PEAR::isError($definition) && !empty($definition)) { 
     1310        if (!MDB2::isError($definition) && !empty($definition)) { 
    12761311            $pattern = '/\bCONSTRAINT\b\s+([^\s]+)\s+\bFOREIGN KEY\b/Uims'; 
    12771312            if (preg_match_all($pattern, str_replace('`', '', $definition), $matches) > 0) { 
     
    13081343    function createSequence($seq_name, $start = 1, $options = array()) 
    13091344    { 
    1310         $db =& $this->getDBInstance(); 
    1311         if (PEAR::isError($db)) { 
     1345        $db = $this->getDBInstance(); 
     1346        if (MDB2::isError($db)) { 
    13121347            return $db; 
    13131348        } 
     
    13441379        } 
    13451380        $res = $db->exec($query); 
    1346         if (PEAR::isError($res)) { 
     1381        if (MDB2::isError($res)) { 
    13471382            return $res; 
    13481383        } 
     
    13541389        $query = "INSERT INTO $sequence_name ($seqcol_name) VALUES (".($start-1).')'; 
    13551390        $res = $db->exec($query); 
    1356         if (!PEAR::isError($res)) { 
     1391        if (!MDB2::isError($res)) { 
    13571392            return MDB2_OK; 
    13581393        } 
     
    13601395        // Handle error 
    13611396        $result = $db->exec("DROP TABLE $sequence_name"); 
    1362         if (PEAR::isError($result)) { 
     1397        if (MDB2::isError($result)) { 
    13631398            return $db->raiseError($result, null, null, 
    13641399                'could not drop inconsistent sequence table', __FUNCTION__); 
     
    13811416    function dropSequence($seq_name) 
    13821417    { 
    1383         $db =& $this->getDBInstance(); 
    1384         if (PEAR::isError($db)) { 
     1418        $db = $this->getDBInstance(); 
     1419        if (MDB2::isError($db)) { 
    13851420            return $db; 
    13861421        } 
    13871422 
    13881423        $sequence_name = $db->quoteIdentifier($db->getSequenceName($seq_name), true); 
    1389         return $db->exec("DROP TABLE $sequence_name"); 
     1424        $result = $db->exec("DROP TABLE $sequence_name"); 
     1425        if (MDB2::isError($result)) { 
     1426            return $result; 
     1427        } 
     1428        return MDB2_OK; 
    13901429    } 
    13911430 
     
    14021441    function listSequences($database = null) 
    14031442    { 
    1404         $db =& $this->getDBInstance(); 
    1405         if (PEAR::isError($db)) { 
     1443        $db = $this->getDBInstance(); 
     1444        if (MDB2::isError($db)) { 
    14061445            return $db; 
    14071446        } 
    14081447 
    14091448        $query = "SHOW TABLES"; 
    1410         if (!is_null($database)) { 
     1449        if (null !== $database) { 
    14111450            $query .= " FROM $database"; 
    14121451        } 
    14131452        $table_names = $db->queryCol($query); 
    1414         if (PEAR::isError($table_names)) { 
     1453        if (MDB2::isError($table_names)) { 
    14151454            return $table_names; 
    14161455        } 
Note: See TracChangeset for help on using the changeset viewer.