From: chris dot kings-lynne at navitas dot com Operating system: Debian PHP version: 5.4.15 Package: PDO related Bug Type: Bug Bug description:FreeTDS PDO getColumnMeta on a prepared but not executed statement crashes
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 bug report at https://bugs.php.net/bug.php?id=64808&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64808&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64808&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64808&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64808&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64808&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64808&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64808&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64808&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=64808&r=support Expected behavior: https://bugs.php.net/fix.php?id=64808&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64808&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64808&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64808&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64808&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64808&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64808&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=64808&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64808&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64808&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64808&r=mysqlcfg