Bug #71667 [NEW]: "computed" column name behavior is inconsistent with mssql extension
| From: | adam dot baratz at gmail dot com | Date: | Thu, 25 Feb 2016 23:20:18 +0000 |
| Subject: | Bug #71667 [NEW]: "computed" column name behavior is inconsistent with mssql extension | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-199477@lists.php.net to get a copy of this message | ||
From: adam dot baratz at gmail dot com
Operating system: Linux
PHP version: 5.6.19RC1
Package: PDO DBlib
Bug Type: Bug
Bug description:"computed" column name behavior is inconsistent with mssql extension
Description:
------------
The output is inconsistent with the output from executing the same query
using the mssql extension (see expected result section for details).
Test script:
---------------
<?php
if (!extension_loaded('pdo_dblib')) {
die('skip not loaded');
}
require dirname(__FILE__) . '/config.inc';
$stmt = $db->prepare('SELECT 1, 2 AS named, 3');
$stmt->execute();
var_dump($stmt->fetch());
Expected result:
----------------
The mssql extension starts "computed" names at "computed" and uses a
sequence to name subsequent columns, not the column number:
https://github.com/php/php-src/blob/PHP-5.6.19/ext/mssql/php_mssql.c#L1225
In this case, the first column should be "computed" and the third should
be "computed1."
Additionally, debug mode should not be reporting memory leaks.
Actual result:
--------------
---------------------------------------
/vagrant/pdo_dblib-clean/dblib_stmt.c(106) : Block 0x00000000 status:
NULL
---------------------------------------
array(6) {
["computed0"]=>
string(1) "1"
[0]=>
string(1) "1"
["named"]=>
string(1) "2"
[1]=>
string(1) "2"
["computed2"]=>
string(1) "3"
[2]=>
string(1) "3"
}
[Thu Feb 25 23:04:41 2016] Script:
'/vagrant/pdo_dblib-clean/tests/timeout.php'
/home/vagrant/php-src/main/spprintf.c(245) : Freeing 0x7F1E9FB6B518 (79
bytes), script=/vagrant/pdo_dblib-clean/tests/timeout.php
Last leak repeated 1 time
[Thu Feb 25 23:04:41 2016] Script:
'/vagrant/pdo_dblib-clean/tests/timeout.php'
/vagrant/pdo_dblib-clean/dblib_stmt.c(211) : Freeing 0x7F1E9FB6D270 (6
bytes), script=/vagrant/pdo_dblib-clean/tests/timeout.php
=== Total 3 memory leaks detected ===
--
Edit bug report at https://bugs.php.net/bug.php?id=71667&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71667&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71667&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71667&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71667&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71667&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71667&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71667&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71667&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71667&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71667&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71667&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71667&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71667&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71667&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71667&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71667&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71667&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71667&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71667&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71667&r=mysqlcfg