Bug #64957 [Opn->Csd]: PDO_DBLIB returns unknown for native_type
| From: | adambaratz@php.net | Date: | Wed, 14 Sep 2016 15:32:53 +0000 |
| Subject: | Bug #64957 [Opn->Csd]: PDO_DBLIB returns unknown for native_type | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-204038@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64957&edit=1
ID: 64957
Updated by: adambaratz@php.net
Reported by: ssufficool@php.net
Summary: PDO_DBLIB returns unknown for native_type
-Status: Open
+Status: Closed
Type: Bug
Package: PDO DBlib
Operating System: Any
PHP Version: master-Git-2013-06-01 (Git)
-Assigned To:
+Assigned To: adambaratz
Block user comment: N
Private report: N
New Comment:
This is no longer an issue in the latest version of the extension. bug_45876.phpt covers this issue,
so we should be safe from regressions.
Previous Comments:
------------------------------------------------------------------------
[2015-06-10 19:56:35] php_bugs at mts7 dot com
The problem seems to be within ext/pdo_dblib/dblib_stmt.c.
pdo_dblib_get_field_name(dbcoltype(H->link, colno+1)) is returning 'unknown' for
VARCHAR and BIT (and possibly more) types. Please consider updating the functions to handle the
correct dbcoltype(H->link, colno+1) values for these unknown types.
------------------------------------------------------------------------
[2013-06-01 21:04:36] ssufficool@php.net
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 this bug report at https://bugs.php.net/bug.php?id=64957&edit=1