0

I have a project that uses MSSQL over pdo_dblib and freetds. MS scalar functions always returned their data in this format:

array(1) { [0]=> array(1) { ["computed"]=> string(3) "922" } }.

But now, on one of the servers the format suddenly is:

array(1) { [0]=> array(1) { [""]=> string(3) "922" } }.

So the key in the array became empty instead of "computed".

I know that I can change that key in my select statements by adding "as" clause. Still, the question is, what controls the default key?

Both servers use the same database.

As far as I know, this "computed" key is something that's added by pdo_dblib.

PHP version is different between servers, the one with computed has old 5.3, while the one with empty key has 5.5. But I think that this server had 5.5 for quite some time, while the computed key disappeared just yesterday. Not 100% sure though...

sg2002
  • 121
  • 3

1 Answers1

0

In the end I found out that this happens because there was a change in this commit to pdo_dblib. The motivation for this change was that it was clogging up memory.

It should be noted that the version that you get from pecl is weird. It has "computed" in dblib_stmt.c source, but still does not use it.

The version that works, is the one bundled with php sources. I was able to take sources from php-5.3.29\ext\pdo_dblib\ and build them against 5.6.4.

sg2002
  • 121
  • 3