php / php/php-src

PDO ODBC with SybaseASE - text datatype

Open
#15,725 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Extension: pdo_odbc Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

The following code:

<?php
$pdo = new PDO('odbc:Driver={SybaseDriver};Server=xxx;Port=yyy;', user', 'pwd');
$result = $pdo->query('exec some_procedure')->fetchAll();
echo '<pre>';
var_dump($result);
echo  '</pre>';

Resulted in this output:

["test"]=>
NULL
[0]=>
NULL

But I expected this output instead:

["test"]=>
string(4) "test"
[0]=>
string(4) "test"

DB columns with data type text are always NULL https://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc32300.1570/html/sqlug/X20354.htm

PHP Version

PHP 8.1.29

Operating System

Rocky Linux 9.4 (Blue Onyx)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the PDO ODBC query and fetchAll behavior against Sybase ASE using a procedure that returns a text column. Compare the fetched values with the reported NULL output and expected strings; done means text columns are returned correctly in both associative and numeric result entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.