? Success

User tests: Successful: Unsuccessful:

avatar nibra
nibra
4 Dec 2016

Pull Request for Issue #11297 .

Summary of Changes

Replaced 'stdClass' literals with '\\stdClass'.

Testing Instructions

See issue for testing instructions.

Documentation Changes Required

No changes required.

avatar nibra nibra - open - 4 Dec 2016
avatar nibra nibra - change - 4 Dec 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Dec 2016
Category Libraries Postgresql MS SQL
avatar zero-24
zero-24 - comment - 4 Dec 2016

Replaced 'stdClass' literals with '\stdClass'.

Please double check the code there you use \\stdClass and not \stdClass as per comment

avatar mbabker
mbabker - comment - 4 Dec 2016

While this is technically a valid fix, at this point I'm seriously more concerned about what has changed either internal to PHP or on the Windows platform (as that seems to be where this issue is happening) that it's becoming mandatory to specify the global namespace prefix in non-namespaced code to load a class that should always exist in the PHP engine.

avatar ggppdk
ggppdk - comment - 4 Dec 2016

While this is technically a valid fix, at this point I'm seriously more concerned about what has changed either internal to PHP or on the Windows platform

But why the issue is occuring, only when using SQL server DB ?

avatar mbabker
mbabker - comment - 4 Dec 2016

Well, someone would need to analyze https://github.com/Microsoft/msphpsql/tree/PHP-7.0 and compare it to the PHP 5 branch to see what the Microsoft team changed to figure out why this issue started.

avatar nibra
nibra - comment - 4 Dec 2016

Nevertheless, the fix passes the unit tests, and also serves as a preparation for introduction of namespaces.

avatar nibra nibra - change - 4 Dec 2016
The description was changed
Labels Removed: ?
avatar nibra nibra - edited - 4 Dec 2016
avatar mbabker
mbabker - comment - 4 Dec 2016

I'm not arguing the fix's validity, I just want to understand why we need it as it really seems to imply the Microsoft team introduced a bug into the ext/sqlsrv code.

Also, the change isn't actually required for namespace support oddly enough. https://github.com/joomla-framework/database/blob/master/src/DatabaseDriver.php#L600 still uses an unprefixed parameter and has been working fine with MySQLi. Can't say much on the Microsoft driver though since we don't have a way to hook up a SQL Server instance in the Travis-CI environment.

avatar csthomas
csthomas - comment - 5 Dec 2016

The code you can find at https://github.com/Microsoft/msphpsql/blob/master/sqlsrv/stmt.cpp#L722

Can anybody test something like below example?

if (strtolower($class) === 'stdclass')
{
    sqlsrv_fetch_object($cursor ? $cursor : $this->cursor);
}
else
{
    sqlsrv_fetch_object($cursor ? $cursor : $this->cursor, $class);
}
avatar nibra nibra - change - 17 Mar 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-03-17 12:01:56
Closed_By nibra
avatar nibra nibra - close - 17 Mar 2017

Add a Comment

Login with GitHub to post a comment