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

From: Date: Sat, 15 Oct 2005 12:24:20 +0000
Subject: cvs: pear /MDB2/MDB2/Driver/Manager mysql.php mysqli.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-35575@lists.php.net to get a copy of this message
lsmith Sat Oct 15 08:24:20 2005 EDT Modified files: /pear/MDB2/MDB2/Driver/Manager mysql.php mysqli.php Log: - hide contraints from indexes and vice versa in the list methods - revert back to ALTER TABLE in constraint dropping http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Manager/mysql.php?r1=1.44&r2=1.45&ty=u Index: pear/MDB2/MDB2/Driver/Manager/mysql.php diff -u pear/MDB2/MDB2/Driver/Manager/mysql.php:1.44 pear/MDB2/MDB2/Driver/Manager/mysql.php:1.45 --- pear/MDB2/MDB2/Driver/Manager/mysql.php:1.44 Sat Oct 15 04:53:20 2005 +++ pear/MDB2/MDB2/Driver/Manager/mysql.php Sat Oct 15 08:24:20 2005 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.44 2005/10/15 08:53:20 lsmith Exp $ +// $Id: mysql.php,v 1.45 2005/10/15 12:24:20 lsmith Exp $ // require_once 'MDB2/Driver/Manager/Common.php'; @@ -589,7 +589,7 @@ return $indexes_all; } - $result = array_unique($indexes_all); + $result = array_diff(array_unique($indexes_all), array('PRIMARY')); if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) { $result = array_map(($db->options['field_case'] == CASE_LOWER ? 'strtolower' : 'strtoupper'), $result); } @@ -668,10 +668,10 @@ $table = $db->quoteIdentifier($table); if (strtolower($name) == 'primary') { - $query = "DROP INDEX PRIMARY KEY ON $table"; + $query = "ALTER TABLE $table DROP PRIMARY KEY"; } else { $name = $db->quoteIdentifier($name); - $query = "DROP INDEX FOREIGN KEY $name ON $table"; + $query = "ALTER TABLE $table DROP FOREIGN KEY $name"; } return $db->query($query); } @@ -709,7 +709,7 @@ return $indexes_all; } - $result = array_unique($indexes_all); + $result = array_intersect(array_unique($indexes_all), array('PRIMARY')); if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) { $result = array_map(($db->options['field_case'] == CASE_LOWER ? 'strtolower' : 'strtoupper'), $result); } http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/Manager/mysqli.php?r1=1.31&r2=1.32&ty=u Index: pear/MDB2/MDB2/Driver/Manager/mysqli.php diff -u pear/MDB2/MDB2/Driver/Manager/mysqli.php:1.31 pear/MDB2/MDB2/Driver/Manager/mysqli.php:1.32 --- pear/MDB2/MDB2/Driver/Manager/mysqli.php:1.31 Sat Oct 15 04:53:20 2005 +++ pear/MDB2/MDB2/Driver/Manager/mysqli.php Sat Oct 15 08:24:20 2005 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.31 2005/10/15 08:53:20 lsmith Exp $ +// $Id: mysqli.php,v 1.32 2005/10/15 12:24:20 lsmith Exp $ // require_once 'MDB2/Driver/Manager/Common.php'; @@ -589,7 +589,7 @@ return $indexes_all; } - $result = array_unique($indexes_all); + $result = array_diff(array_unique($indexes_all), array('PRIMARY')); if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) { $result = array_map(($db->options['field_case'] == CASE_LOWER ? 'strtolower' : 'strtoupper'), $result); } @@ -668,10 +668,10 @@ $table = $db->quoteIdentifier($table); if (strtolower($name) == 'primary') { - $query = "DROP INDEX PRIMARY KEY ON $table"; + $query = "ALTER TABLE $table DROP PRIMARY KEY"; } else { $name = $db->quoteIdentifier($name); - $query = "DROP INDEX FOREIGN KEY $name ON $table"; + $query = "ALTER TABLE $table DROP FOREIGN KEY $name"; } return $db->query($query); } @@ -709,7 +709,7 @@ return $indexes_all; } - $result = array_unique($indexes_all); + $result = array_intersect(array_unique($indexes_all), array('PRIMARY')); if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) { $result = array_map(($db->options['field_case'] == CASE_LOWER ? 'strtolower' : 'strtoupper'), $result); }

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