2014-12-21 05:40 EST

View Issue Details Jump to Notes ] Wiki ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0013438mantisbtdb oraclepublic2014-12-08 00:34
Reporterdregad 
Assigned Todregad 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Product Version1.2.9 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0013438: adodb: Fatal error: Call to a member function FetchRow() on a non-object
DescriptionWhen 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:
    0.0018 574752 1. {main}() /xxx/mantisbt/admin/install.php:0
    0.3886 12819936 2. call_user_func_array() /xxx/mantisbt/admin/install.php:719
    0.3886 12820252 3. db_index_exists() /xxx/mantisbt/admin/install.php:719
    0.3888 12820296 4. ADODB_oci8->MetaIndexes() /xxx/mantisbt/core/database_api.php:645
Steps To ReproduceFresh install of Mantis, run install.php
In options, set
- DB=Oracle (settings as appropriate)
- Check "Print SQL Queries instead of Writing to the Database"
Additional InformationI believe this is due to an error in ADOdb, which does not cover the case where no constraints are defined for an index.

        // get Primary index
        $primary_key = '';

        $false = false;
        $rs = $this->Execute(sprintf("SELECT * FROM ALL_CONSTRAINTS WHERE UPPER(TABLE_NAME)='%s' 
AND CONSTRAINT_TYPE='P'",$table));
// ==> FAILS HERE IF QUERY RETURNS NO DATA ($rs == false)
        if ($row = $rs->FetchRow())
           $primary_key = $row[1]; //constraint_name


Tagspatch
Attached Files
  • patch file icon adodb-fix-13438.patch (630 bytes) 2011-10-24 08:54 - 
    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
     
    
    patch file icon adodb-fix-13438.patch (630 bytes) 2011-10-24 08:54 + 

- Relationships
child of 0013433closeddregad Error ORA-00904: "PROTECTED": invalid identifier for the query 
child of 0007644closeddregad Problems when creating the Mantis database schema on Oracle 
child of 0013713closeddregad Upgrade ADOdb library to latest version 
+ Relationships

-  Notes
User avatar

~0030044

dregad (developer)

Upstream bug report http://phplens.com/lens/lensforum/msgs.php?id=19001 [^]
User avatar

~0030070

dregad (developer)

This patch is included in the latest version of oracle branch, see https://github.com/dregad/mantisbt/commit/515d381cc708199ca369c4ba9266ea3dc9aab5a7 [^]
User avatar

~0030086

dregad (developer)

Feedback from upstream:

Topic: Re:oci8 MetaIndex function
author: John Lim created: 27-10-2011 02:19:01 AM
Looks good. Thanks i will add it to the next version of adodb.
User avatar

~0031569

dregad (developer)

2 releases of adodb have gone by, but the author still has not included the patch.
User avatar

~0031833

dregad (developer)

Received an e-mail from John Lim (adodb author) who said this fix will be included in 5.17
User avatar

~0031902

dregad (developer)

Bug has been fixed upstream in AdoDB version 5.17.
+  Notes

+ Related Changesets

- Issue History
Date Modified Username Field Change
2011-10-24 08:50 dregad New Issue
2011-10-24 08:54 dregad File Added: adodb-fix-13438.patch
2011-10-24 08:54 dregad Tag Attached: patch
2011-10-24 08:55 dregad Note Added: 0030044
2011-10-24 08:56 dregad Relationship added child of 0013433
2011-10-24 08:56 dregad Relationship added child of 0007644
2011-10-25 13:24 dregad Note Added: 0030070
2011-10-25 13:24 dregad Assigned To => dregad
2011-10-25 13:24 dregad Status new => confirmed
2011-10-27 10:09 dregad Note Added: 0030086
2012-03-30 04:09 dregad Note Added: 0031569
2012-05-14 11:19 dregad Note Added: 0031833
2012-05-25 06:54 dregad Note Added: 0031902
2012-05-25 06:58 dregad Relationship added related to 0013713
2012-05-25 07:01 dregad Relationship replaced child of 0013713
2013-10-17 12:08 dregad Changeset attached => MantisBT master 8792ee55
2013-10-17 12:08 dregad Status confirmed => resolved
2013-10-17 12:08 dregad Resolution open => fixed
2013-10-17 12:08 dregad Fixed in Version => 1.3.0-beta.1
2013-10-17 12:54 dregad Target Version => 1.3.0-beta.1
2014-04-12 19:39 grangeway Issue cloned: 0017192
2014-05-16 15:01 grangeway Note Added: 0040465
2014-05-23 09:39 atrol Note Deleted: 0040465
2014-12-08 00:34 vboctor Status resolved => closed
+ Issue History