View Issue Details

IDProjectCategoryView StatusLast Update
0009314mantisbtdb mssqlpublic2014-12-08 00:34
ReporterLordLarry Assigned Todregad  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindows ServerOS Version2003
Product Version1.2.0a1 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0009314: ADODB GetRowAssoc does not work
Description

I have no idea why this does not work. Is it a php 5.2.6 problem? Or a bug in ADODB? Or something to do with MSSQL?

function GetRowAssoc($upper=1)
{
    $record = array();
    //if (!$this->fields) return $record;

    if (!$this->bind) {
        $this->GetAssocKeys($upper);
    }

    foreach($this->bind as $k => $v) {
        $record[$k] = $this->fields[$v];
    }

    return $record;
}

The wrong result is an array numberd from 0 to n-1 with no values

changing
$record[$k] = $this->fields[$v];
to
$record[$k] = $this->fields[$k];
fixed the problem

Steps To Reproduce

Just run mantis using a MSSQL database

Tagsadodb, patch

Relationships

related to 0013713 closeddregad Upgrade ADOdb library to latest version 
related to 0015426 closeddregad GetRowAssoc fails with Oracle DB 

Activities

LordLarry

LordLarry

2008-06-30 05:43

reporter   ~0018228

No problems with the same configuration in mantis 1.1.1

LordLarry

LordLarry

2008-06-30 08:21

reporter   ~0018233

using MSSQL 2000

giallu

giallu

2008-07-03 09:09

reporter   ~0018287

mmm, we are not upstream for ADODB but this looks like a bug in their code.

Am I missing something or this should be reported upstream?

LordLarry

LordLarry

2008-07-23 05:02

reporter   ~0018642

I don't know. Just letting you know mantis does not work with the code it supplies

giallu

giallu

2008-07-24 06:11

reporter   ~0018657

If our code is not working, we are supposed to fix it. If other people code is not working, they should fix it.

Assuming the GetRowAssoc() function is in the ADODB tree, this need to be reported (and fixed) upstream.

Upstream is http://adodb.sourceforge.net/ and on that page you can see they want bug reports posted at http://phplens.com/lens/lensforum/topics.php?id=4

Please add here a link to your bug report so we can track the status of the issue, and update our code when they do a new release fixing this.

LordLarry

LordLarry

2008-07-24 06:35

reporter   ~0018658

I understand that. But I also understand that mantis won't work for MSSQL in the current state. That, I think, is also a problem for mantis.

Reported here: http://phplens.com/lens/lensforum/msgs.php?id=17539

giallu

giallu

2008-07-24 06:51

reporter   ~0018660

Yeah, that's why I'm not closing this straight away :)

If you fancy helping further, it would be nice to test their latest release and see if they already solved the issue.

LordLarry

LordLarry

2008-11-26 10:37

reporter   ~0020066

Still no answer from the ADODB people

sveyret

sveyret

2010-10-25 07:58

reporter   ~0027150

Found same problem with Oracle. LordLarry's correction would not work as we need to change the case of the array keys, so I put a solution on the ticket LordLarry opened in ADODB.

grangeway

grangeway

2012-02-05 12:02

reporter   ~0031136

1.3.x will include a new PDO layer - so will not be affected by the adodb issue

atrol

atrol

2012-03-14 17:51

developer   ~0031460

Reopened, the issue is not fixed in master branch (1.3.x) at the
official repository.

1.3.x will include a new PDO layer
1.3.x = master
Do you really plan to include the PDO layer in master?
I thought this will be in next.

dregad

dregad

2012-05-14 11:16

developer   ~0031832

Update from upstream http://phplens.com/lens/lensforum/msgs.php?id=17539

Topic: Re:ADODB GetRowAssoc does not work with MSSQL
author: John Lim created: 14-05-2012 07:27:59 AM
I thought my original code worked better, but i realize that there are advantages to your simpler approach. Added in 5.17.

dregad

dregad

2012-05-25 07:02

developer   ~0031904

Fixed in AdoDB 5.17

dregad

dregad

2013-01-25 09:19

developer   ~0034910

GetRowAssoc is still an issue for Oracle even with latest version of AdoDB 5.18. This is due to MantisBT defaulting to ADODB_FETCH_ASSOC fetch mode, and the fact that Oracle returns uppercase column names in the recordset.

I have submitted a patch [1] upstream [2]. Until this gets implemented, we can probably work around the issue by setting ADODB_FETCH_MODE = ADODB_FETCH_NUM for Oracle in db_connect().

[1] https://github.com/dregad/ADOdb/tree/fixes-518a
[2] http://phplens.com/lens/lensforum/msgs.php?id=17539

dregad

dregad

2013-06-20 05:36

developer   ~0037232

Changed relation to 0013713 from parent/child to related, since there is a workaround possible by changing MantisBT code we don't need to set a hard dependency to have this issue fixed upstream (although we'd get better performance with the fix)

Note - to-date, there is no sign of a new ADOdb release coming out, John Lim has been silent since end of 2012...