|
From: andi <bin...@li...> - 2001-09-21 10:45:15
|
andi Fri Sep 21 03:44:54 2001 EDT
Modified files:
/r2/binarycloud/base/mgr QueryManager.php
Log:
Removed metabase hack and extra abstraction code (workaround for older
metabase to support retreive meta-data). QueryManager is now clear.
Index: r2/binarycloud/base/mgr/QueryManager.php
diff -u r2/binarycloud/base/mgr/QueryManager.php:1.4 r2/binarycloud/base/mgr/QueryManager.php:1.5
--- r2/binarycloud/base/mgr/QueryManager.php:1.4 Wed Sep 12 11:14:04 2001
+++ r2/binarycloud/base/mgr/QueryManager.php Fri Sep 21 03:44:54 2001
@@ -1,7 +1,7 @@
<?php
// Header {{{
/*
- * -File $Id: QueryManager.php,v 1.4 2001/09/12 18:14:04 andi Exp $
+ * -File $Id: QueryManager.php,v 1.5 2001/09/21 10:44:54 andi Exp $
* -License LGPL (http://www.gnu.org/copyleft/lesser.html)
* -Copyright 2000, Intacct Corporation
* -Author John P. Campbell
@@ -571,34 +571,8 @@
}
// }}}
- // method _GetNumColumns($_result) {{{
- /**
- * This method determines the number of columns fetched by the last
- * query. It takes the result handle as parameter.
- *
- * I don't like this here. But it's a metabase problem. The Metabase
- * drivers currently do not implement this feauture.
- *
- * @param int Result handle
- * @return int Number of fields in last query
- * @access private
- * @see QueryManager::_ProcessResult()
- */
-
- function _GetNumColumns($_result) {
- switch ($this->dbType) {
- case 'oci': return OCINumCols($_result);
- case 'mysql': return mysql_num_fields($_result);
- case 'ifx': return ifx_num_fields($_result);
- case 'msql': return msql_num_fields($_result);
- case 'mssql': return mssql_num_fields($_result);
- case 'pgsql': return pg_numfields($_result);
- case 'odbc': return odbc_num_fields($_result);
- }
- }
-
- // }}}
// method _ProcessResult($_code, $_result, &$_buffer, $_headers) {{{
+
/**
* _ProcessResult processes a query result fetched by a select statement
* and fills a buffer passed by reference with the result values.
@@ -622,27 +596,14 @@
function _ProcessResult($_code, $_result, &$_buffer, $_headers = true) {
global $Debug;
- // Get the column names into the column data member.
- // (This is really a hack of the Metabase library.
- // |
- // | We have to modifiy the other metabase drivers mSQL,MySQL and
- // | PostgreSQL. It would be very nice to have
- // | MetabaseGetNumCols($database, $result) and
- // | MetabaseGetColumnNames($database, $result)
- // | Should be no problem 'caus php supports this for all dbms
- // | metabase abstracts
- // |
+
if ($_headers) {
- global $metabase_interfaces;
- global $metabase_databases;
- $metaIF =& $metabase_interfaces[$metabase_databases[$this->handle]->interface];
- $metaIF->GetColumnNames($_result);
- $colNames = $metaIF->columns[$_result];
+ $colNames = MetabaseGetColumnNames($this->handle, $_result);
$Debug->CaptureVar('QueryManager: Result columnames', $colNames);
}
$colCount = 0;
- $colCount = $this->_GetNumColumns($_result);
+ $colCount = MetabaseNumberOfColumns($this->handle, $_result);
if ($_result != 0) {
$eor = MetabaseEndOfResult($this->handle, $_result);
|