cvs: pear /MDB MDB_test.php manager_mysql.php manager_pgsql.php metabase_wrapper.php mysql.php
| From: | Lukas Smith | Date: | Thu, 22 Aug 2002 14:06:08 +0000 |
| Subject: | cvs: pear /MDB MDB_test.php manager_mysql.php manager_pgsql.php metabase_wrapper.php mysql.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5881@lists.php.net to get a copy of this message | ||
lsmith Thu Aug 22 10:06:08 2002 EDT
Modified files:
/pear/MDB mysql.php metabase_wrapper.php MDB_test.php
manager_pgsql.php manager_mysql.php
Log:
fixed all calls to queryCol and fetchCol because if the API changes due to the fetchmode fixes
Index: pear/MDB/mysql.php
diff -u pear/MDB/mysql.php:1.43 pear/MDB/mysql.php:1.44
--- pear/MDB/mysql.php:1.43 Thu Aug 22 07:34:12 2002
+++ pear/MDB/mysql.php Thu Aug 22 10:06:07 2002
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@dybnet.de> |
// +----------------------------------------------------------------------+
//
-// $Id: mysql.php,v 1.43 2002/08/22 11:34:12 lsmith Exp $
+// $Id: mysql.php,v 1.44 2002/08/22 14:06:07 lsmith Exp $
//
if (!defined('MDB_MYSQL_INCLUDED')) {
@@ -465,7 +465,7 @@
if($this->supported['SubSelects'] == 1) {
return($query);
}
- $col = $this->queryCol($query, NULL, DB_FETCHMODE_ORDERED);
+ $col = $this->queryCol($query);
if (MDB::isError($col)) {
return $col;
}
Index: pear/MDB/metabase_wrapper.php
diff -u pear/MDB/metabase_wrapper.php:1.33 pear/MDB/metabase_wrapper.php:1.34
--- pear/MDB/metabase_wrapper.php:1.33 Thu Aug 22 07:34:12 2002
+++ pear/MDB/metabase_wrapper.php Thu Aug 22 10:06:07 2002
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@dybnet.de> |
// +----------------------------------------------------------------------+
//
-// $Id: metabase_wrapper.php,v 1.33 2002/08/22 11:34:12 lsmith Exp $
+// $Id: metabase_wrapper.php,v 1.34 2002/08/22 14:06:07 lsmith Exp $
//
require_once(dirname(__FILE__).'/MDB.php');
@@ -604,7 +604,7 @@
function MetabaseFetchResultColumn($database, $result, &$column)
{
global $databases;
- $result = $databases[$database]->fetchCol($result, DB_FETCHMODE_ORDERED);
+ $result = $databases[$database]->fetchCol($result);
if (MDB::isError($result)) {
$databases[$database]->setError('FetchResultColumn',
$result->getMessage());
return(0);
Index: pear/MDB/MDB_test.php
diff -u pear/MDB/MDB_test.php:1.29 pear/MDB/MDB_test.php:1.30
--- pear/MDB/MDB_test.php:1.29 Thu Aug 22 07:34:12 2002
+++ pear/MDB/MDB_test.php Thu Aug 22 10:06:07 2002
@@ -1,5 +1,5 @@
<?php
-// $Id: MDB_test.php,v 1.29 2002/08/22 11:34:12 lsmith Exp $
+// $Id: MDB_test.php,v 1.30 2002/08/22 14:06:07 lsmith Exp $
//
// MDB test script.
//
@@ -76,7 +76,7 @@
// run the query and get a result handler
$result = $db->query($query);
// lets just get column:0 and free the result
- $array = $db->fetchCol($result, DB_FETCHMODE_DEFAULT, 2);
+ $array = $db->fetchCol($result, 2);
echo '<br>get column #2 (counting from 0):<br>';
echo Var_Dump::display($array).'<br>';
// run the query and get a result handler
@@ -188,7 +188,7 @@
),
MDB_MANAGER_DUMP_STRUCTURE
)).'<br>';
- if($manager->debug) {
+ if($manager->options['debug']) {
echo $manager->debugOutput().'<br>';
}
// this is the database definition as an array
Index: pear/MDB/manager_pgsql.php
diff -u pear/MDB/manager_pgsql.php:1.20 pear/MDB/manager_pgsql.php:1.21
--- pear/MDB/manager_pgsql.php:1.20 Wed Aug 21 09:01:58 2002
+++ pear/MDB/manager_pgsql.php Thu Aug 22 10:06:08 2002
@@ -42,7 +42,7 @@
// | Author: Paul Cooper <pgc@ucecom.com> |
// +----------------------------------------------------------------------+
//
-// $Id: manager_pgsql.php,v 1.20 2002/08/21 13:01:58 lsmith Exp $
+// $Id: manager_pgsql.php,v 1.21 2002/08/22 14:06:08 lsmith Exp $
if (!defined('MDB_MANAGER_PGSQL_INCLUDED')) {
@@ -290,7 +290,7 @@
**/
function listDatabases(&$db)
{
- return $db->queryCol('SELECT datname FROM pg_database', NULL,
DB_FETCHMODE_ORDERED);
+ return $db->queryCol('SELECT datname FROM pg_database');
}
// }}}
@@ -305,7 +305,7 @@
**/
function listUsers(&$db)
{
- return $db->queryCol('SELECT usename FROM pg_user', NULL,
DB_FETCHMODE_ORDERED);
+ return $db->queryCol('SELECT usename FROM pg_user');
}
// }}}
@@ -333,7 +333,7 @@
AND not exists (select 1 from pg_views where viewname = c.relname)
AND not exists (select 1 from pg_user where usesysid = c.relowner)
AND c.relname !~ \'^pg_\'';
- return $db->queryCol($sql, NULL, DB_FETCHMODE_ORDERED);
+ return $db->queryCol($sql);
}
// }}}
@@ -376,7 +376,7 @@
function listViews(&$db)
{
// gratuitously stolen from PEAR DB _getSpecialQuery in pgsql.php
- return $db->queryCol('SELECT viewname FROM pg_views', NULL,
DB_FETCHMODE_ORDERED);
+ return $db->queryCol('SELECT viewname FROM pg_views');
}
// }}}
@@ -445,7 +445,7 @@
AND not exists (select 1 from pg_views where viewname = c.relname)
AND not exists (select 1 from pg_user where usesysid = c.relowner)
AND c.relname !~ \'^pg_\'';
- return $db->queryCol($sql, NULL, DB_FETCHMODE_ORDERED);
+ return $db->queryCol($sql);
}
// }}}
Index: pear/MDB/manager_mysql.php
diff -u pear/MDB/manager_mysql.php:1.23 pear/MDB/manager_mysql.php:1.24
--- pear/MDB/manager_mysql.php:1.23 Wed Aug 21 09:01:58 2002
+++ pear/MDB/manager_mysql.php Thu Aug 22 10:06:08 2002
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@dybnet.de> |
// +----------------------------------------------------------------------+
//
-// $Id: manager_mysql.php,v 1.23 2002/08/21 13:01:58 lsmith Exp $
+// $Id: manager_mysql.php,v 1.24 2002/08/22 14:06:08 lsmith Exp $
//
if(!defined('MDB_MANAGER_MYSQL_INCLUDED'))
@@ -426,7 +426,7 @@
*/
function listDatabases(&$db)
{
- $result = $db->queryCol('SHOW DATABASES', NULL, DB_FETCHMODE_ORDERED);
+ $result = $db->queryCol('SHOW DATABASES');
if(MDB::isError($result)) {
return $result;
}
@@ -445,7 +445,7 @@
*/
function listUsers(&$db)
{
- $result = $db->queryCol('SELECT DISTINCT USER FROM USER', NULL,
DB_FETCHMODE_ORDERED);
+ $result = $db->queryCol('SELECT DISTINCT USER FROM USER');
if(MDB::isError($result)) {
return $result;
}
@@ -464,7 +464,7 @@
*/
function listTables(&$db)
{
- $table_names = $db->queryCol('SHOW TABLES', NULL, DB_FETCHMODE_ORDERED);
+ $table_names = $db->queryCol('SHOW TABLES');
if(MDB::isError($table_names)) {
return $table_names;
}
@@ -788,7 +788,7 @@
$db->freeResult($result);
return $db->raiseError(DB_ERROR_MANAGER, '', '', 'List
table indexes: show index does not return the table index names');
}
- $indexes_all = $db->fetchCol($result, DB_FETCHMODE_ORDERED,
$columns['key_name']);
+ $indexes_all = $db->fetchCol($result, $columns['key_name']);
for($found = $indexes = array(), $index = 0; $index < count($indexes_all); $index++)
{
if ($indexes_all[$index] != 'PRIMARY'
@@ -933,7 +933,7 @@
*/
function listSequences(&$db)
{
- $table_names = $db->queryCol('SHOW TABLES', NULL, DB_FETCHMODE_ORDERED);
+ $table_names = $db->queryCol('SHOW TABLES');
if(MDB::isError($table_names)) {
return $table_names;
}
@@ -958,7 +958,7 @@
*/
function getSequenceDefinition(&$db, $sequence)
{
- $table_names = $db->queryCol('SHOW TABLES', NULL, DB_FETCHMODE_ORDERED);
+ $table_names = $db->queryCol('SHOW TABLES');
if(MDB::isError($table_names)) {
return($table_names);
}