Edit report at https://bugs.php.net/bug.php?id=64808&edit=1

 ID:                 64808
 User updated by:    chris dot kings-lynne at navitas dot com
 Reported by:        chris dot kings-lynne at navitas dot com
 Summary:            FreeTDS PDO getColumnMeta on a prepared but not
                     executed statement crashes
 Status:             Closed
 Type:               Bug
 Package:            PDO related
 Operating System:   Debian
 PHP Version:        5.4.15
 Assigned To:        ssufficool
 Block user comment: N
 Private report:     N

 New Comment:

That's awesome, any chance it can be pushed to the next 5.4 release pretty 
please? 
:)


Previous Comments:
------------------------------------------------------------------------
[2013-06-01 05:59:56] ssuffic...@php.net

The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------
[2013-06-01 05:58:55] ssuffic...@php.net

Automatic comment on behalf of ssufficool
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=0e2bcf3373d914a215784c041a2a4c3b6afc2034
Log: FIX BUG #64338, #64808, #63638

------------------------------------------------------------------------
[2013-05-10 06:13:21] chris dot kings-lynne at navitas dot com

Not that useful without debug symbols, but at least shows the crash is in dblib:

(gdb) bt
#0  0x00007fffeb0817e6 in ?? () from /usr/lib/php5/20100525/pdo_dblib.so
#1  0x00007ffff3e5de15 in ?? () from /usr/lib/php5/20100525/pdo.so
#2  0x00007ffff407906b in xdebug_execute_internal () from 
/usr/lib/php5/20100525/xdebug.so
#3  0x0000000000746e18 in ?? ()
#4  0x0000000000734438 in execute ()
#5  0x00007ffff4079449 in xdebug_execute () from 
/usr/lib/php5/20100525/xdebug.so
#6  0x00000000006c9630 in zend_execute_scripts ()
#7  0x000000000066bba8 in php_execute_script ()
#8  0x0000000000776553 in ?? ()
#9  0x0000000000776d18 in ?? ()
#10 0x00007ffff4a52c8d in __libc_start_main () from /lib/libc.so.6
#11 0x0000000000430359 in _start ()

------------------------------------------------------------------------
[2013-05-10 06:01:25] chris dot kings-lynne at navitas dot com

Description:
------------
If you attempt to use getColumnMeta() on a prepared but not yet executed 
PDOStatement, using the dblib driver, you get a segmentation fault.

FreeTDS library version 0.82-7

Test script:
---------------
<?php

$pdo = new PDO('dblib:host=SERVICE;dbname=xxx','xxx','xxx');

$result = $pdo->prepare('SELECT * FROM users');
$meta = $result->getColumnMeta(1);


Expected result:
----------------
I would expect to get the column metadata just as it as after execution, as in 
this code sample:

<?php

$pdo = new PDO('dblib:host=SERVICE;dbname=xxx','xxx','xxx');

$result = $pdo->prepare('SELECT * FROM users');
$result->execute();
$meta = $result->getColumnMeta(1);
var_dump($meta);

Gives:

array(8) {
  'max_length' =>
  int(8)
  'precision' =>
  int(0)
  'scale' =>
  int(0)
  'column_source' =>
  string(4) "mode"
  'native_type' =>
  string(7) "unknown"
  'name' =>
  string(4) "mode"
  'len' =>
  int(8)
  'pdo_type' =>
  int(2)
}


Actual result:
--------------
Segmentation fault

Don't have debugging symbols or gdb on the machine sorry :(


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64808&edit=1

Reply via email to