View Issue Details

IDProjectCategoryView StatusLast Update
0020074mantisbtdb mssqlpublic2016-01-25 16:21
Reporteralex.volkovAssigned Todregad 
Status closedResolutionfixed 
PlatformMicrosoftOSWindows Server 2012 R2OS Version
Product Version1.3.0-beta.2 
Target VersionFixed in Version1.3.0-rc.1 
Summary0020074: ADODB_FETCH_MODE global is not properly set by database_api.php

database_api.php attempts to set ADODB_FETCH_MODE global (from to ADODB_FETCH_ASSOC. But because require_lib() function is used to bring in the, the ADODB_FETCH_MODE is not brought in as a global into the scope. database_api.php does not declare ADODB_FETCH_MODE as a global either. This results in the following line creating a new ADODB_FETCH_MODE variable in the scope:

The ultimate result is ADODB using the ADODB_FETCH_DEFAULT mode (0), which for mssqlnative driver appears to be ADODB_FETCH_NUM.

The var should be declared global in database_api.php:
or changed to:

Additional Information

MS Windows Server 2012 R2 / IIS v8.5
MS SQL Server 2012
PHP 5.6.12 x86, FastCGI, php-cgi.exe
MS Driver for SQL Server v3.2 x86, NTS, php_sqlsrv_56_nts.dll
mssqlnative ADODB driver: cachedSchemaFlush patched

Here is the failed trace:

ADODB_Setup() called
SYSTEM NOTICE: 'Undefined variable: ADODB_FETCH_MODE' in 'D:\Websites\Mantis\core\database_api.php' line 59
$ADODB_FETCH_MODE in database_api:
$GLOBALS['ADODB_FETCH_MODE'] in database_api: 0
(var set here)
$ADODB_FETCH_MODE in database_api: 2
$GLOBALS['ADODB_FETCH_MODE'] in database_api: 0

TagsNo tags attached.




2015-09-06 05:59

developer   ~0051381

Thanks for the detailed bug report.



2016-01-12 06:17

developer   ~0052296

I had already identified this issue in my ADOdb update branch, back in May 2015.

This was actually fixed in 1.3.0-rc.1 (v:mantisbt:f0c3959bfe3522eee6ebc7078405e23628f60c6d:)

Related Changesets

MantisBT: master f0c3959b

2015-05-17 03:59:31


Details Diff
Database API now properly sets ADOdb fetch mode

Prior to this, the lack of global indicator for $ADODB_FETCH_MODE caused
the driver to load with default setting, since the variable was
initialized outside of its scope.
mod - core/database_api.php Diff File

Issue History

Date Modified Username Field Change
2015-09-03 19:08 alex.volkov New Issue
2015-09-06 05:59 dregad Status new => acknowledged
2015-09-06 05:59 dregad Category bugtracker => db mssql
2015-09-06 05:59 dregad Target Version => 1.3.0-beta.3
2015-09-06 05:59 dregad Note Added: 0051381
2015-09-06 17:46 vboctoradmin Target Version 1.3.0-beta.3 => 1.3.0-rc.1
2016-01-12 03:36 atrol Target Version 1.3.0-rc.1 => 1.3.0-rc.2
2016-01-12 06:17 dregad Assigned To => dregad
2016-01-12 06:17 dregad Status acknowledged => resolved
2016-01-12 06:17 dregad Resolution open => fixed
2016-01-12 06:17 dregad Fixed in Version => 1.3.0-rc.1
2016-01-12 06:17 dregad Note Added: 0052296
2016-01-12 06:18 dregad Changeset attached => MantisBT master f0c3959b
2016-01-12 09:54 atrol Target Version 1.3.0-rc.2 =>
2016-01-25 16:21 atrol Status resolved => closed