From: [email protected]
Operating system: Any
PHP version: master-Git-2013-06-01 (Git)
Package: PDO related
Bug Type: Bug
Bug description:PDO_DBLIB returns unknown for native_type
Description:
------------
When testing against Sybase AS 12, varchar columns are described as
unknown.
Test script:
---------------
#!~/src/php-src/sapi/cli/php
<?php
putenv("TDSDUMP=/home/stanley/src/freetds.log");
include("login.php");
$pdo=new
PDO('dblib:host=localhost:2638;dbname=test;charset=UTF-8',$user,$pass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $pdo->query("SELECT cast('foo' as varchar(32)) as foo");
print_r($stmt->getColumnMeta(0));
?>
Expected result:
----------------
Array
(
[max_length] => 32
[precision] => 0
[scale] => 0
[column_source] => foo
[native_type] => varchar
[name] => foo
[len] => 32
[pdo_type] => 2
)
Actual result:
--------------
Array
(
[max_length] => 0
[precision] => 0
[scale] => 0
[column_source] => foo
[native_type] => unknown
[name] => foo
[len] => 0
[pdo_type] => 2
)
--
Edit bug report at https://bugs.php.net/bug.php?id=64957&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=64957&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=64957&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=64957&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64957&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64957&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64957&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64957&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64957&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64957&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64957&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64957&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64957&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64957&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64957&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64957&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64957&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64957&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64957&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64957&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64957&r=mysqlcfg