|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #33221 sybase-ct: Varchar >255 not supported
Submitted: 2005-06-02 16:05 UTC Modified: 2021-08-03 15:43 UTC
Avg. Score:4.7 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:1 (16.7%)
Same OS:2 (33.3%)
From: graham1 dot simpson at hsbcib dot com Assigned: cmb (profile)
Status: Closed Package: Sybase-ct (ctlib) related
PHP Version: 5.0.4 OS: Linux Redhat AS 3.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: graham1 dot simpson at hsbcib dot com
New email:
PHP Version: OS:


 [2005-06-02 16:05 UTC] graham1 dot simpson at hsbcib dot com
PHP client application truncates text/varchar columns to 255 chars, even when compiled with a new Sybase CT open client.
I think this is more of a feature enhancement request rather than a bug per se.

Load the form mentioned belowin your web browser and add data until bigger than 255.

My environment is php 5.0.4 under apache 2.0.48 with --with-sybase-ct option compiled in. The version of open client is 12.5.1. which supports large varchars.

Reproduce code:
To reproduce:
% cat <<EOT >testform.php
require_once ("dbconfig.php");

if ($_POST[Submit]) {
  $servercomments = $_POST[servercomments];
  $qry = "update tempdb..gsi set Key1 = '" . $servercomments . "'";
  $result = sybase_query($qry,$cnn);

$qry = "select Key1 from tempdb..gsi";
$result = sybase_query($qry,$cnn);
$row = sybase_fetch_array($result);
$servercomments = $row[Key1];

echo "<form action=\"ta.php\" method=\"post\">";
echo "<textarea rows=20 cols=80 name=servercomments>";
  echo "$servercomments\n";
echo "</textarea>";
echo "<input type=\"submit\" name=\"Submit\" value=\"Do It\">";
echo "</form>";

In isql:
use tempdb
create table gsi (Key1 varchar(1500))
insert gsi values ("somevalue")

Expected result:
Ideally, I would expect to get my row returned when bigger than 255 characters.

Actual result:
As the PHP client cannot handle varchars > 255, a server error is generated informing that a truncation has occurred:

Warning: sybase_query() [function.sybase-query]: Sybase: Server message: Character or binary data returned from Adaptive Server has been truncated. The client application does not support more than 255 bytes of data as a result column or output parameter. (severity 10, procedure N/A) in /home/sybase/public_html/testform.php on line 20


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-30 22:48 UTC]
-Package: Feature/Change Request +Package: Sybase-ct (ctlib) related
 [2021-08-03 15:43 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-08-03 15:43 UTC]
The sybase extension is no longer available as of PHP 7.0.0, so
this ticket is obsolete.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 05:01:33 2024 UTC