View Issue Details

IDProjectCategoryView StatusLast Update
0009314mantisbtdb mssqlpublic2014-12-08 00:34
ReporterLordLarryAssigned 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...

Issue History

Date Modified Username Field Change
2008-06-30 05:43 LordLarry New Issue
2008-06-30 05:43 LordLarry Note Added: 0018228
2008-06-30 08:21 LordLarry Note Added: 0018233
2008-06-30 11:24 vboctor Tag Attached: patch
2008-07-03 09:09 giallu Note Added: 0018287
2008-07-05 18:22 vboctor Tag Attached: adodb
2008-07-15 15:42 grangeway Status new => assigned
2008-07-15 15:42 grangeway Assigned To => grangeway
2008-07-23 05:02 LordLarry Note Added: 0018642
2008-07-24 06:11 giallu Note Added: 0018657
2008-07-24 06:35 LordLarry Note Added: 0018658
2008-07-24 06:51 giallu Note Added: 0018660
2008-11-26 10:37 LordLarry Note Added: 0020066
2010-10-25 07:58 sveyret Note Added: 0027150
2012-02-05 12:02 grangeway Note Added: 0031136
2012-02-05 12:02 grangeway Status assigned => resolved
2012-02-05 12:02 grangeway Fixed in Version => 1.3.0-beta.1
2012-02-05 12:02 grangeway Resolution open => no change required
2012-03-04 02:09 vboctor Status resolved => closed
2012-03-14 17:51 atrol Note Added: 0031460
2012-03-14 17:51 atrol Status closed => feedback
2012-03-14 17:51 atrol Resolution no change required => reopened
2012-03-30 04:21 dregad Relationship added related to 0013713
2012-05-14 11:16 dregad Note Added: 0031832
2012-05-25 07:02 dregad Relationship replaced child of 0013713
2012-05-25 07:02 dregad Note Added: 0031904
2013-01-25 09:19 dregad Note Added: 0034910
2013-01-25 09:27 dregad Assigned To grangeway =>
2013-01-25 10:39 dregad Relationship added related to 0015426
2013-06-20 05:34 dregad Relationship replaced related to 0013713
2013-06-20 05:36 dregad Note Added: 0037232
2013-10-17 12:28 dregad Status feedback => resolved
2013-10-17 12:28 dregad Resolution reopened => fixed
2013-10-17 12:28 dregad Assigned To => dregad
2013-10-17 12:28 dregad Target Version => 1.3.0-beta.1
2014-12-08 00:34 vboctor Status resolved => closed