cvs: pear /MDB2/MDB2/Driver/Manager mysql.php

From: Date: Fri, 21 May 2004 10:51:41 +0000
Subject: cvs: pear /MDB2/MDB2/Driver/Manager mysql.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-19723@lists.php.net to get a copy of this message
lsmith Fri May 21 06:51:41 2004 EDT Modified files: /pear/MDB2/MDB2/Driver/Manager mysql.php Log: cosmetic fixes to listTableIndexes() http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Manager/mysql.php?r1=1.8&r2=1.9&ty=u Index: pear/MDB2/MDB2/Driver/Manager/mysql.php diff -u pear/MDB2/MDB2/Driver/Manager/mysql.php:1.8 pear/MDB2/MDB2/Driver/Manager/mysql.php:1.9 --- pear/MDB2/MDB2/Driver/Manager/mysql.php:1.8 Thu Apr 29 18:40:31 2004 +++ pear/MDB2/MDB2/Driver/Manager/mysql.php Fri May 21 06:51:41 2004 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.8 2004/04/29 22:40:31 lsmith Exp $ +// $Id: mysql.php,v 1.9 2004/05/21 10:51:41 lsmith Exp $ // require_once 'MDB2/Driver/Manager/Common.php'; @@ -595,21 +595,20 @@ function listTableIndexes($table) { $db =& $GLOBALS['_MDB2_databases'][$this->db_index]; - $key_name = 'key_name'; - if (!$db->options['portability'] & MDB2_PORTABILITY_LOWERCASE) { - $key_name = ucfirst($key_name); + $key_name = 'Key_name'; + if ($db->options['portability'] & MDB2_PORTABILITY_LOWERCASE) { + $key_name = strtolower($key_name); } - $indexes_all = $db->queryCol("SHOW INDEX FROM $table", 'text', $key_name); + $query = "SHOW INDEX FROM $table"; + $indexes_all = $db->queryCol($query, 'text', $key_name); if (MDB2::isError($indexes_all)) { return $indexes_all; } - for ($found = $indexes = array(), $index = 0, $indexes_all_cnt = count($indexes_all); - $index < $indexes_all_cnt; - $index++) - { + $found = $indexes = array(); + for ($index = 0, $j = count($indexes_all); $index < $j; ++$index) { if ($indexes_all[$index] != 'PRIMARY' - && !isset($found[$indexes_all[$index]])) - { + && !isset($found[$indexes_all[$index]]) + ) { $indexes[] = $indexes_all[$index]; $found[$indexes_all[$index]] = true; }

« previous php.pear.cvs (#19723) next »