View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0013438 | mantisbt | db oracle | public | 2011-10-24 08:50 | 2015-03-16 19:24 |
| Reporter | dregad | Assigned To | dregad | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 1.2.9 | ||||
| Target Version | 1.3.0-beta.1 | Fixed in Version | 1.3.0-beta.1 | ||
| Summary | 0013438: adodb: Fatal error: Call to a member function FetchRow() on a non-object | ||||
| Description | When generating the SQL script for Oracle DB, the following error occurs Fatal error: Call to a member function FetchRow() on a non-object in /xxx/mantisbt/library/adodb/drivers/adodb-oci8.inc.php on line 368 Call Stack: | ||||
| Steps To Reproduce | Fresh install of Mantis, run install.php
| ||||
| Additional Information | I believe this is due to an error in ADOdb, which does not cover the case where no constraints are defined for an index.
| ||||
| Tags | patch | ||||
| Attached Files | adodb-fix-13438.patch (630 bytes)
diff --git a/library/adodb/drivers/adodb-oci8.inc.php b/library/adodb/drivers/adodb-oci8.inc.php
index 0d69b75..ad69860 100644
--- a/library/adodb/drivers/adodb-oci8.inc.php
+++ b/library/adodb/drivers/adodb-oci8.inc.php
@@ -364,6 +364,14 @@ NATSOFT.DOMAIN =
$false = false;
$rs = $this->Execute(sprintf("SELECT * FROM ALL_CONSTRAINTS WHERE UPPER(TABLE_NAME)='%s' AND CONSTRAINT_TYPE='P'",$table));
+
+ if (!is_object($rs)) {
+ if (isset($savem))
+ $this->SetFetchMode($savem);
+ $ADODB_FETCH_MODE = $save;
+ return $false;
+ }
+
if ($row = $rs->FetchRow())
$primary_key = $row[1]; //constraint_name
| ||||
|
Upstream bug report http://phplens.com/lens/lensforum/msgs.php?id=19001 |
|
|
This patch is included in the latest version of oracle branch, see https://github.com/dregad/mantisbt/commit/515d381cc708199ca369c4ba9266ea3dc9aab5a7 |
|
|
Feedback from upstream: Topic: Re:oci8 MetaIndex function |
|
|
2 releases of adodb have gone by, but the author still has not included the patch. |
|
|
Received an e-mail from John Lim (adodb author) who said this fix will be included in 5.17 |
|
|
Bug has been fixed upstream in AdoDB version 5.17. |
|
|
MantisBT: master 8792ee55 2011-10-24 07:41 Details Diff |
DB ADOdb MetaIndex fails when no constraints exist Working with Oracle database (oci8), when MetaIndex() method is called to retrieve the list of indexes for a table that has no constraints set, an error is triggered: Fatal error: Call to a member function FetchRow() on a non-object This commit adds a check to cleanly exit the function, returning false. Similar error handling has also been added to the calling database_api function db_index_exists() This allows the DB installation (schema.php) to proceed without errors. Fixes 0013438 Porting to 1.3 - Conflicts: library/adodb/drivers/adodb-oci8.inc.php Note: the fix to ADOdb driver does not need to be ported as it was included in a later release of the library. |
Affected Issues 0013438 |
|
| mod - core/database_api.php | Diff File | ||